![]() |
Entity Generator 4.2.0
Composable, deterministic entity generation for C++23
|
A component value as JSON: null, a boolean, an integer, a number, a (UTF-8) string, an array or an object. More...
#include <entitygen.hpp>
Public Types | |
| using | array = std::vector< json_value > |
| A JSON array. | |
| using | object = std::vector< std::pair< std::string, json_value > > |
| A JSON object, members in order. | |
Public Member Functions | |
| json_value ()=default | |
| null. | |
| json_value (std::nullptr_t) | |
| null. // NOLINT(google-explicit-constructor) | |
| json_value (std::string s) | |
| A string (UTF-8). // NOLINT(google-explicit-constructor) | |
| json_value (const char *s) | |
| A string (UTF-8). // NOLINT(google-explicit-constructor) | |
| json_value (array a) | |
| An array. // NOLINT(google-explicit-constructor) | |
| json_value (object o) | |
| An object. // NOLINT(google-explicit-constructor) | |
| template<std::same_as< bool > B> | |
| json_value (B b) | |
A boolean. Only bool itself: a pointer (such as a wide literal L"...") would otherwise convert and write true. | |
| template<std::integral I> requires (!std::same_as<I, bool>) | |
| json_value (I n) | |
| An integer. | |
| template<std::floating_point F> | |
| json_value (F d) | |
| A number; a non-finite one is null. | |
| const array * | get_array () const |
| The array held, or null when this is not an array. | |
| const object * | get_object () const |
| The object held, or null when this is not an object. | |
| object * | get_object () |
| The object held, or null when this is not an object. | |
| void | write (core::json_writer &w) const |
| Write this value. | |
A component value as JSON: null, a boolean, an integer, a number, a (UTF-8) string, an array or an object.
Objects keep their members in the order given. Integers convert implicitly to an integer value, floating-point numbers to a number (non-finite ones are written as null).
Definition at line 52 of file entitygen.hpp.
| using dasmig::json_value::array = std::vector<json_value> |
A JSON array.
Definition at line 55 of file entitygen.hpp.
| using dasmig::json_value::object = std::vector<std::pair<std::string, json_value> > |
A JSON object, members in order.
Definition at line 56 of file entitygen.hpp.
|
inline |
null. // NOLINT(google-explicit-constructor)
Definition at line 59 of file entitygen.hpp.
|
inline |
A string (UTF-8). // NOLINT(google-explicit-constructor)
Definition at line 60 of file entitygen.hpp.
|
inline |
A string (UTF-8). // NOLINT(google-explicit-constructor)
Definition at line 61 of file entitygen.hpp.
|
inline |
An array. // NOLINT(google-explicit-constructor)
Definition at line 62 of file entitygen.hpp.
|
inline |
An object. // NOLINT(google-explicit-constructor)
Definition at line 63 of file entitygen.hpp.
|
inline |
A boolean. Only bool itself: a pointer (such as a wide literal L"...") would otherwise convert and write true.
Definition at line 68 of file entitygen.hpp.
|
inline |
An integer.
Definition at line 73 of file entitygen.hpp.
|
inline |
A number; a non-finite one is null.
Definition at line 77 of file entitygen.hpp.
|
inline |
The array held, or null when this is not an array.
Definition at line 84 of file entitygen.hpp.
|
inline |
The object held, or null when this is not an object.
Definition at line 88 of file entitygen.hpp.
|
inline |
The object held, or null when this is not an object.
Definition at line 86 of file entitygen.hpp.
|
inline |
Write this value.
| w | Writer positioned where a value is allowed. |
Definition at line 92 of file entitygen.hpp.