[#nlohmann-basic_json-00] = xref:nlohmann.adoc[nlohmann]::basic_json :relfileprefix: ../ :mrdocs: a class to store JSON values == Synopsis Declared in `<nlohmann/json.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< template< typename U, typename V, typename... Args> typename ObjectType = map, template< typename U, typename... Args> typename ArrayType = vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = int64_t, class NumberUnsignedType = uint64_t, class NumberFloatType = double, template<typename U> typename AllocatorType = allocator, template< typename T, typename SFINAE = void> typename JSONSerializer = adl_serializer, class BinaryType = std::vector<uint8_t>, class CustomBaseClass = void> class basic_json : public nlohmann::detail::json_base_class<CustomBaseClass> ---- == Base Classes [cols=2] |=== | Name | Description | `nlohmann::detail::json_base_class<CustomBaseClass>` | |=== == Types [cols=2] |=== | Name | Description | xref:nlohmann/basic_json-00/allocator_type.adoc[`allocator_type`] | the allocator type | xref:nlohmann/basic_json-00/array_t.adoc[`array_t`] | a type for an array | xref:nlohmann/basic_json-00/binary_t.adoc[`binary_t`] | a type for a packed binary type | xref:nlohmann/basic_json-00/bjdata_version_t.adoc[`bjdata_version_t`] | how to encode BJData | xref:nlohmann/basic_json-00/boolean_t.adoc[`boolean_t`] | a type for a boolean | xref:nlohmann/basic_json-00/cbor_tag_handler_t.adoc[`cbor_tag_handler_t`] | how to treat CBOR tags | xref:nlohmann/basic_json-00/const_iterator.adoc[`const_iterator`] | a const iterator for a basic_json container | xref:nlohmann/basic_json-00/const_pointer.adoc[`const_pointer`] | the type of an element const pointer | xref:nlohmann/basic_json-00/const_reference.adoc[`const_reference`] | the type of an element const reference | xref:nlohmann/basic_json-00/const_reverse_iterator.adoc[`const_reverse_iterator`] | a const reverse iterator for a basic_json container | xref:nlohmann/basic_json-00/default_object_comparator_t.adoc[`default_object_comparator_t`] | | xref:nlohmann/basic_json-00/difference_type.adoc[`difference_type`] | a type to represent differences between iterators | xref:nlohmann/basic_json-00/error_handler_t.adoc[`error_handler_t`] | how to treat decoding errors | xref:nlohmann/basic_json-00/exception.adoc[`exception`] | Classes to implement user‐defined exceptions. @{ | xref:nlohmann/basic_json-00/initializer_list_t.adoc[`initializer_list_t`] | helper type for initializer lists of basic_json values | xref:nlohmann/basic_json-00/input_format_t.adoc[`input_format_t`] | | xref:nlohmann/basic_json-00/invalid_iterator.adoc[`invalid_iterator`] | | xref:nlohmann/basic_json-00/iterator.adoc[`iterator`] | an iterator for a basic_json container | xref:nlohmann/basic_json-00/json_pointer.adoc[`json_pointer`] | JSON Pointer, see xref:nlohmann/json_pointer-0b.adoc[`nlohmann::json_pointer`] | xref:nlohmann/basic_json-00/json_sax_t.adoc[`json_sax_t`] | SAX interface type, see `nlohmann::json_sax` | xref:nlohmann/basic_json-00/json_serializer.adoc[`json_serializer`] | | xref:nlohmann/basic_json-00/number_float_t.adoc[`number_float_t`] | a type for a number (floating‐point) | xref:nlohmann/basic_json-00/number_integer_t.adoc[`number_integer_t`] | a type for a number (integer) | xref:nlohmann/basic_json-00/number_unsigned_t.adoc[`number_unsigned_t`] | a type for a number (unsigned) | xref:nlohmann/basic_json-00/object_comparator_t.adoc[`object_comparator_t`] | object key comparator type | xref:nlohmann/basic_json-00/object_t.adoc[`object_t`] | a type for an object | xref:nlohmann/basic_json-00/other_error.adoc[`other_error`] | | xref:nlohmann/basic_json-00/out_of_range.adoc[`out_of_range`] | | xref:nlohmann/basic_json-00/parse_error.adoc[`parse_error`] | | xref:nlohmann/basic_json-00/parse_event_t.adoc[`parse_event_t`] | parser event types | xref:nlohmann/basic_json-00/parser_callback_t.adoc[`parser_callback_t`] | per‐element parser callback type | xref:nlohmann/basic_json-00/pointer.adoc[`pointer`] | the type of an element pointer | xref:nlohmann/basic_json-00/reference.adoc[`reference`] | the type of an element reference | xref:nlohmann/basic_json-00/reverse_iterator.adoc[`reverse_iterator`] | a reverse iterator for a basic_json container | xref:nlohmann/basic_json-00/size_type.adoc[`size_type`] | a type to represent container sizes | xref:nlohmann/basic_json-00/string_t.adoc[`string_t`] | a type for a string | xref:nlohmann/basic_json-00/type_error.adoc[`type_error`] | | xref:nlohmann/basic_json-00/value_t.adoc[`value_t`] | | xref:nlohmann/basic_json-00/value_type.adoc[`value_type`] | the type of elements in a basic_json container |=== == Member Functions [cols=2] |=== | Name | Description | xref:nlohmann/basic_json-00/2constructor-0f.adoc[`basic_json`] [.small]#[constructor]# | copy constructor | xref:nlohmann/basic_json-00/2constructor-08.adoc[`basic_json`] [.small]#[constructor]# | move constructor | xref:nlohmann/basic_json-00/2constructor-02.adoc[`basic_json`] [.small]#[constructor]# | create a null object | xref:nlohmann/basic_json-00/2constructor-0c2.adoc[`basic_json`] [.small]#[constructor]# | create an empty value with a given type | xref:nlohmann/basic_json-00/2constructor-04.adoc[`basic_json`] [.small]#[constructor]# | create a JSON value from an existing one | xref:nlohmann/basic_json-00/2constructor-01.adoc[`basic_json`] [.small]#[constructor]# | //////////////////////////////////// | xref:nlohmann/basic_json-00/2constructor-00.adoc[`basic_json`] [.small]#[constructor]# | create a JSON value from compatible types | xref:nlohmann/basic_json-00/2constructor-0b.adoc[`basic_json`] [.small]#[constructor]# | construct an array with count copies of given value | xref:nlohmann/basic_json-00/2constructor-07.adoc[`basic_json`] [.small]#[constructor]# | construct a JSON container given an iterator range | xref:nlohmann/basic_json-00/2constructor-0cf.adoc[`basic_json`] [.small]#[constructor]# | create a container (array or object) from an initializer list | xref:nlohmann/basic_json-00/2destructor.adoc[`~basic_json`] [.small]#[destructor]# | destructor | xref:nlohmann/basic_json-00/operator_assign.adoc[`operator=`] | copy assignment | xref:nlohmann/basic_json-00/at-0a4.adoc[`at`] | access specified array element with bounds checking | xref:nlohmann/basic_json-00/at-08.adoc[`at`] | access specified array element with bounds checking | xref:nlohmann/basic_json-00/at-00.adoc[`at`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-00/at-0f.adoc[`at`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-00/at-0b.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-00/at-03.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-00/at-09.adoc[`at`] | | xref:nlohmann/basic_json-00/at-06.adoc[`at`] | | xref:nlohmann/basic_json-00/at-05.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-00/at-0a9.adoc[`at`] | access specified object element with bounds checking | xref:nlohmann/basic_json-00/back-08e.adoc[`back`] | access the last element | xref:nlohmann/basic_json-00/back-088.adoc[`back`] | access the last element | xref:nlohmann/basic_json-00/begin-05.adoc[`begin`] | returns an iterator to the first element | xref:nlohmann/basic_json-00/begin-04.adoc[`begin`] | returns an iterator to the first element | xref:nlohmann/basic_json-00/cbegin.adoc[`cbegin`] | returns a const iterator to the first element | xref:nlohmann/basic_json-00/cend.adoc[`cend`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-00/clear.adoc[`clear`] | clears the contents | xref:nlohmann/basic_json-00/contains-01.adoc[`contains`] | check the existence of an element in a JSON object given a JSON pointer | xref:nlohmann/basic_json-00/contains-06.adoc[`contains`] | check the existence of an element in a JSON object | xref:nlohmann/basic_json-00/contains-0a.adoc[`contains`] | | xref:nlohmann/basic_json-00/contains-08.adoc[`contains`] | check the existence of an element in a JSON object | xref:nlohmann/basic_json-00/count-0d.adoc[`count`] | returns the number of occurrences of a key in a JSON object | xref:nlohmann/basic_json-00/count-0c.adoc[`count`] | returns the number of occurrences of a key in a JSON object | xref:nlohmann/basic_json-00/crbegin.adoc[`crbegin`] | returns a const reverse iterator to the last element | xref:nlohmann/basic_json-00/crend.adoc[`crend`] | returns a const reverse iterator to one before the first | xref:nlohmann/basic_json-00/dump.adoc[`dump`] | serialization | xref:nlohmann/basic_json-00/emplace.adoc[`emplace`] | add an object to an object if key does not exist | xref:nlohmann/basic_json-00/emplace_back.adoc[`emplace_back`] | add an object to an array | xref:nlohmann/basic_json-00/empty.adoc[`empty`] | checks whether the container is empty. | xref:nlohmann/basic_json-00/end-0a.adoc[`end`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-00/end-06.adoc[`end`] | returns an iterator to one past the last element | xref:nlohmann/basic_json-00/erase-069.adoc[`erase`] | remove element from a JSON array given an index | xref:nlohmann/basic_json-00/erase-067.adoc[`erase`] | remove element from a JSON object given a key | xref:nlohmann/basic_json-00/erase-0f.adoc[`erase`] | remove element given an iterator | xref:nlohmann/basic_json-00/erase-068.adoc[`erase`] | remove element from a JSON object given a key | xref:nlohmann/basic_json-00/erase-02.adoc[`erase`] | remove elements given an iterator range | xref:nlohmann/basic_json-00/find-0d.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-00/find-0ad.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-00/find-0a0.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-00/find-0f.adoc[`find`] | find an element in a JSON object | xref:nlohmann/basic_json-00/flatten.adoc[`flatten`] | return flattened JSON value | xref:nlohmann/basic_json-00/front-08.adoc[`front`] | access the first element | xref:nlohmann/basic_json-00/front-07.adoc[`front`] | access the first element | xref:nlohmann/basic_json-00/get-08.adoc[`get`] | get a pointer value (explicit) | xref:nlohmann/basic_json-00/get-0a.adoc[`get`] | get a (pointer) value (explicit) | xref:nlohmann/basic_json-00/get_binary-06.adoc[`get_binary`] | get a binary value | xref:nlohmann/basic_json-00/get_binary-01.adoc[`get_binary`] | get a binary value | xref:nlohmann/basic_json-00/get_ptr-0e.adoc[`get_ptr`] | get a pointer value (implicit) | xref:nlohmann/basic_json-00/get_ptr-0d.adoc[`get_ptr`] | get a pointer value (implicit) | xref:nlohmann/basic_json-00/get_ref-0e.adoc[`get_ref`] | get a reference value (implicit) | xref:nlohmann/basic_json-00/get_ref-05.adoc[`get_ref`] | get a reference value (implicit) | xref:nlohmann/basic_json-00/get_to-05.adoc[`get_to`] | get a value (explicit) | xref:nlohmann/basic_json-00/get_to-00.adoc[`get_to`] | | xref:nlohmann/basic_json-00/get_to-07.adoc[`get_to`] | | xref:nlohmann/basic_json-00/insert-00.adoc[`insert`] | inserts range of elements into object | xref:nlohmann/basic_json-00/insert-0a.adoc[`insert`] | inserts elements from initializer list into array | xref:nlohmann/basic_json-00/insert-0d6.adoc[`insert`] | inserts element into array | xref:nlohmann/basic_json-00/insert-03.adoc[`insert`] | inserts element into array | xref:nlohmann/basic_json-00/insert-0dc.adoc[`insert`] | inserts range of elements into array | xref:nlohmann/basic_json-00/insert-07.adoc[`insert`] | inserts copies of element into array | xref:nlohmann/basic_json-00/insert_iterator.adoc[`insert_iterator`] | Helper for insertion of an iterator | xref:nlohmann/basic_json-00/is_array.adoc[`is_array`] | return whether value is an array | xref:nlohmann/basic_json-00/is_binary.adoc[`is_binary`] | return whether value is a binary array | xref:nlohmann/basic_json-00/is_boolean.adoc[`is_boolean`] | return whether value is a boolean | xref:nlohmann/basic_json-00/is_discarded.adoc[`is_discarded`] | return whether value is discarded | xref:nlohmann/basic_json-00/is_null.adoc[`is_null`] | return whether value is null | xref:nlohmann/basic_json-00/is_number.adoc[`is_number`] | return whether value is a number | xref:nlohmann/basic_json-00/is_number_float.adoc[`is_number_float`] | return whether value is a floating‐point number | xref:nlohmann/basic_json-00/is_number_integer.adoc[`is_number_integer`] | return whether value is an integer number | xref:nlohmann/basic_json-00/is_number_unsigned.adoc[`is_number_unsigned`] | return whether value is an unsigned integer number | xref:nlohmann/basic_json-00/is_object.adoc[`is_object`] | return whether value is an object | xref:nlohmann/basic_json-00/is_primitive.adoc[`is_primitive`] | return whether type is primitive | xref:nlohmann/basic_json-00/is_string.adoc[`is_string`] | return whether value is a string | xref:nlohmann/basic_json-00/is_structured.adoc[`is_structured`] | return whether type is structured | xref:nlohmann/basic_json-00/items-0b.adoc[`items`] | helper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-00/items-0d.adoc[`items`] | helper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-00/max_size.adoc[`max_size`] | returns the maximum possible number of elements | xref:nlohmann/basic_json-00/merge_patch.adoc[`merge_patch`] | applies a JSON Merge Patch | xref:nlohmann/basic_json-00/operator_plus_eq-0c.adoc[`operator+=`] | add an object to an object | xref:nlohmann/basic_json-00/operator_plus_eq-08.adoc[`operator+=`] | add an object to an array | xref:nlohmann/basic_json-00/operator_plus_eq-03.adoc[`operator+=`] | add an object to an object | xref:nlohmann/basic_json-00/operator_plus_eq-0b.adoc[`operator+=`] | add an object to an array | xref:nlohmann/basic_json-00/operator_subs-08.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-00/operator_subs-0102.adoc[`operator[]`] | access specified array element | xref:nlohmann/basic_json-00/operator_subs-02.adoc[`operator[]`] | access specified array element | xref:nlohmann/basic_json-00/operator_subs-0b.adoc[`operator[]`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-00/operator_subs-03.adoc[`operator[]`] | access specified element via JSON Pointer | xref:nlohmann/basic_json-00/operator_subs-07.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-00/operator_subs-00.adoc[`operator[]`] | Subscript operator | xref:nlohmann/basic_json-00/operator_subs-05.adoc[`operator[]`] | Subscript operator | xref:nlohmann/basic_json-00/operator_subs-0c.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-00/operator_subs-010a.adoc[`operator[]`] | access specified object element | xref:nlohmann/basic_json-00/operator_subs-09.adoc[`operator[]`] | Subscript operator | xref:nlohmann/basic_json-00/operator_subs-0e.adoc[`operator[]`] | Subscript operator | xref:nlohmann/basic_json-00/patch.adoc[`patch`] | applies a JSON patch to a copy of the current object | xref:nlohmann/basic_json-00/patch_inplace.adoc[`patch_inplace`] | applies a JSON patch in‐place without copying the object | xref:nlohmann/basic_json-00/push_back-04.adoc[`push_back`] | add an object to an object | xref:nlohmann/basic_json-00/push_back-0d.adoc[`push_back`] | add an object to an array | xref:nlohmann/basic_json-00/push_back-00.adoc[`push_back`] | add an object to an object | xref:nlohmann/basic_json-00/push_back-01.adoc[`push_back`] | add an object to an array | xref:nlohmann/basic_json-00/rbegin-0e.adoc[`rbegin`] | returns an iterator to the reverse‐beginning | xref:nlohmann/basic_json-00/rbegin-00.adoc[`rbegin`] | returns an iterator to the reverse‐beginning | xref:nlohmann/basic_json-00/rend-02.adoc[`rend`] | returns an iterator to the reverse‐end | xref:nlohmann/basic_json-00/rend-0b.adoc[`rend`] | returns an iterator to the reverse‐end | xref:nlohmann/basic_json-00/size.adoc[`size`] | returns the number of elements | xref:nlohmann/basic_json-00/swap-0b.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/swap-04e.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/swap-0e.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/swap-09.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/swap-048.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/swap-03.adoc[`swap`] | exchanges the values | xref:nlohmann/basic_json-00/type.adoc[`type`] | return the type of the JSON value (explicit) | xref:nlohmann/basic_json-00/type_name.adoc[`type_name`] | return the type as string | xref:nlohmann/basic_json-00/unflatten.adoc[`unflatten`] | unflatten a previously flattened JSON value | xref:nlohmann/basic_json-00/update-0c.adoc[`update`] | updates a JSON object from another object, overwriting existing keys | xref:nlohmann/basic_json-00/update-06.adoc[`update`] | updates a JSON object from another object, overwriting existing keys | xref:nlohmann/basic_json-00/value-07.adoc[`value`] | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-00/value-0eb.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-00/value-0b.adoc[`value`] | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-00/value-0ed.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-00/value-09.adoc[`value`] | | xref:nlohmann/basic_json-00/value-01.adoc[`value`] | access specified object element with default value | xref:nlohmann/basic_json-00/value-08.adoc[`value`] | | xref:nlohmann/basic_json-00/value-0f.adoc[`value`] | access specified object element via JSON Pointer with default value | xref:nlohmann/basic_json-00/2conversion-0a.adoc[`operator ValueType`] | get a value (implicit) | xref:nlohmann/basic_json-00/2conversion-05.adoc[`operator value_t`] | return the type of the JSON value (implicit) | xref:nlohmann/basic_json-00/operator_eq-08.adoc[`operator==`] | comparison: equal | xref:nlohmann/basic_json-00/operator_eq-05.adoc[`operator==`] | comparison: equal | xref:nlohmann/basic_json-00/operator_not_eq.adoc[`operator!=`] | comparison: not equal | xref:nlohmann/basic_json-00/operator_3way-0c.adoc[`operator<=>`] | comparison: 3‐way | xref:nlohmann/basic_json-00/operator_3way-04.adoc[`operator<=>`] | comparison: 3‐way |=== == Static Member Functions [cols=2] |=== | Name | Description | xref:nlohmann/basic_json-00/accept-02.adoc[`accept`] | | xref:nlohmann/basic_json-00/accept-0e.adoc[`accept`] | check if the input is valid JSON | xref:nlohmann/basic_json-00/accept-04.adoc[`accept`] | check if the input is valid JSON | xref:nlohmann/basic_json-00/array.adoc[`array`] | explicitly create an array from an initializer list | xref:nlohmann/basic_json-00/binary-08.adoc[`binary`] | explicitly create a binary array (without subtype) | xref:nlohmann/basic_json-00/binary-0f.adoc[`binary`] | explicitly create a binary array | xref:nlohmann/basic_json-00/binary-04.adoc[`binary`] | explicitly create a binary array (with subtype) | xref:nlohmann/basic_json-00/binary-0c.adoc[`binary`] | explicitly create a binary array (with subtype) | xref:nlohmann/basic_json-00/diff.adoc[`diff`] | creates a diff as a JSON patch | xref:nlohmann/basic_json-00/from_bjdata-02.adoc[`from_bjdata`] | create a JSON value from an input in BJData format | xref:nlohmann/basic_json-00/from_bjdata-0f.adoc[`from_bjdata`] | create a JSON value from an input in BJData format | xref:nlohmann/basic_json-00/from_bson-04.adoc[`from_bson`] | | xref:nlohmann/basic_json-00/from_bson-09.adoc[`from_bson`] | create a JSON value from an input in BSON format | xref:nlohmann/basic_json-00/from_bson-05.adoc[`from_bson`] | create a JSON value from an input in BSON format | xref:nlohmann/basic_json-00/from_bson-0e.adoc[`from_bson`] | | xref:nlohmann/basic_json-00/from_cbor-01.adoc[`from_cbor`] | | xref:nlohmann/basic_json-00/from_cbor-03.adoc[`from_cbor`] | create a JSON value from an input in CBOR format | xref:nlohmann/basic_json-00/from_cbor-0d.adoc[`from_cbor`] | create a JSON value from an input in CBOR format | xref:nlohmann/basic_json-00/from_cbor-09.adoc[`from_cbor`] | | xref:nlohmann/basic_json-00/from_msgpack-04.adoc[`from_msgpack`] | | xref:nlohmann/basic_json-00/from_msgpack-0b.adoc[`from_msgpack`] | create a JSON value from an input in MessagePack format | xref:nlohmann/basic_json-00/from_msgpack-00.adoc[`from_msgpack`] | create a JSON value from an input in MessagePack format | xref:nlohmann/basic_json-00/from_msgpack-06.adoc[`from_msgpack`] | | xref:nlohmann/basic_json-00/from_ubjson-09.adoc[`from_ubjson`] | | xref:nlohmann/basic_json-00/from_ubjson-0b.adoc[`from_ubjson`] | create a JSON value from an input in UBJSON format | xref:nlohmann/basic_json-00/from_ubjson-04.adoc[`from_ubjson`] | create a JSON value from an input in UBJSON format | xref:nlohmann/basic_json-00/from_ubjson-0d.adoc[`from_ubjson`] | | xref:nlohmann/basic_json-00/get_allocator.adoc[`get_allocator`] | returns the allocator associated with the container | xref:nlohmann/basic_json-00/iterator_wrapper-0a.adoc[`iterator_wrapper`] | wrapper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-00/iterator_wrapper-03.adoc[`iterator_wrapper`] | wrapper to access iterator member functions in range‐based for | xref:nlohmann/basic_json-00/meta.adoc[`meta`] | returns version information on the library | xref:nlohmann/basic_json-00/object.adoc[`object`] | explicitly create an object from an initializer list | xref:nlohmann/basic_json-00/parse-01.adoc[`parse`] | | xref:nlohmann/basic_json-00/parse-0f.adoc[`parse`] | deserialize from a compatible input | xref:nlohmann/basic_json-00/parse-09.adoc[`parse`] | deserialize from a pair of character iterators | xref:nlohmann/basic_json-00/sax_parse-01.adoc[`sax_parse`] | generate SAX events | xref:nlohmann/basic_json-00/sax_parse-0b.adoc[`sax_parse`] | generate SAX events | xref:nlohmann/basic_json-00/sax_parse-04.adoc[`sax_parse`] | generate SAX events | xref:nlohmann/basic_json-00/to_bjdata-01.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-00/to_bjdata-0a.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-00/to_bjdata-0c.adoc[`to_bjdata`] | create a BJData serialization of a given JSON value | xref:nlohmann/basic_json-00/to_bson-01.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-00/to_bson-0b.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-00/to_bson-0f.adoc[`to_bson`] | create a BSON serialization of a given JSON value | xref:nlohmann/basic_json-00/to_cbor-05f.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-00/to_cbor-00.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-00/to_cbor-05c.adoc[`to_cbor`] | create a CBOR serialization of a given JSON value | xref:nlohmann/basic_json-00/to_msgpack-04.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-00/to_msgpack-03.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-00/to_msgpack-01.adoc[`to_msgpack`] | create a MessagePack serialization of a given JSON value | xref:nlohmann/basic_json-00/to_ubjson-02.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value | xref:nlohmann/basic_json-00/to_ubjson-06.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value | xref:nlohmann/basic_json-00/to_ubjson-0f.adoc[`to_ubjson`] | create a UBJSON serialization of a given JSON value |=== == Friends [cols=2] |=== | Name | Description | `xref:nlohmann/operator_rshift-0e.adoc[nlohmann::operator>>]` | deserialize from stream | `xref:nlohmann/operator_lshift-07.adoc[nlohmann::operator<<]` | deserialize from stream | `xref:nlohmann/operator_rshift-0d.adoc[nlohmann::operator>>]` | serialize to stream | `xref:nlohmann/operator_lshift-03.adoc[nlohmann::operator<<]` | serialize to stream | `xref:nlohmann/swap-03.adoc[nlohmann::swap]` | exchanges the values | `nlohmann::detail::exception` | general exception of the `basic_json` class | `nlohmann::detail::serializer` | | `xref:nlohmann/json_pointer-0b.adoc[nlohmann::json_pointer]` | |=== == Non-Member Functions [cols=2] |=== | Name | Description | xref:nlohmann/operator_lshift-053.adoc[`operator<<`] | deserialize from stream | xref:nlohmann/operator_rshift-08.adoc[`operator>>`] | serialize to stream | xref:nlohmann/to_string.adoc[`to_string`] | user‐defined to_string function for JSON values |=== == Description a class to store JSON values [,cpp] ---- @invariant The member variables @a m_value and @a m_type have the following relationship: - If `m_type == value_t::object`, then `m_value.object != nullptr`. - If `m_type == value_t::array`, then `m_value.array != nullptr`. - If `m_type == value_t::string`, then `m_value.string != nullptr`. The invariants are checked by member function assert_invariant(). @note ObjectType trick from https://stackoverflow.com/a/9860911 ---- [.small]#Created with https://www.mrdocs.com[MrDocs]#