JSON value. A container that holds a single bool, int64, uint64, double, JSON string, JSON array, or JSON object.
More...
|
| value () |
| Constructor. More...
|
|
| value (const allocator_type &alloc) |
| Constructor. More...
|
|
| value (const value &other) |
| Copy constructor. More...
|
|
| value (const value &other, const allocator_type &alloc) |
| Allocator-extended copy constructor. More...
|
|
| value (value &&other) noexcept |
| Move constructor. More...
|
|
| value (value &&other, const allocator_type &alloc) noexcept |
| Allocator-extended move constructor. More...
|
|
| ~value () noexcept |
| Destructor. More...
|
|
value & | operator= (const value &other) |
| Copy assignment operator. More...
|
|
value & | operator= (value &&other) noexcept |
| Move assignment operator. More...
|
|
void | swap (value &other) noexcept |
| Swap contents. More...
|
|
value & | operator= (const bool b) |
| Assign a bool value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const signed char i) |
| Assign a char value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const short i) |
| Assign a short value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const int i) |
| Assign an int value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const long i) |
| Assign a long value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const long long i) |
| Assign a long long value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const unsigned char u) |
| Assign an unsigned char value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const unsigned short u) |
| Assign an unsigned short value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const unsigned int u) |
| Assign an unsigned int value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const unsigned long u) |
| Assign an unsigned long value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const unsigned long long u) |
| Assign an unsigned long long value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (std::nullptr_t) |
| Assign a null value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const double d) |
| Assign a double value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (std::string_view s) |
| Assign a std::string_view value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const char *const s) |
| Assign a const char* value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const string_type &s) |
| Assign a string_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (string_type &&s) |
| Assign a string_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const array_type &arr) |
| Assign an array_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (array_type &&arr) |
| Assign an array_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (const object_type &obj) |
| Assign an object_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
value & | operator= (object_type &&obj) |
| Assign an object_type value. Allocates a memory storage or destroy the old content, if necessary. More...
|
|
void | emplace_null () |
| Set a null. The old content is destroyed. More...
|
|
bool & | emplace_bool () |
| Set a bool and return a reference. The old content is destroyed. More...
|
|
std::int64_t & | emplace_int64 () |
| Set a int64 and return a reference. The old content is destroyed. More...
|
|
std::uint64_t & | emplace_uint64 () |
| Set a uint64 and return a reference. The old content is destroyed. More...
|
|
double & | emplace_double () |
| Set a double and return a reference. The old content is destroyed. More...
|
|
string_type & | emplace_string () |
| Set an empty string and return a reference. The old content is destroyed. More...
|
|
array_type & | emplace_array () |
| Set an empty array and return a reference. The old content is destroyed. More...
|
|
object_type & | emplace_object () |
| Set an empty object and return a reference. The old content is destroyed. More...
|
|
bool & | as_bool () |
| Return a reference to the underlying bool, or throw an exception. More...
|
|
const bool & | as_bool () const |
| Return a const reference to the underlying bool, or throw an exception. More...
|
|
std::int64_t & | as_int64 () |
| Return a reference to the underlying std::int64_t, or throw an exception. More...
|
|
const std::int64_t & | as_int64 () const |
| Return a const reference to the underlying std::int64_t, or throw an exception. More...
|
|
std::uint64_t & | as_uint64 () |
| Return a reference to the underlying std::uint64_t, or throw an exception. More...
|
|
const std::uint64_t & | as_uint64 () const |
| Return a const reference to the underlying std::uint64_t, or throw an exception. More...
|
|
double & | as_double () |
| Return a reference to the underlying double, or throw an exception. More...
|
|
const double & | as_double () const |
| Return a const reference to the underlying double, or throw an exception. More...
|
|
string_type & | as_string () |
| Return a reference to the underlying string, or throw an exception. More...
|
|
const string_type & | as_string () const |
| Return a const reference to the underlying string, or throw an exception. More...
|
|
array_type & | as_array () |
| Return a reference to the underlying array, or throw an exception. More...
|
|
const array_type & | as_array () const |
| Return a const reference to the underlying array, or throw an exception. More...
|
|
object_type & | as_object () |
| Return a reference to the underlying object, or throw an exception. More...
|
|
const object_type & | as_object () const |
| Return a const reference to the underlying object, or throw an exception. More...
|
|
bool | is_null () const noexcept |
| Return true if this is a null. More...
|
|
bool | is_bool () const noexcept |
| Return true if this is a bool. More...
|
|
bool | is_int64 () const noexcept |
| Return true if this is a int64. More...
|
|
bool | is_uint64 () const noexcept |
| Return true if this is a uint64. More...
|
|
bool | is_double () const noexcept |
| Return true if this is a double. More...
|
|
bool | is_string () const noexcept |
| Return true if this is a string. More...
|
|
bool | is_array () const noexcept |
| Return true if this is an array. More...
|
|
bool | is_object () const noexcept |
| Return true if this is a object. More...
|
|
allocator_type | get_allocator () const noexcept |
| Return an allocator object. More...
|
|
template<typename Alloc = std::allocator<std::byte>>
class metall::json::value< Alloc >
JSON value. A container that holds a single bool, int64, uint64, double, JSON string, JSON array, or JSON object.
- Examples
- json_create.cpp, and json_open.cpp.