template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType, class BooleanType, class NumberIntegerType, class NumberUnsignedType, class NumberFloatType, template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
union nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value
a JSON value
The actual storage for a JSON value of the basic_json class. This union combines the different storage types for the JSON value types defined in value_t.
- Note
- Variable-length types (objects, arrays, and strings) are stored as pointers. The size of the union should not exceed 64 bits if the default value types are used.
- Since
- version 1.0.0
Definition at line 13126 of file json.hpp.
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
| ) |
|
|
default |
default constructor (for null values)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
boolean_t |
v | ) |
|
|
inlinenoexcept |
constructor for booleans
Definition at line 13146 of file json.hpp.
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
number_integer_t |
v | ) |
|
|
inlinenoexcept |
constructor for numbers (integer)
Definition at line 13148 of file json.hpp.
number_integer_t number_integer
number (integer)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
number_unsigned_t |
v | ) |
|
|
inlinenoexcept |
constructor for numbers (unsigned)
Definition at line 13150 of file json.hpp.
number_unsigned_t number_unsigned
number (unsigned integer)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
number_float_t |
v | ) |
|
|
inlinenoexcept |
constructor for numbers (floating-point)
Definition at line 13152 of file json.hpp.
number_float_t number_float
number (floating-point)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
value_t |
t | ) |
|
|
inline |
constructor for empty values of a given type
Definition at line 13154 of file json.hpp.
References nlohmann::detail::array, nlohmann::detail::boolean, nlohmann::detail::other_error::create(), JSON_THROW, JSON_UNLIKELY, nlohmann::detail::null, nlohmann::detail::number_float, nlohmann::detail::number_integer, nlohmann::detail::number_unsigned, nlohmann::detail::object, and nlohmann::detail::string.
13160 object = create<object_t>();
13166 array = create<array_t>();
13172 string = create<string_t>(
"");
NumberFloatType number_float_t
a type for a number (floating-point)
array_t * array
array (stored with pointer to save storage)
array (ordered collection of values)
NumberUnsignedType number_unsigned_t
a type for a number (unsigned)
static other_error create(int id_, const std::string &what_arg)
NumberIntegerType number_integer_t
a type for a number (integer)
number value (signed integer)
number_unsigned_t number_unsigned
number (unsigned integer)
number_float_t number_float
number (floating-point)
#define JSON_THROW(exception)
object (unordered set of name/value pairs)
BooleanType boolean_t
a type for a boolean
number_integer_t number_integer
number (integer)
number value (unsigned integer)
number value (floating-point)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
const string_t & |
value | ) |
|
|
inline |
constructor for strings
Definition at line 13219 of file json.hpp.
References Catch::Generators::value().
13221 string = create<string_t>(
value);
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
string_t && |
value | ) |
|
|
inline |
constructor for rvalue strings
Definition at line 13225 of file json.hpp.
References Catch::Generators::value().
13227 string = create<string_t>(std::move(
value));
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
const object_t & |
value | ) |
|
|
inline |
constructor for objects
Definition at line 13231 of file json.hpp.
References Catch::Generators::value().
13233 object = create<object_t>(
value);
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
object_t && |
value | ) |
|
|
inline |
constructor for rvalue objects
Definition at line 13237 of file json.hpp.
References Catch::Generators::value().
13239 object = create<object_t>(std::move(
value));
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
const array_t & |
value | ) |
|
|
inline |
constructor for arrays
Definition at line 13243 of file json.hpp.
References Catch::Generators::value().
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
array_t * array
array (stored with pointer to save storage)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::json_value |
( |
array_t && |
value | ) |
|
|
inline |
constructor for rvalue arrays
Definition at line 13249 of file json.hpp.
References Catch::Generators::value().
ValueType value(const typename object_t::key_type &key, const ValueType &default_value) const
access specified object element with default value
array_t * array
array (stored with pointer to save storage)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| void nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::destroy |
( |
value_t |
t | ) |
|
|
inlinenoexcept |
Definition at line 13254 of file json.hpp.
References nlohmann::detail::array, nlohmann::detail::object, and nlohmann::detail::string.
13260 AllocatorType<object_t> alloc;
13261 std::allocator_traits<decltype(alloc)>::destroy(alloc,
object);
13262 std::allocator_traits<decltype(alloc)>::deallocate(alloc,
object, 1);
13268 AllocatorType<array_t> alloc;
13269 std::allocator_traits<decltype(alloc)>::destroy(alloc,
array);
13270 std::allocator_traits<decltype(alloc)>::deallocate(alloc,
array, 1);
13276 AllocatorType<string_t> alloc;
13277 std::allocator_traits<decltype(alloc)>::destroy(alloc,
string);
13278 std::allocator_traits<decltype(alloc)>::deallocate(alloc,
string, 1);
object_t * object
object (stored with pointer to save storage)
array_t * array
array (stored with pointer to save storage)
string_t * string
string (stored with pointer to save storage)
array (ordered collection of values)
object (unordered set of name/value pairs)
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| array_t* nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::array |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| boolean_t nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::boolean |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| number_float_t nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::number_float |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| number_integer_t nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::number_integer |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| number_unsigned_t nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::number_unsigned |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| object_t* nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::object |
template<template< typename, typename, typename... > class ObjectType, template< typename, typename... > class ArrayType, class StringType , class BooleanType , class NumberIntegerType , class NumberUnsignedType , class NumberFloatType , template< typename > class AllocatorType, template< typename, typename=void > class JSONSerializer>
| string_t* nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer >::json_value::string |