| Name | Description |
|---|---|
nlohmann | namespace for Niels Lohmann |
namespace for Niels Lohmann
| Name | Description |
|---|---|
adl_serializer | default JSONSerializer template argument |
basic_json<> | |
basic_json | a class to store JSON values |
byte_container_with_subtype | an internal type for a backed binary type |
byte_container_with_subtype<vector<unsigned char>> | |
json_pointer | |
json_pointer | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
ordered_map | a minimal map-like container that preserves insertion order |
| Name | Description |
|---|---|
json | default specialization |
ordered_json | specialization that maintains the insertion order of object keys |
| Name | Description |
|---|---|
Unnamed overloads | |
operator>> | Right shift operators |
swap | exchanges the values |
to_string | user-defined to_string function for JSON values |
operator<< | Left shift operators |
https://github.com/nlohmann
namespace for Niels Lohmann
| Name | Description |
|---|---|
adl_serializer | default JSONSerializer template argument |
basic_json<> | |
basic_json | a class to store JSON values |
byte_container_with_subtype | an internal type for a backed binary type |
byte_container_with_subtype<vector<unsigned char>> | |
json_pointer | |
json_pointer | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
ordered_map | a minimal map-like container that preserves insertion order |
| Name | Description |
|---|---|
json | default specialization |
ordered_json | specialization that maintains the insertion order of object keys |
| Name | Description |
|---|---|
Unnamed overloads | |
operator>> | Right shift operators |
swap | exchanges the values |
to_string | user-defined to_string function for JSON values |
operator<< | Left shift operators |
https://github.com/nlohmann
default specialization
specialization that maintains the insertion order of object keys
default JSONSerializer template argument
Declared in <nlohmann/adl_serializer.hpp>
template<
typename T = void,
typename SFINAE = void>
struct adl_serializer;
This serializer ignores the template arguments and uses ADL(argument-dependent lookup)for serialization.
| Name | Description |
|---|---|
from_json | convert a JSON value to any value type |
to_json | convert any value type to a JSON value |
convert a JSON value to any value type
Declared in <nlohmann/adl_serializer.hpp>
convert a JSON value to any value type
template<
typename BasicJsonType,
typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
from_json(BasicJsonType&& j) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType>{})));
» more...
convert a JSON value to any value type
template<
typename BasicJsonType,
typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
from_json(
BasicJsonType&& j,
TargetType& val) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)));
» more...
convert a JSON value to any value type
Declared in <nlohmann/adl_serializer.hpp>
template<
typename BasicJsonType,
typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType> {}))
from_json(BasicJsonType&& j) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), detail::identity_tag<TargetType>{})));
convert a JSON value to any value type
Declared in <nlohmann/adl_serializer.hpp>
template<
typename BasicJsonType,
typename TargetType = ValueType>
static
decltype(::nlohmann::from_json(std::forward<BasicJsonType>(j), val), void())
from_json(
BasicJsonType&& j,
TargetType& val) noexcept(noexcept(::nlohmann::from_json(std::forward<BasicJsonType>(j), val)));
convert any value type to a JSON value
Declared in <nlohmann/adl_serializer.hpp>
template<
typename BasicJsonType,
typename TargetType = ValueType>
static
decltype(::nlohmann::to_json(j, std::forward<TargetType>(val)), void())
to_json(
BasicJsonType& j,
TargetType&& val) noexcept(noexcept(::nlohmann::to_json(j, std::forward<TargetType>(val))));
Declared in <nlohmann/json.hpp>
template<>
class basic_json<>
: public nlohmann::detail::json_base_class<void>
| Name | Description |
|---|---|
nlohmann::detail::json_base_class<void> |
| Name | Description |
|---|---|
allocator_type | the allocator type |
array_t | a type for an array |
binary_t | a type for a packed binary type |
bjdata_version_t | how to encode BJData |
boolean_t | a type for a boolean |
cbor_tag_handler_t | how to treat CBOR tags |
const_iterator | a const iterator for a basic_json container |
const_pointer | the type of an element const pointer |
const_reference | the type of an element const reference |
const_reverse_iterator | a const reverse iterator for a basic_json container |
default_object_comparator_t | |
difference_type | a type to represent differences between iterators |
error_handler_t | how to treat decoding errors |
exception | Classes to implement user-defined exceptions. @{ |
initializer_list_t | helper type for initializer lists of basic_json values |
input_format_t | |
invalid_iterator | |
iterator | an iterator for a basic_json container |
json_pointer | JSON Pointer, see nlohmann::json_pointer |
json_sax_t | SAX interface type, see nlohmann::json_sax |
json_serializer | |
number_float_t | a type for a number (floating-point) |
number_integer_t | a type for a number (integer) |
number_unsigned_t | a type for a number (unsigned) |
object_comparator_t | object key comparator type |
object_t | a type for an object |
other_error | |
out_of_range | |
parse_error | |
parse_event_t | parser event types |
parser_callback_t | per-element parser callback type |
pointer | the type of an element pointer |
reference | the type of an element reference |
reverse_iterator | a reverse iterator for a basic_json container |
size_type | a type to represent container sizes |
string_t | a type for a string |
type_error | |
value_t | |
value_type | the type of elements in a basic_json container |
| Name | Description |
|---|---|
basic_json [constructor] | Default constructor |
basic_json [constructor] | Construct from value_t |
basic_json [constructor] | Construct from basic_json |
basic_json [constructor] | Construct from basic_json |
basic_json [constructor] | create a JSON value from an existing one |
basic_json [constructor] | //////////////////////////////////// |
basic_json [constructor] | create a JSON value from compatible types |
basic_json [constructor] | Constructor |
basic_json [constructor] | construct a JSON container given an iterator range |
basic_json [constructor] | |
~basic_json [destructor] | Destructor |
operator= | Assignment operator |
at | |
at | |
at | |
at | |
at | |
at | |
at | |
at | |
at | access specified object element with bounds checking |
at | access specified object element with bounds checking |
back | |
back | |
begin | |
begin | |
cbegin | |
cend | |
clear | |
contains | |
contains | |
contains | |
contains | check the existence of an element in a JSON object |
count | |
count | returns the number of occurrences of a key in a JSON object |
crbegin | |
crend | |
dump | |
emplace | add an object to an object if key does not exist |
emplace_back | add an object to an array |
empty | |
end | |
end | |
erase | |
erase | |
erase | remove element given an iterator |
erase | remove element from a JSON object given a key |
erase | remove elements given an iterator range |
find | |
find | |
find | find an element in a JSON object |
find | find an element in a JSON object |
flatten | |
front | |
front | |
get | get a pointer value (explicit) |
get | get a (pointer) value (explicit) |
get_binary | |
get_binary | |
get_ptr | get a pointer value (implicit) |
get_ptr | get a pointer value (implicit) |
get_ref | get a reference value (implicit) |
get_ref | get a reference value (implicit) |
get_to | get a value (explicit) |
get_to | |
get_to | |
insert | |
insert | |
insert | |
insert | |
insert | |
insert | |
insert_iterator | Helper for insertion of an iterator |
is_array | |
is_binary | |
is_boolean | |
is_discarded | |
is_null | |
is_number | |
is_number_float | |
is_number_integer | |
is_number_unsigned | |
is_object | |
is_primitive | |
is_string | |
is_structured | |
items | |
items | |
max_size | |
merge_patch | |
operator+= | Addition assignment operator |
operator+= | Addition assignment operator |
operator+= | Addition assignment operator |
operator+= | Addition assignment operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | access specified object element |
operator[] | access specified object element |
operator[] | Subscript operator |
operator[] | Subscript operator |
patch | |
patch_inplace | |
push_back | |
push_back | |
push_back | |
push_back | |
rbegin | |
rbegin | |
rend | |
rend | |
size | |
swap | |
swap | |
swap | |
swap | |
swap | |
swap | |
type | |
type_name | |
unflatten | |
update | |
update | |
value | access specified object element via JSON Pointer with default value |
value | access specified object element with default value |
value | access specified object element via JSON Pointer with default value |
value | access specified object element with default value |
value | |
value | access specified object element with default value |
value | |
value | access specified object element via JSON Pointer with default value |
operator ValueType | get a value (implicit) |
operator value_t | Conversion to value_t |
operator== | comparison: equal |
operator== | Equality operator |
operator!= | Inequality operator |
operator<=> | comparison: 3-way |
operator<=> | Three-way comparison operator |
| Name | Description |
|---|---|
accept | |
accept | check if the input is valid JSON |
accept | check if the input is valid JSON |
array | |
binary | |
binary | |
binary | |
binary | |
diff | |
from_bjdata | create a JSON value from an input in BJData format |
from_bjdata | create a JSON value from an input in BJData format |
from_bson | |
from_bson | create a JSON value from an input in BSON format |
from_bson | create a JSON value from an input in BSON format |
from_bson | |
from_cbor | |
from_cbor | create a JSON value from an input in CBOR format |
from_cbor | create a JSON value from an input in CBOR format |
from_cbor | |
from_msgpack | |
from_msgpack | create a JSON value from an input in MessagePack format |
from_msgpack | create a JSON value from an input in MessagePack format |
from_msgpack | |
from_ubjson | |
from_ubjson | create a JSON value from an input in UBJSON format |
from_ubjson | create a JSON value from an input in UBJSON format |
from_ubjson | |
get_allocator | |
iterator_wrapper | |
iterator_wrapper | |
meta | |
object | |
parse | |
parse | deserialize from a compatible input |
parse | deserialize from a pair of character iterators |
sax_parse | generate SAX events |
sax_parse | generate SAX events |
sax_parse | generate SAX events |
to_bjdata | |
to_bjdata | |
to_bjdata | |
to_bson | |
to_bson | |
to_bson | |
to_cbor | |
to_cbor | |
to_cbor | |
to_msgpack | |
to_msgpack | |
to_msgpack | |
to_ubjson | |
to_ubjson | |
to_ubjson |
| Name | Description |
|---|---|
nlohmann::operator>> | deserialize from stream |
nlohmann::operator<< | deserialize from stream |
nlohmann::operator>> | serialize to stream |
nlohmann::operator<< | serialize to stream |
nlohmann::swap | exchanges the values |
nlohmann::detail::exception | general exception of the basic_json class |
nlohmann::detail::serializer | |
nlohmann::json_pointer | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
the allocator type
Declared in <nlohmann/json.hpp>
using allocator_type = allocator<basic_json<>>;
a type for an array
Declared in <nlohmann/json.hpp>
using array_t = vector<basic_json<>, allocator<basic_json<>>>;
a type for a packed binary type
Declared in <nlohmann/json.hpp>
using binary_t = nlohmann::byte_container_with_subtype<vector<unsigned char>>;
how to encode BJData
Declared in <nlohmann/json.hpp>
using bjdata_version_t = detail::bjdata_version_t;
a type for a boolean
Declared in <nlohmann/json.hpp>
using boolean_t = bool;
how to treat CBOR tags
Declared in <nlohmann/json.hpp>
using cbor_tag_handler_t = detail::cbor_tag_handler_t;
a const iterator for a basic_json container
the type of an element const pointer
Declared in <nlohmann/json.hpp>
using const_pointer = std::allocator_traits<allocator_type>::const_pointer;
the type of an element const reference
a const reverse iterator for a basic_json container
Declared in <nlohmann/json.hpp>
using const_reverse_iterator = json_reverse_iterator<basic_json<>::const_iterator>;
Declared in <nlohmann/json.hpp>
using default_object_comparator_t = std::less<>;
a type to represent differences between iterators
Declared in <nlohmann/json.hpp>
using difference_type = std::ptrdiff_t;
how to treat decoding errors
Declared in <nlohmann/json.hpp>
using error_handler_t = detail::error_handler_t;
Classes to implement user-defined exceptions. @{
Declared in <nlohmann/json.hpp>
using exception = detail::exception;
helper type for initializer lists of basic_json values
Declared in <nlohmann/json.hpp>
using initializer_list_t = std::initializer_list<detail::json_ref<basic_json<>>>;
Declared in <nlohmann/json.hpp>
using input_format_t = detail::input_format_t;
Declared in <nlohmann/json.hpp>
using invalid_iterator = detail::invalid_iterator;
an iterator for a basic_json container
JSON Pointer, see nlohmann::json_pointer
Declared in <nlohmann/json.hpp>
using json_pointer = nlohmann::json_pointer<basic_string<char>>;
SAX interface type, see nlohmann::json_sax
Declared in <nlohmann/json.hpp>
using json_sax_t = json_sax<basic_json<>>;
Declared in <nlohmann/json.hpp>
template<
typename T,
typename SFINAE>
using json_serializer = adl_serializer<T, SFINAE>;
a type for a number (floating-point)
Declared in <nlohmann/json.hpp>
using number_float_t = double;
a type for a number (integer)
Declared in <nlohmann/json.hpp>
using number_integer_t = long;
a type for a number (unsigned)
Declared in <nlohmann/json.hpp>
using number_unsigned_t = unsigned long;
object key comparator type
Declared in <nlohmann/json.hpp>
using object_comparator_t = detail::actual_object_comparator_t<basic_json<>>;
a type for an object
Declared in <nlohmann/json.hpp>
using object_t = map<basic_string<char>, basic_json<>, default_object_comparator_t, allocator<std::pair<basic_string<char> const, basic_json<>>>>;
Declared in <nlohmann/json.hpp>
using other_error = detail::other_error;
Declared in <nlohmann/json.hpp>
using out_of_range = detail::out_of_range;
Declared in <nlohmann/json.hpp>
using parse_error = detail::parse_error;
parser event types
Declared in <nlohmann/json.hpp>
using parse_event_t = detail::parse_event_t;
per-element parser callback type
Declared in <nlohmann/json.hpp>
using parser_callback_t = detail::parser_callback_t<basic_json<>>;
the type of an element pointer
Declared in <nlohmann/json.hpp>
using pointer = std::allocator_traits<allocator_type>::pointer;
the type of an element reference
a reverse iterator for a basic_json container
Declared in <nlohmann/json.hpp>
using reverse_iterator = json_reverse_iterator<basic_json<>::iterator>;
a type to represent container sizes
Declared in <nlohmann/json.hpp>
using size_type = std::size_t;
a type for a string
Declared in <nlohmann/json.hpp>
using string_t = basic_string<char>;
Declared in <nlohmann/json.hpp>
using type_error = detail::type_error;
Declared in <nlohmann/json.hpp>
using value_t = detail::value_t;
the type of elements in a basic_json container
Default constructor
Declared in <nlohmann/json.hpp>
basic_json(std::nullptr_t value = nullptr) noexcept;
| Name | Description |
|---|---|
| value | The object to construct from |
Construct from value_t
| Name | Description |
|---|---|
| v | The object to construct from |
Construct from basic_json
| Name | Description |
|---|---|
| other | The object to copy construct from |
Construct from basic_json
| Name | Description |
|---|---|
| other | The object to move construct from |
create a JSON value from an existing one
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value&& !std::is_same<basic_json, BasicJsonType>::value
basic_json(BasicJsonType const& val);
| Name | Description |
|---|---|
| val | The object to copy construct from |
////////////////////////////////////
Declared in <nlohmann/json.hpp>
template<typename JsonRef>
requires detail::conjunction<detail::is_json_ref<JsonRef>,
std::is_same<typename JsonRef::value_type, basic_json>>::value
basic_json(JsonRef const& ref);
| Name | Description |
|---|---|
| ref | The object to copy construct from |
create a JSON value from compatible types
Declared in <nlohmann/json.hpp>
template<
typename CompatibleType,
typename U = detail::uncvref_t<CompatibleType>>
requires !detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value
basic_json(CompatibleType&& val) noexcept(noexcept(JSONSerializer<U, void>::to_json(std::declval<basic_json_t &>(), std::forward<CompatibleType>(val))));
| Name | Description |
|---|---|
| val | The object to move construct from |
Constructor
| Name | Description |
|---|---|
| cnt | The object to construct from |
| val | a class to store JSON values |
construct a JSON container given an iterator range
Declared in <nlohmann/json.hpp>
template<class InputIT>
requires std::is_same<InputIT, typename basic_json_t::iterator>::value ||
std::is_same<InputIT, typename basic_json_t::const_iterator>::value
basic_json(
InputIT first,
InputIT last);
| Name | Description |
|---|---|
| first | The object to construct from |
Declared in <nlohmann/json.hpp>
basic_json(
initializer_list_t init,
bool type_deduction = true,
value_t manual_type = value_t::array);
Destructor
Declared in <nlohmann/json.hpp>
~basic_json() noexcept;
Assignment operator
Declared in <nlohmann/json.hpp>
basic_json<>&
operator=(basic_json<> other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value && std::is_nothrow_move_assignable<json_base_class_t>::value);
a class to store JSON values
| Name | Description |
|---|---|
| other | The object to assign from |
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
reference
at(nlohmann::json_pointer<BasicJsonType> const& ptr);
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
const_reference
at(nlohmann::json_pointer<BasicJsonType> const& ptr) const;
access specified object element with bounds checking
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
reference
at(KeyType&& key);
the type of an element reference
access specified object element with bounds checking
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_reference
at(KeyType&& key) const;
the type of an element const reference
Declared in <nlohmann/json.hpp>
void
clear() noexcept;
Declared in <nlohmann/json.hpp>
bool
contains(object_t::key_type const& key) const;
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
bool
contains(nlohmann::json_pointer<BasicJsonType> const& ptr) const;
check the existence of an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
bool
contains(KeyType&& key) const;
returns the number of occurrences of a key in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
size_type
count(KeyType&& key) const;
a type to represent container sizes
Declared in <nlohmann/json.hpp>
string_t
dump(
int const indent = -1,
char const indent_char = ' ',
bool const ensure_ascii = false,
error_handler_t const error_handler = error_handler_t::strict) const;
add an object to an object if key does not exist
Declared in <nlohmann/json.hpp>
template<class... Args>
std::pair<iterator, bool>
emplace(Args&&... args);
add an object to an array
Declared in <nlohmann/json.hpp>
template<class... Args>
reference
emplace_back(Args&&... args);
the type of an element reference
Declared in <nlohmann/json.hpp>
bool
empty() const noexcept;
remove element given an iterator
Declared in <nlohmann/json.hpp>
template<class IteratorType>
requires std::is_same<IteratorType, typename basic_json_t::iterator>::value ||
std::is_same<IteratorType, typename basic_json_t::const_iterator>::value
IteratorType
erase(IteratorType pos);
remove element from a JSON object given a key
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
size_type
erase(KeyType&& key);
a type to represent container sizes
remove elements given an iterator range
Declared in <nlohmann/json.hpp>
template<class IteratorType>
requires std::is_same<IteratorType, typename basic_json_t::iterator>::value ||
std::is_same<IteratorType, typename basic_json_t::const_iterator>::value
IteratorType
erase(
IteratorType first,
IteratorType last);
find an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
iterator
find(KeyType&& key);
an iterator for a basic_json container
find an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_iterator
find(KeyType&& key) const;
a const iterator for a basic_json container
get a pointer value (explicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value
decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>())
get() noexcept;
Explicit pointer access to the internally stored JSON value. No copies are made.
The pointer becomes invalid if the underlying JSON object changes.
Constant.
{The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a nullptr is returned if the value and the requested pointer type does not match.,get__PointerType}
pointer to the internally stored JSON value if the requested pointer type PointerType fits to the JSON value; nullptr otherwise
| Name | Description |
|---|---|
| PointerType | pointer type; must be a pointer to array_t, object_t, string_t, boolean_t, number_integer_t, number_unsigned_t, or number_float_t. |
get a (pointer) value (explicit)
Declared in <nlohmann/json.hpp>
template<
typename ValueTypeCV,
typename ValueType = detail::uncvref_t<ValueTypeCV>>
constexpr
decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
get() const noexcept(noexcept(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4>{})));
Performs explicit type conversion between the JSON value and a compatible value if required.
If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made.
If the requested type is the current basic_json, or a different basic_json convertible from the current basic_json.
Otherwise the value is converted by calling the json_serializer<ValueType> from_json() method.
| Name | Thrown on |
|---|---|
what | json_serializer<ValueType> from_json() method throws if conversion is required |
copy of the JSON value, converted to
| Name | Description |
|---|---|
| ValueTypeCV | the provided value type |
| ValueType | the returned value type |
| ValueType | if necessary |
get a pointer value (implicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value
decltype(std::declval<basic_json_t&>().get_impl_ptr(std::declval<PointerType>()))
get_ptr() noexcept;
get a pointer value (implicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value&&
std::is_const<typename std::remove_pointer<PointerType>::type>::value
constexpr
decltype(std::declval<const basic_json_t&>().get_impl_ptr(std::declval<PointerType>()))
get_ptr() const noexcept;
get a reference value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ReferenceType>
requires std::is_reference<ReferenceType>::value
ReferenceType
get_ref();
get a reference value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ReferenceType>
requires std::is_reference<ReferenceType>::value&&
std::is_const<typename std::remove_reference<ReferenceType>::type>::value
ReferenceType
get_ref() const;
get a value (explicit)
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires !detail::is_basic_json<ValueType>::value&&
detail::has_from_json<basic_json_t, ValueType>::value
ValueType&
get_to(ValueType& v) const noexcept(noexcept(JSONSerializer<ValueType, void>::from_json(std::declval<const basic_json_t &>(), v)));
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires detail::is_basic_json<ValueType>::value
ValueType&
get_to(ValueType& v) const;
Declared in <nlohmann/json.hpp>
template<
typename T,
std::size_t N,
typename Array = T(&)[N]>
requires detail::has_from_json<basic_json_t, Array>::value
Array
get_to(T(& v)[N]) const noexcept(noexcept(JSONSerializer<Array, void>::from_json(std::declval<const basic_json_t &>(), v)));
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
initializer_list_t ilist);
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
basic_json<> const& val);
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
const_iterator first,
const_iterator last);
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
size_type cnt,
basic_json<> const& val);
Helper for insertion of an iterator
Declared in <nlohmann/json.hpp>
template<typename... Args>
iterator
insert_iterator(
const_iterator pos,
Args&&... args);
: This uses std::distance to support GCC 4.8, see https://github.com/nlohmann/json/pull/1257
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
Declared in <nlohmann/json.hpp>
constexpr
bool
is_array() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_binary() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_boolean() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_discarded() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_null() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_float() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_integer() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_unsigned() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_object() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_primitive() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_string() const noexcept;
Declared in <nlohmann/json.hpp>
constexpr
bool
is_structured() const noexcept;
Addition assignment operator
the type of an element reference
| Name | Description |
|---|---|
| init | The right operand |
Addition assignment operator
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
Addition assignment operator
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
Addition assignment operator
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
Subscript operator
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
the type of an element reference
| Name | Description |
|---|---|
| idx | The right operand |
Subscript operator
the type of an element const reference
| Name | Description |
|---|---|
| idx | The right operand |
Subscript operator
the type of an element reference
| Name | Description |
|---|---|
| ptr | The right operand |
Subscript operator
the type of an element const reference
| Name | Description |
|---|---|
| ptr | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
const_reference
operator[](object_t::key_type const& key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
reference
operator[](nlohmann::json_pointer<BasicJsonType> const& ptr);
the type of an element reference
| Name | Description |
|---|---|
| ptr | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
const_reference
operator[](nlohmann::json_pointer<BasicJsonType> const& ptr) const;
the type of an element const reference
| Name | Description |
|---|---|
| ptr | The right operand |
access specified object element
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
reference
operator[](KeyType&& key);
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
access specified object element
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_reference
operator[](KeyType&& key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename T>
const_reference
operator[](T* key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
Declared in <nlohmann/json.hpp>
void
push_back(object_t::value_type const& val);
Declared in <nlohmann/json.hpp>
void
swap(reference other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
Declared in <nlohmann/json.hpp>
[[__returns_nonnull__]]
char const*
type_name() const noexcept;
Declared in <nlohmann/json.hpp>
void
update(
const_reference j,
bool merge_objects = false);
Declared in <nlohmann/json.hpp>
void
update(
const_iterator first,
const_iterator last,
bool merge_objects = false);
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<class ValueType>
requires detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
json_pointer const& ptr,
ValueType const& default_value) const;
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<class ValueType>
requires !detail::is_transparent<object_comparator_t>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
object_t::key_type const& key,
ValueType const& default_value) const;
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
json_pointer const& ptr,
ValueType&& default_value) const;
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class ReturnType = value_return_type<ValueType>::type>
requires !detail::is_transparent<object_comparator_t>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
object_t::key_type const& key,
ValueType&& default_value) const;
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
[[__deprecated__]]
ValueType
value(
nlohmann::json_pointer<BasicJsonType> const& ptr,
ValueType const& default_value) const;
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class KeyType>
requires detail::is_transparent<object_comparator_t>::value
&& !detail::is_json_pointer<KeyType>::value
&& is_comparable_with_object_key<KeyType>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
KeyType&& key,
ValueType const& default_value) const;
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class BasicJsonType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_basic_json<BasicJsonType>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
[[__deprecated__]]
ReturnType
value(
nlohmann::json_pointer<BasicJsonType> const& ptr,
ValueType&& default_value) const;
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class KeyType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_transparent<object_comparator_t>::value
&& !detail::is_json_pointer<KeyType>::value
&& is_comparable_with_object_key<KeyType>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
KeyType&& key,
ValueType&& default_value) const;
get a value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires detail::conjunction <
detail::negation<std::is_pointer<ValueType>>,
detail::negation<std::is_same<ValueType, std::nullptr_t>>,
detail::negation<std::is_same<ValueType, detail::json_ref<basic_json>>>,
detail::negation<std::is_same<ValueType, typename string_t::value_type>>,
detail::negation<detail::is_basic_json<ValueType>>,
detail::negation<std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>>,
#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914))
detail::negation<std::is_same<ValueType, std::string_view>>,
#endif
#if defined(JSON_HAS_CPP_17) && JSON_HAS_STATIC_RTTI
detail::negation<std::is_same<ValueType, std::any>>,
#endif
detail::is_detected_lazy<detail::get_template_function, const basic_json_t&, ValueType>
>::value
operator ValueType() const;
Implicit type conversion between the JSON value and a compatible value. The call is realized by calling get() const.
Linear in the size of the JSON value.
{The example below shows several conversions from JSON values to other types. There a few things to note: (1) Floating-point numbers can be converted to integers, (2) A JSON array can be converted to a standard std::vector<short>, (3) A JSON object can be converted to C++ associative containers such as `std::unordered_map<std::string\, json>`.,operator__ValueType}
| Name | Thrown on |
|---|---|
type_error.302 | in case passed type ValueType is incompatible to the JSON value type (e.g., the JSON value is of type boolean, but a string is requested); see example below |
copy of the JSON value, converted to type ValueType
| Name | Description |
|---|---|
| ValueType | non-pointer type compatible to the JSON value, for instance int for JSON integer numbers, bool for JSON booleans, or std::vector types for JSON arrays. The character type of string_t as well as an initializer list of this type is excluded to avoid ambiguities as these types implicitly convert to std::string. |
Conversion to value_t
The object converted to value_t
comparison: equal
Declared in <nlohmann/json.hpp>
template<typename ScalarType>
requires std::is_scalar_v<ScalarType>
bool
operator==(ScalarType rhs) const noexcept;
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Equality operator
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Inequality operator
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
comparison: 3-way
Declared in <nlohmann/json.hpp>
template<typename ScalarType>
requires std::is_scalar_v<ScalarType>
std::partial_ordering
operator<=>(ScalarType rhs) const noexcept;
The relative order of the objects
| Name | Description |
|---|---|
| rhs | The right operand |
Three-way comparison operator
Declared in <nlohmann/json.hpp>
std::partial_ordering
operator<=>(const_reference rhs) const noexcept;
The relative order of the objects
| Name | Description |
|---|---|
| rhs | The right operand |
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
bool
accept(
detail::span_input_adapter&& i,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
check if the input is valid JSON
Declared in <nlohmann/json.hpp>
template<typename InputType>
static
bool
accept(
InputType&& i,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
check if the input is valid JSON
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
static
bool
accept(
IteratorType first,
IteratorType last,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
array(initializer_list_t init = {});
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
binary(binary_t::container_type const& init);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
binary(binary_t::container_type&& init);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
binary(
binary_t::container_type const& init,
binary_t::subtype_type subtype);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
binary(
binary_t::container_type&& init,
binary_t::subtype_type subtype);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
diff(
basic_json<> const& source,
basic_json<> const& target,
string_t const& path = "");
create a JSON value from an input in BJData format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
from_bjdata(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in BJData format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
from_bjdata(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_bson(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in BSON format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
from_bson(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in BSON format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
from_bson(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_bson(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_cbor(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
create a JSON value from an input in CBOR format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
from_cbor(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
a class to store JSON values
| Name | Description |
|---|---|
| tag_handler | how to treat CBOR tags |
create a JSON value from an input in CBOR format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
from_cbor(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
a class to store JSON values
| Name | Description |
|---|---|
| tag_handler | how to treat CBOR tags |
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_cbor(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_msgpack(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in MessagePack format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
from_msgpack(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in MessagePack format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
from_msgpack(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_msgpack(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_ubjson(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in UBJSON format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
from_ubjson(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in UBJSON format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
from_ubjson(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
from_ubjson(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
static
iteration_proxy<const_iterator>
iterator_wrapper(const_reference ref) noexcept;
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
static
iteration_proxy<iterator>
iterator_wrapper(reference ref) noexcept;
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json<>
object(initializer_list_t init = {});
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json<>
parse(
detail::span_input_adapter&& i,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
deserialize from a compatible input
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json<>
parse(
InputType&& i,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
a class to store JSON values
| Name | Description |
|---|---|
| cb | per-element parser callback type |
deserialize from a pair of character iterators
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json<>
parse(
IteratorType first,
IteratorType last,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
a class to store JSON values
| Name | Description |
|---|---|
| cb | per-element parser callback type |
generate SAX events
Declared in <nlohmann/json.hpp>
template<typename SAX>
[[__deprecated__, __nonnull__]]
static
bool
sax_parse(
detail::span_input_adapter&& i,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
generate SAX events
Declared in <nlohmann/json.hpp>
template<
typename InputType,
typename SAX>
[[__nonnull__]]
static
bool
sax_parse(
InputType&& i,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
generate SAX events
Declared in <nlohmann/json.hpp>
template<
class IteratorType,
class SAX>
[[__nonnull__]]
static
bool
sax_parse(
IteratorType first,
IteratorType last,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_bjdata(
basic_json<> const& j,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
Declared in <nlohmann/json.hpp>
static
void
to_bjdata(
basic_json<> const& j,
detail::output_adapter<char> o,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
Declared in <nlohmann/json.hpp>
static
void
to_bjdata(
basic_json<> const& j,
detail::output_adapter<uint8_t> o,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_bson(basic_json<> const& j);
Declared in <nlohmann/json.hpp>
static
void
to_bson(
basic_json<> const& j,
detail::output_adapter<char> o);
Declared in <nlohmann/json.hpp>
static
void
to_bson(
basic_json<> const& j,
detail::output_adapter<uint8_t> o);
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_cbor(basic_json<> const& j);
Declared in <nlohmann/json.hpp>
static
void
to_cbor(
basic_json<> const& j,
detail::output_adapter<char> o);
Declared in <nlohmann/json.hpp>
static
void
to_cbor(
basic_json<> const& j,
detail::output_adapter<uint8_t> o);
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_msgpack(basic_json<> const& j);
Declared in <nlohmann/json.hpp>
static
void
to_msgpack(
basic_json<> const& j,
detail::output_adapter<char> o);
Declared in <nlohmann/json.hpp>
static
void
to_msgpack(
basic_json<> const& j,
detail::output_adapter<uint8_t> o);
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_ubjson(
basic_json<> const& j,
bool const use_size = false,
bool const use_type = false);
Declared in <nlohmann/json.hpp>
static
void
to_ubjson(
basic_json<> const& j,
detail::output_adapter<char> o,
bool const use_size = false,
bool const use_type = false);
Declared in <nlohmann/json.hpp>
static
void
to_ubjson(
basic_json<> const& j,
detail::output_adapter<uint8_t> o,
bool const use_size = false,
bool const use_type = false);
a class to store JSON values
Declared in <nlohmann/json.hpp>
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>
a class to store JSON values
@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
| Name | Description |
|---|---|
nlohmann::detail::json_base_class<CustomBaseClass> |
| Name | Description |
|---|---|
allocator_type | the allocator type |
array_t | a type for an array |
binary_t | a type for a packed binary type |
bjdata_version_t | how to encode BJData |
boolean_t | a type for a boolean |
cbor_tag_handler_t | how to treat CBOR tags |
const_iterator | a const iterator for a basic_json container |
const_pointer | the type of an element const pointer |
const_reference | the type of an element const reference |
const_reverse_iterator | a const reverse iterator for a basic_json container |
default_object_comparator_t | |
difference_type | a type to represent differences between iterators |
error_handler_t | how to treat decoding errors |
exception | Classes to implement user-defined exceptions. @{ |
initializer_list_t | helper type for initializer lists of basic_json values |
input_format_t | |
invalid_iterator | |
iterator | an iterator for a basic_json container |
json_pointer | JSON Pointer, see nlohmann::json_pointer |
json_sax_t | SAX interface type, see nlohmann::json_sax |
json_serializer | |
number_float_t | a type for a number (floating-point) |
number_integer_t | a type for a number (integer) |
number_unsigned_t | a type for a number (unsigned) |
object_comparator_t | object key comparator type |
object_t | a type for an object |
other_error | |
out_of_range | |
parse_error | |
parse_event_t | parser event types |
parser_callback_t | per-element parser callback type |
pointer | the type of an element pointer |
reference | the type of an element reference |
reverse_iterator | a reverse iterator for a basic_json container |
size_type | a type to represent container sizes |
string_t | a type for a string |
type_error | |
value_t | |
value_type | the type of elements in a basic_json container |
| Name | Description |
|---|---|
basic_json [constructor] | copy constructor |
basic_json [constructor] | move constructor |
basic_json [constructor] | create a null object |
basic_json [constructor] | create an empty value with a given type |
basic_json [constructor] | create a JSON value from an existing one |
basic_json [constructor] | //////////////////////////////////// |
basic_json [constructor] | create a JSON value from compatible types |
basic_json [constructor] | construct an array with count copies of given value |
basic_json [constructor] | construct a JSON container given an iterator range |
basic_json [constructor] | create a container (array or object) from an initializer list |
~basic_json [destructor] | destructor |
operator= | copy assignment |
at | access specified array element with bounds checking |
at | access specified array element with bounds checking |
at | access specified element via JSON Pointer |
at | access specified element via JSON Pointer |
at | access specified object element with bounds checking |
at | access specified object element with bounds checking |
at | |
at | |
at | access specified object element with bounds checking |
at | access specified object element with bounds checking |
back | access the last element |
back | access the last element |
begin | returns an iterator to the first element |
begin | returns an iterator to the first element |
cbegin | returns a const iterator to the first element |
cend | returns an iterator to one past the last element |
clear | clears the contents |
contains | check the existence of an element in a JSON object given a JSON pointer |
contains | check the existence of an element in a JSON object |
contains | |
contains | check the existence of an element in a JSON object |
count | returns the number of occurrences of a key in a JSON object |
count | returns the number of occurrences of a key in a JSON object |
crbegin | returns a const reverse iterator to the last element |
crend | returns a const reverse iterator to one before the first |
dump | serialization |
emplace | add an object to an object if key does not exist |
emplace_back | add an object to an array |
empty | checks whether the container is empty. |
end | returns an iterator to one past the last element |
end | returns an iterator to one past the last element |
erase | remove element from a JSON array given an index |
erase | remove element from a JSON object given a key |
erase | remove element given an iterator |
erase | remove element from a JSON object given a key |
erase | remove elements given an iterator range |
find | find an element in a JSON object |
find | find an element in a JSON object |
find | find an element in a JSON object |
find | find an element in a JSON object |
flatten | return flattened JSON value |
front | access the first element |
front | access the first element |
get | get a pointer value (explicit) |
get | get a (pointer) value (explicit) |
get_binary | get a binary value |
get_binary | get a binary value |
get_ptr | get a pointer value (implicit) |
get_ptr | get a pointer value (implicit) |
get_ref | get a reference value (implicit) |
get_ref | get a reference value (implicit) |
get_to | get a value (explicit) |
get_to | |
get_to | |
insert | inserts range of elements into object |
insert | inserts elements from initializer list into array |
insert | inserts element into array |
insert | inserts element into array |
insert | inserts range of elements into array |
insert | inserts copies of element into array |
insert_iterator | Helper for insertion of an iterator |
is_array | return whether value is an array |
is_binary | return whether value is a binary array |
is_boolean | return whether value is a boolean |
is_discarded | return whether value is discarded |
is_null | return whether value is null |
is_number | return whether value is a number |
is_number_float | return whether value is a floating-point number |
is_number_integer | return whether value is an integer number |
is_number_unsigned | return whether value is an unsigned integer number |
is_object | return whether value is an object |
is_primitive | return whether type is primitive |
is_string | return whether value is a string |
is_structured | return whether type is structured |
items | helper to access iterator member functions in range-based for |
items | helper to access iterator member functions in range-based for |
max_size | returns the maximum possible number of elements |
merge_patch | applies a JSON Merge Patch |
operator+= | add an object to an object |
operator+= | add an object to an array |
operator+= | add an object to an object |
operator+= | add an object to an array |
operator[] | access specified object element |
operator[] | access specified array element |
operator[] | access specified array element |
operator[] | access specified element via JSON Pointer |
operator[] | access specified element via JSON Pointer |
operator[] | access specified object element |
operator[] | Subscript operator |
operator[] | Subscript operator |
operator[] | access specified object element |
operator[] | access specified object element |
operator[] | Subscript operator |
operator[] | Subscript operator |
patch | applies a JSON patch to a copy of the current object |
patch_inplace | applies a JSON patch in-place without copying the object |
push_back | add an object to an object |
push_back | add an object to an array |
push_back | add an object to an object |
push_back | add an object to an array |
rbegin | returns an iterator to the reverse-beginning |
rbegin | returns an iterator to the reverse-beginning |
rend | returns an iterator to the reverse-end |
rend | returns an iterator to the reverse-end |
size | returns the number of elements |
swap | exchanges the values |
swap | exchanges the values |
swap | exchanges the values |
swap | exchanges the values |
swap | exchanges the values |
swap | exchanges the values |
type | return the type of the JSON value (explicit) |
type_name | return the type as string |
unflatten | unflatten a previously flattened JSON value |
update | updates a JSON object from another object, overwriting existing keys |
update | updates a JSON object from another object, overwriting existing keys |
value | access specified object element via JSON Pointer with default value |
value | access specified object element with default value |
value | access specified object element via JSON Pointer with default value |
value | access specified object element with default value |
value | |
value | access specified object element with default value |
value | |
value | access specified object element via JSON Pointer with default value |
operator ValueType | get a value (implicit) |
operator value_t | return the type of the JSON value (implicit) |
operator== | comparison: equal |
operator== | comparison: equal |
operator!= | comparison: not equal |
operator<=> | comparison: 3-way |
operator<=> | comparison: 3-way |
| Name | Description |
|---|---|
accept | |
accept | check if the input is valid JSON |
accept | check if the input is valid JSON |
array | explicitly create an array from an initializer list |
binary | explicitly create a binary array (without subtype) |
binary | explicitly create a binary array |
binary | explicitly create a binary array (with subtype) |
binary | explicitly create a binary array (with subtype) |
diff | creates a diff as a JSON patch |
from_bjdata | create a JSON value from an input in BJData format |
from_bjdata | create a JSON value from an input in BJData format |
from_bson | |
from_bson | create a JSON value from an input in BSON format |
from_bson | create a JSON value from an input in BSON format |
from_bson | |
from_cbor | |
from_cbor | create a JSON value from an input in CBOR format |
from_cbor | create a JSON value from an input in CBOR format |
from_cbor | |
from_msgpack | |
from_msgpack | create a JSON value from an input in MessagePack format |
from_msgpack | create a JSON value from an input in MessagePack format |
from_msgpack | |
from_ubjson | |
from_ubjson | create a JSON value from an input in UBJSON format |
from_ubjson | create a JSON value from an input in UBJSON format |
from_ubjson | |
get_allocator | returns the allocator associated with the container |
iterator_wrapper | wrapper to access iterator member functions in range-based for |
iterator_wrapper | wrapper to access iterator member functions in range-based for |
meta | returns version information on the library |
object | explicitly create an object from an initializer list |
parse | |
parse | deserialize from a compatible input |
parse | deserialize from a pair of character iterators |
sax_parse | generate SAX events |
sax_parse | generate SAX events |
sax_parse | generate SAX events |
to_bjdata | create a BJData serialization of a given JSON value |
to_bjdata | create a BJData serialization of a given JSON value |
to_bjdata | create a BJData serialization of a given JSON value |
to_bson | create a BSON serialization of a given JSON value |
to_bson | create a BSON serialization of a given JSON value |
to_bson | create a BSON serialization of a given JSON value |
to_cbor | create a CBOR serialization of a given JSON value |
to_cbor | create a CBOR serialization of a given JSON value |
to_cbor | create a CBOR serialization of a given JSON value |
to_msgpack | create a MessagePack serialization of a given JSON value |
to_msgpack | create a MessagePack serialization of a given JSON value |
to_msgpack | create a MessagePack serialization of a given JSON value |
to_ubjson | create a UBJSON serialization of a given JSON value |
to_ubjson | create a UBJSON serialization of a given JSON value |
to_ubjson | create a UBJSON serialization of a given JSON value |
| Name | Description |
|---|---|
nlohmann::operator>> | deserialize from stream |
nlohmann::operator<< | deserialize from stream |
nlohmann::operator>> | serialize to stream |
nlohmann::operator<< | serialize to stream |
nlohmann::swap | exchanges the values |
nlohmann::detail::exception | general exception of the basic_json class |
nlohmann::detail::serializer | |
nlohmann::json_pointer |
| Name | Description |
|---|---|
operator<< | deserialize from stream |
operator>> | serialize to stream |
to_string | user-defined to_string function for JSON values |
the allocator type
Declared in <nlohmann/json.hpp>
using allocator_type = AllocatorType<basic_json>;
a type for an array
Declared in <nlohmann/json.hpp>
using array_t = ArrayType<basic_json, AllocatorType<basic_json>>;
a type for a packed binary type
Declared in <nlohmann/json.hpp>
using binary_t = nlohmann::byte_container_with_subtype<BinaryType>;
how to encode BJData
Declared in <nlohmann/json.hpp>
using bjdata_version_t = detail::bjdata_version_t;
a type for a boolean
Declared in <nlohmann/json.hpp>
using boolean_t = BooleanType;
how to treat CBOR tags
Declared in <nlohmann/json.hpp>
using cbor_tag_handler_t = detail::cbor_tag_handler_t;
a const iterator for a basic_json container
the type of an element const pointer
Declared in <nlohmann/json.hpp>
using const_pointer = std::allocator_traits<allocator_type>::const_pointer;
the type of an element const reference
a const reverse iterator for a basic_json container
Declared in <nlohmann/json.hpp>
using const_reverse_iterator = json_reverse_iterator<basic_json::const_iterator>;
Declared in <nlohmann/json.hpp>
using default_object_comparator_t = std::less<>;
a type to represent differences between iterators
Declared in <nlohmann/json.hpp>
using difference_type = std::ptrdiff_t;
how to treat decoding errors
Declared in <nlohmann/json.hpp>
using error_handler_t = detail::error_handler_t;
Classes to implement user-defined exceptions. @{
Declared in <nlohmann/json.hpp>
using exception = detail::exception;
helper type for initializer lists of basic_json values
Declared in <nlohmann/json.hpp>
using initializer_list_t = std::initializer_list<detail::json_ref<basic_json>>;
Declared in <nlohmann/json.hpp>
using input_format_t = detail::input_format_t;
Declared in <nlohmann/json.hpp>
using invalid_iterator = detail::invalid_iterator;
an iterator for a basic_json container
JSON Pointer, see nlohmann::json_pointer
SAX interface type, see nlohmann::json_sax
Declared in <nlohmann/json.hpp>
using json_sax_t = json_sax<basic_json>;
Declared in <nlohmann/json.hpp>
template<
typename T,
typename SFINAE>
using json_serializer = JSONSerializer<T, SFINAE>;
a type for a number (floating-point)
Declared in <nlohmann/json.hpp>
using number_float_t = NumberFloatType;
a type for a number (integer)
Declared in <nlohmann/json.hpp>
using number_integer_t = NumberIntegerType;
a type for a number (unsigned)
Declared in <nlohmann/json.hpp>
using number_unsigned_t = NumberUnsignedType;
object key comparator type
Declared in <nlohmann/json.hpp>
using object_comparator_t = detail::actual_object_comparator_t<basic_json>;
a type for an object
Declared in <nlohmann/json.hpp>
using object_t = ObjectType<StringType, basic_json, default_object_comparator_t, AllocatorType<std::pair<StringType const, basic_json>>>;
Declared in <nlohmann/json.hpp>
using other_error = detail::other_error;
Declared in <nlohmann/json.hpp>
using out_of_range = detail::out_of_range;
Declared in <nlohmann/json.hpp>
using parse_error = detail::parse_error;
parser event types
Declared in <nlohmann/json.hpp>
using parse_event_t = detail::parse_event_t;
per-element parser callback type
Declared in <nlohmann/json.hpp>
using parser_callback_t = detail::parser_callback_t<basic_json>;
the type of an element pointer
Declared in <nlohmann/json.hpp>
using pointer = std::allocator_traits<allocator_type>::pointer;
the type of an element reference
a reverse iterator for a basic_json container
Declared in <nlohmann/json.hpp>
using reverse_iterator = json_reverse_iterator<basic_json::iterator>;
a type to represent container sizes
Declared in <nlohmann/json.hpp>
using size_type = std::size_t;
a type for a string
Declared in <nlohmann/json.hpp>
using string_t = StringType;
Declared in <nlohmann/json.hpp>
using type_error = detail::type_error;
Declared in <nlohmann/json.hpp>
using value_t = detail::value_t;
the type of elements in a basic_json container
copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
move constructor
| Name | Description |
|---|---|
| other | The object to move construct from |
create a null object
Declared in <nlohmann/json.hpp>
basic_json(std::nullptr_t value = nullptr) noexcept;
| Name | Description |
|---|---|
| value | The object to construct from |
create an empty value with a given type
| Name | Description |
|---|---|
| v | The object to construct from |
create a JSON value from an existing one
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value&& !std::is_same<basic_json, BasicJsonType>::value
basic_json(BasicJsonType const& val);
| Name | Description |
|---|---|
| val | The object to copy construct from |
////////////////////////////////////
Declared in <nlohmann/json.hpp>
template<typename JsonRef>
requires detail::conjunction<detail::is_json_ref<JsonRef>,
std::is_same<typename JsonRef::value_type, basic_json>>::value
basic_json(JsonRef const& ref);
| Name | Description |
|---|---|
| ref | The object to copy construct from |
create a JSON value from compatible types
Declared in <nlohmann/json.hpp>
template<
typename CompatibleType,
typename U = detail::uncvref_t<CompatibleType>>
requires !detail::is_basic_json<U>::value && detail::is_compatible_type<basic_json_t, U>::value
basic_json(CompatibleType&& val) noexcept(noexcept(JSONSerializer<U, void>::to_json(std::declval<basic_json_t &>(), std::forward<CompatibleType>(val))));
| Name | Description |
|---|---|
| val | The object to move construct from |
construct an array with count copies of given value
| Name | Description |
|---|---|
| cnt | The object to construct from |
| val | a class to store JSON values |
construct a JSON container given an iterator range
Declared in <nlohmann/json.hpp>
template<class InputIT>
requires std::is_same<InputIT, typename basic_json_t::iterator>::value ||
std::is_same<InputIT, typename basic_json_t::const_iterator>::value
basic_json(
InputIT first,
InputIT last);
| Name | Description |
|---|---|
| first | The object to construct from |
create a container (array or object) from an initializer list
Declared in <nlohmann/json.hpp>
basic_json(
initializer_list_t init,
bool type_deduction = true,
value_t manual_type = value_t::array);
| Name | Description |
|---|---|
| init | The object to construct from |
destructor
Declared in <nlohmann/json.hpp>
~basic_json() noexcept;
copy assignment
Declared in <nlohmann/json.hpp>
basic_json&
operator=(basic_json other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value && std::is_nothrow_move_assignable<json_base_class_t>::value);
Reference to the current object
| Name | Description |
|---|---|
| other | The object to assign from |
access specified array element with bounds checking
the type of an element reference
| Name | Description |
|---|---|
| idx | a type to represent container sizes |
access specified array element with bounds checking
the type of an element const reference
| Name | Description |
|---|---|
| idx | a type to represent container sizes |
access specified element via JSON Pointer
the type of an element reference
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified element via JSON Pointer
the type of an element const reference
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified object element with bounds checking
the type of an element reference
access specified object element with bounds checking
the type of an element const reference
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
reference
at(nlohmann::json_pointer<BasicJsonType> const& ptr);
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
const_reference
at(nlohmann::json_pointer<BasicJsonType> const& ptr) const;
access specified object element with bounds checking
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
reference
at(KeyType&& key);
the type of an element reference
access specified object element with bounds checking
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_reference
at(KeyType&& key) const;
the type of an element const reference
access the last element
the type of an element reference
access the last element
the type of an element const reference
returns an iterator to the first element
an iterator for a basic_json container
returns an iterator to the first element
a const iterator for a basic_json container
returns a const iterator to the first element
a const iterator for a basic_json container
returns an iterator to one past the last element
a const iterator for a basic_json container
clears the contents
Declared in <nlohmann/json.hpp>
void
clear() noexcept;
check the existence of an element in a JSON object given a JSON pointer
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
check the existence of an element in a JSON object
Declared in <nlohmann/json.hpp>
bool
contains(object_t::key_type const& key) const;
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
bool
contains(nlohmann::json_pointer<BasicJsonType> const& ptr) const;
check the existence of an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
bool
contains(KeyType&& key) const;
returns the number of occurrences of a key in a JSON object
a type to represent container sizes
returns the number of occurrences of a key in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
size_type
count(KeyType&& key) const;
a type to represent container sizes
returns a const reverse iterator to the last element
a const reverse iterator for a basic_json container
returns a const reverse iterator to one before the first
a const reverse iterator for a basic_json container
serialization
Declared in <nlohmann/json.hpp>
string_t
dump(
int const indent = -1,
char const indent_char = ' ',
bool const ensure_ascii = false,
error_handler_t const error_handler = error_handler_t::strict) const;
a type for a string
| Name | Description |
|---|---|
| error_handler | how to treat decoding errors |
add an object to an object if key does not exist
Declared in <nlohmann/json.hpp>
template<class... Args>
std::pair<iterator, bool>
emplace(Args&&... args);
add an object to an array
Declared in <nlohmann/json.hpp>
template<class... Args>
reference
emplace_back(Args&&... args);
the type of an element reference
checks whether the container is empty.
Declared in <nlohmann/json.hpp>
bool
empty() const noexcept;
returns an iterator to one past the last element
an iterator for a basic_json container
returns an iterator to one past the last element
a const iterator for a basic_json container
remove element from a JSON array given an index
| Name | Description |
|---|---|
| idx | a type to represent container sizes |
remove element from a JSON object given a key
a type to represent container sizes
remove element given an iterator
Declared in <nlohmann/json.hpp>
template<class IteratorType>
requires std::is_same<IteratorType, typename basic_json_t::iterator>::value ||
std::is_same<IteratorType, typename basic_json_t::const_iterator>::value
IteratorType
erase(IteratorType pos);
remove element from a JSON object given a key
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
size_type
erase(KeyType&& key);
a type to represent container sizes
remove elements given an iterator range
Declared in <nlohmann/json.hpp>
template<class IteratorType>
requires std::is_same<IteratorType, typename basic_json_t::iterator>::value ||
std::is_same<IteratorType, typename basic_json_t::const_iterator>::value
IteratorType
erase(
IteratorType first,
IteratorType last);
find an element in a JSON object
an iterator for a basic_json container
find an element in a JSON object
a const iterator for a basic_json container
find an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
iterator
find(KeyType&& key);
an iterator for a basic_json container
find an element in a JSON object
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_iterator
find(KeyType&& key) const;
a const iterator for a basic_json container
return flattened JSON value
a class to store JSON values
access the first element
the type of an element reference
access the first element
the type of an element const reference
get a pointer value (explicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value
decltype(std::declval<basic_json_t&>().template get_ptr<PointerType>())
get() noexcept;
Explicit pointer access to the internally stored JSON value. No copies are made.
The pointer becomes invalid if the underlying JSON object changes.
Constant.
{The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a nullptr is returned if the value and the requested pointer type does not match.,get__PointerType}
pointer to the internally stored JSON value if the requested pointer type PointerType fits to the JSON value; nullptr otherwise
| Name | Description |
|---|---|
| PointerType | pointer type; must be a pointer to array_t, object_t, string_t, boolean_t, number_integer_t, number_unsigned_t, or number_float_t. |
get a (pointer) value (explicit)
Declared in <nlohmann/json.hpp>
template<
typename ValueTypeCV,
typename ValueType = detail::uncvref_t<ValueTypeCV>>
constexpr
decltype(std::declval<const basic_json_t&>().template get_impl<ValueType>(detail::priority_tag<4> {}))
get() const noexcept(noexcept(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4>{})));
Performs explicit type conversion between the JSON value and a compatible value if required.
If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made.
If the requested type is the current basic_json, or a different basic_json convertible from the current basic_json.
Otherwise the value is converted by calling the json_serializer<ValueType> from_json() method.
| Name | Thrown on |
|---|---|
what | json_serializer<ValueType> from_json() method throws if conversion is required |
copy of the JSON value, converted to
| Name | Description |
|---|---|
| ValueTypeCV | the provided value type |
| ValueType | the returned value type |
| ValueType | if necessary |
get a binary value
a type for a packed binary type
get a binary value
a type for a packed binary type
get a pointer value (implicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value
decltype(std::declval<basic_json_t&>().get_impl_ptr(std::declval<PointerType>()))
get_ptr() noexcept;
get a pointer value (implicit)
Declared in <nlohmann/json.hpp>
template<typename PointerType>
requires std::is_pointer<PointerType>::value&&
std::is_const<typename std::remove_pointer<PointerType>::type>::value
constexpr
decltype(std::declval<const basic_json_t&>().get_impl_ptr(std::declval<PointerType>()))
get_ptr() const noexcept;
get a reference value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ReferenceType>
requires std::is_reference<ReferenceType>::value
ReferenceType
get_ref();
get a reference value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ReferenceType>
requires std::is_reference<ReferenceType>::value&&
std::is_const<typename std::remove_reference<ReferenceType>::type>::value
ReferenceType
get_ref() const;
get a value (explicit)
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires !detail::is_basic_json<ValueType>::value&&
detail::has_from_json<basic_json_t, ValueType>::value
ValueType&
get_to(ValueType& v) const noexcept(noexcept(JSONSerializer<ValueType, void>::from_json(std::declval<const basic_json_t &>(), v)));
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires detail::is_basic_json<ValueType>::value
ValueType&
get_to(ValueType& v) const;
Declared in <nlohmann/json.hpp>
template<
typename T,
std::size_t N,
typename Array = T(&)[N]>
requires detail::has_from_json<basic_json_t, Array>::value
Array
get_to(T(& v)[N]) const noexcept(noexcept(JSONSerializer<Array, void>::from_json(std::declval<const basic_json_t &>(), v)));
inserts range of elements into object
| Name | Description |
|---|---|
| first | a const iterator for a basic_json container |
| last | a const iterator for a basic_json container |
inserts elements from initializer list into array
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
initializer_list_t ilist);
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
| ilist | helper type for initializer lists of basic_json values |
inserts element into array
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
basic_json const& val);
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
| val | a class to store JSON values |
inserts element into array
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
| val | a class to store JSON values |
inserts range of elements into array
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
const_iterator first,
const_iterator last);
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
| first | a const iterator for a basic_json container |
| last | a const iterator for a basic_json container |
inserts copies of element into array
Declared in <nlohmann/json.hpp>
iterator
insert(
const_iterator pos,
size_type cnt,
basic_json const& val);
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
| cnt | a type to represent container sizes |
| val | a class to store JSON values |
Helper for insertion of an iterator
Declared in <nlohmann/json.hpp>
template<typename... Args>
iterator
insert_iterator(
const_iterator pos,
Args&&... args);
: This uses std::distance to support GCC 4.8, see https://github.com/nlohmann/json/pull/1257
an iterator for a basic_json container
| Name | Description |
|---|---|
| pos | a const iterator for a basic_json container |
return whether value is an array
Declared in <nlohmann/json.hpp>
constexpr
bool
is_array() const noexcept;
return whether value is a binary array
Declared in <nlohmann/json.hpp>
constexpr
bool
is_binary() const noexcept;
return whether value is a boolean
Declared in <nlohmann/json.hpp>
constexpr
bool
is_boolean() const noexcept;
return whether value is discarded
Declared in <nlohmann/json.hpp>
constexpr
bool
is_discarded() const noexcept;
return whether value is null
Declared in <nlohmann/json.hpp>
constexpr
bool
is_null() const noexcept;
return whether value is a number
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number() const noexcept;
return whether value is a floating-point number
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_float() const noexcept;
return whether value is an integer number
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_integer() const noexcept;
return whether value is an unsigned integer number
Declared in <nlohmann/json.hpp>
constexpr
bool
is_number_unsigned() const noexcept;
return whether value is an object
Declared in <nlohmann/json.hpp>
constexpr
bool
is_object() const noexcept;
return whether type is primitive
Declared in <nlohmann/json.hpp>
constexpr
bool
is_primitive() const noexcept;
return whether value is a string
Declared in <nlohmann/json.hpp>
constexpr
bool
is_string() const noexcept;
return whether type is structured
Declared in <nlohmann/json.hpp>
constexpr
bool
is_structured() const noexcept;
helper to access iterator member functions in range-based for
helper to access iterator member functions in range-based for
returns the maximum possible number of elements
a type to represent container sizes
applies a JSON Merge Patch
| Name | Description |
|---|---|
| apply_patch | a class to store JSON values |
add an object to an object
the type of an element reference
| Name | Description |
|---|---|
| init | The right operand |
add an object to an array
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
add an object to an object
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
add an object to an array
the type of an element reference
| Name | Description |
|---|---|
| val | The right operand |
access specified object element
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
access specified array element
the type of an element reference
| Name | Description |
|---|---|
| idx | The right operand |
access specified array element
the type of an element const reference
| Name | Description |
|---|---|
| idx | The right operand |
access specified element via JSON Pointer
the type of an element reference
| Name | Description |
|---|---|
| ptr | The right operand |
access specified element via JSON Pointer
the type of an element const reference
| Name | Description |
|---|---|
| ptr | The right operand |
access specified object element
Declared in <nlohmann/json.hpp>
const_reference
operator[](object_t::key_type const& key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
reference
operator[](nlohmann::json_pointer<BasicJsonType> const& ptr);
the type of an element reference
| Name | Description |
|---|---|
| ptr | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
[[__deprecated__]]
const_reference
operator[](nlohmann::json_pointer<BasicJsonType> const& ptr) const;
the type of an element const reference
| Name | Description |
|---|---|
| ptr | The right operand |
access specified object element
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
reference
operator[](KeyType&& key);
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
access specified object element
Declared in <nlohmann/json.hpp>
template<class KeyType>
requires detail::is_usable_as_basic_json_key_type<basic_json_t, KeyType>::value
const_reference
operator[](KeyType&& key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
the type of an element reference
| Name | Description |
|---|---|
| key | The right operand |
Subscript operator
Declared in <nlohmann/json.hpp>
template<typename T>
const_reference
operator[](T* key) const;
the type of an element const reference
| Name | Description |
|---|---|
| key | The right operand |
applies a JSON patch to a copy of the current object
a class to store JSON values
| Name | Description |
|---|---|
| json_patch | a class to store JSON values |
applies a JSON patch in-place without copying the object
| Name | Description |
|---|---|
| json_patch | a class to store JSON values |
add an object to an object
| Name | Description |
|---|---|
| init | helper type for initializer lists of basic_json values |
add an object to an array
| Name | Description |
|---|---|
| val | a class to store JSON values |
add an object to an object
Declared in <nlohmann/json.hpp>
void
push_back(object_t::value_type const& val);
add an object to an array
| Name | Description |
|---|---|
| val | a class to store JSON values |
returns an iterator to the reverse-beginning
a reverse iterator for a basic_json container
returns an iterator to the reverse-beginning
a const reverse iterator for a basic_json container
returns an iterator to the reverse-end
a reverse iterator for a basic_json container
returns an iterator to the reverse-end
a const reverse iterator for a basic_json container
returns the number of elements
a type to represent container sizes
exchanges the values
Declared in <nlohmann/json.hpp>
void
swap(reference other) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
| Name | Description |
|---|---|
| other | the type of an element reference |
exchanges the values
| Name | Description |
|---|---|
| other | a type for an array |
exchanges the values
| Name | Description |
|---|---|
| other | a type for a packed binary type |
exchanges the values
Declared in <nlohmann/json.hpp>
void
swap(binary_t::container_type& other);
exchanges the values
| Name | Description |
|---|---|
| other | a type for an object |
exchanges the values
| Name | Description |
|---|---|
| other | a type for a string |
return the type of the JSON value (explicit)
return the type as string
Declared in <nlohmann/json.hpp>
[[__returns_nonnull__]]
char const*
type_name() const noexcept;
unflatten a previously flattened JSON value
a class to store JSON values
updates a JSON object from another object, overwriting existing keys
Declared in <nlohmann/json.hpp>
void
update(
const_reference j,
bool merge_objects = false);
| Name | Description |
|---|---|
| j | the type of an element const reference |
updates a JSON object from another object, overwriting existing keys
Declared in <nlohmann/json.hpp>
void
update(
const_iterator first,
const_iterator last,
bool merge_objects = false);
| Name | Description |
|---|---|
| first | a const iterator for a basic_json container |
| last | a const iterator for a basic_json container |
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<class ValueType>
requires detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
json_pointer const& ptr,
ValueType const& default_value) const;
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<class ValueType>
requires !detail::is_transparent<object_comparator_t>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
object_t::key_type const& key,
ValueType const& default_value) const;
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
json_pointer const& ptr,
ValueType&& default_value) const;
| Name | Description |
|---|---|
| ptr | JSON Pointer, see nlohmann::json_pointer |
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class ReturnType = value_return_type<ValueType>::type>
requires !detail::is_transparent<object_comparator_t>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
object_t::key_type const& key,
ValueType&& default_value) const;
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class BasicJsonType>
requires detail::is_basic_json<BasicJsonType>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
[[__deprecated__]]
ValueType
value(
nlohmann::json_pointer<BasicJsonType> const& ptr,
ValueType const& default_value) const;
access specified object element with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class KeyType>
requires detail::is_transparent<object_comparator_t>::value
&& !detail::is_json_pointer<KeyType>::value
&& is_comparable_with_object_key<KeyType>::value
&& detail::is_getable<basic_json_t, ValueType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ValueType
value(
KeyType&& key,
ValueType const& default_value) const;
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class BasicJsonType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_basic_json<BasicJsonType>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
[[__deprecated__]]
ReturnType
value(
nlohmann::json_pointer<BasicJsonType> const& ptr,
ValueType&& default_value) const;
access specified object element via JSON Pointer with default value
Declared in <nlohmann/json.hpp>
template<
class ValueType,
class KeyType,
class ReturnType = value_return_type<ValueType>::type>
requires detail::is_transparent<object_comparator_t>::value
&& !detail::is_json_pointer<KeyType>::value
&& is_comparable_with_object_key<KeyType>::value
&& detail::is_getable<basic_json_t, ReturnType>::value
&& !std::is_same<value_t, detail::uncvref_t<ValueType>>::value
ReturnType
value(
KeyType&& key,
ValueType&& default_value) const;
get a value (implicit)
Declared in <nlohmann/json.hpp>
template<typename ValueType>
requires detail::conjunction <
detail::negation<std::is_pointer<ValueType>>,
detail::negation<std::is_same<ValueType, std::nullptr_t>>,
detail::negation<std::is_same<ValueType, detail::json_ref<basic_json>>>,
detail::negation<std::is_same<ValueType, typename string_t::value_type>>,
detail::negation<detail::is_basic_json<ValueType>>,
detail::negation<std::is_same<ValueType, std::initializer_list<typename string_t::value_type>>>,
#if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914))
detail::negation<std::is_same<ValueType, std::string_view>>,
#endif
#if defined(JSON_HAS_CPP_17) && JSON_HAS_STATIC_RTTI
detail::negation<std::is_same<ValueType, std::any>>,
#endif
detail::is_detected_lazy<detail::get_template_function, const basic_json_t&, ValueType>
>::value
operator ValueType() const;
Implicit type conversion between the JSON value and a compatible value. The call is realized by calling get() const.
Linear in the size of the JSON value.
{The example below shows several conversions from JSON values to other types. There a few things to note: (1) Floating-point numbers can be converted to integers, (2) A JSON array can be converted to a standard std::vector<short>, (3) A JSON object can be converted to C++ associative containers such as `std::unordered_map<std::string\, json>`.,operator__ValueType}
| Name | Thrown on |
|---|---|
type_error.302 | in case passed type ValueType is incompatible to the JSON value type (e.g., the JSON value is of type boolean, but a string is requested); see example below |
copy of the JSON value, converted to type ValueType
| Name | Description |
|---|---|
| ValueType | non-pointer type compatible to the JSON value, for instance int for JSON integer numbers, bool for JSON booleans, or std::vector types for JSON arrays. The character type of string_t as well as an initializer list of this type is excluded to avoid ambiguities as these types implicitly convert to std::string. |
return the type of the JSON value (implicit)
The object converted to value_t
comparison: equal
Declared in <nlohmann/json.hpp>
template<typename ScalarType>
requires std::is_scalar_v<ScalarType>
bool
operator==(ScalarType rhs) const noexcept;
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
comparison: equal
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
comparison: not equal
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
comparison: 3-way
Declared in <nlohmann/json.hpp>
template<typename ScalarType>
requires std::is_scalar_v<ScalarType>
std::partial_ordering
operator<=>(ScalarType rhs) const noexcept;
The relative order of the objects
| Name | Description |
|---|---|
| rhs | The right operand |
comparison: 3-way
Declared in <nlohmann/json.hpp>
std::partial_ordering
operator<=>(const_reference rhs) const noexcept;
The relative order of the objects
| Name | Description |
|---|---|
| rhs | The right operand |
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
bool
accept(
detail::span_input_adapter&& i,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
check if the input is valid JSON
Declared in <nlohmann/json.hpp>
template<typename InputType>
static
bool
accept(
InputType&& i,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
check if the input is valid JSON
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
static
bool
accept(
IteratorType first,
IteratorType last,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
explicitly create an array from an initializer list
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
array(initializer_list_t init = {});
a class to store JSON values
| Name | Description |
|---|---|
| init | helper type for initializer lists of basic_json values |
explicitly create a binary array (without subtype)
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
binary(binary_t::container_type const& init);
a class to store JSON values
explicitly create a binary array
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
binary(binary_t::container_type&& init);
a class to store JSON values
explicitly create a binary array (with subtype)
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
binary(
binary_t::container_type const& init,
binary_t::subtype_type subtype);
a class to store JSON values
explicitly create a binary array (with subtype)
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
binary(
binary_t::container_type&& init,
binary_t::subtype_type subtype);
a class to store JSON values
creates a diff as a JSON patch
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
diff(
basic_json const& source,
basic_json const& target,
string_t const& path = "");
a class to store JSON values
| Name | Description |
|---|---|
| source | a class to store JSON values |
| target | a class to store JSON values |
| path | a type for a string |
create a JSON value from an input in BJData format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
from_bjdata(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in BJData format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
from_bjdata(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_bson(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in BSON format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
from_bson(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in BSON format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
from_bson(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_bson(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_cbor(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
create a JSON value from an input in CBOR format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
from_cbor(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
a class to store JSON values
| Name | Description |
|---|---|
| tag_handler | how to treat CBOR tags |
create a JSON value from an input in CBOR format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
from_cbor(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
a class to store JSON values
| Name | Description |
|---|---|
| tag_handler | how to treat CBOR tags |
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_cbor(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true,
cbor_tag_handler_t const tag_handler = cbor_tag_handler_t::error);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_msgpack(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in MessagePack format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
from_msgpack(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in MessagePack format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
from_msgpack(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_msgpack(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_ubjson(
detail::span_input_adapter&& i,
bool const strict = true,
bool const allow_exceptions = true);
create a JSON value from an input in UBJSON format
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
from_ubjson(
InputType&& i,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
create a JSON value from an input in UBJSON format
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
from_ubjson(
IteratorType first,
IteratorType last,
bool const strict = true,
bool const allow_exceptions = true);
a class to store JSON values
Declared in <nlohmann/json.hpp>
template<typename T>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
from_ubjson(
T const* ptr,
std::size_t len,
bool const strict = true,
bool const allow_exceptions = true);
returns the allocator associated with the container
the allocator type
wrapper to access iterator member functions in range-based for
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
static
iteration_proxy<const_iterator>
iterator_wrapper(const_reference ref) noexcept;
| Name | Description |
|---|---|
| ref | the type of an element const reference |
wrapper to access iterator member functions in range-based for
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
static
iteration_proxy<iterator>
iterator_wrapper(reference ref) noexcept;
| Name | Description |
|---|---|
| ref | the type of an element reference |
returns version information on the library
a class to store JSON values
explicitly create an object from an initializer list
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__]]
static
basic_json
object(initializer_list_t init = {});
a class to store JSON values
| Name | Description |
|---|---|
| init | helper type for initializer lists of basic_json values |
Declared in <nlohmann/json.hpp>
[[__warn_unused_result__, __deprecated__]]
static
basic_json
parse(
detail::span_input_adapter&& i,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
deserialize from a compatible input
Declared in <nlohmann/json.hpp>
template<typename InputType>
[[__warn_unused_result__]]
static
basic_json
parse(
InputType&& i,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
a class to store JSON values
| Name | Description |
|---|---|
| cb | per-element parser callback type |
deserialize from a pair of character iterators
Declared in <nlohmann/json.hpp>
template<typename IteratorType>
[[__warn_unused_result__]]
static
basic_json
parse(
IteratorType first,
IteratorType last,
parser_callback_t cb = nullptr,
bool const allow_exceptions = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
a class to store JSON values
| Name | Description |
|---|---|
| cb | per-element parser callback type |
generate SAX events
Declared in <nlohmann/json.hpp>
template<typename SAX>
[[__deprecated__, __nonnull__]]
static
bool
sax_parse(
detail::span_input_adapter&& i,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
generate SAX events
Declared in <nlohmann/json.hpp>
template<
typename InputType,
typename SAX>
[[__nonnull__]]
static
bool
sax_parse(
InputType&& i,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
generate SAX events
Declared in <nlohmann/json.hpp>
template<
class IteratorType,
class SAX>
[[__nonnull__]]
static
bool
sax_parse(
IteratorType first,
IteratorType last,
SAX* sax,
input_format_t format = input_format_t::json,
bool const strict = true,
bool const ignore_comments = false,
bool const ignore_trailing_commas = false);
create a BJData serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_bjdata(
basic_json const& j,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
A standard container which offers fixed time access to individual elements in any order.
| Name | Description |
|---|---|
| j | a class to store JSON values |
| version | how to encode BJData |
create a BJData serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_bjdata(
basic_json const& j,
detail::output_adapter<char> o,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
| Name | Description |
|---|---|
| j | a class to store JSON values |
| version | how to encode BJData |
create a BJData serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_bjdata(
basic_json const& j,
detail::output_adapter<uint8_t> o,
bool const use_size = false,
bool const use_type = false,
bjdata_version_t const version = bjdata_version_t::draft2);
| Name | Description |
|---|---|
| j | a class to store JSON values |
| version | how to encode BJData |
create a BSON serialization of a given JSON value
A standard container which offers fixed time access to individual elements in any order.
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a BSON serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_bson(
basic_json const& j,
detail::output_adapter<char> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a BSON serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_bson(
basic_json const& j,
detail::output_adapter<uint8_t> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a CBOR serialization of a given JSON value
A standard container which offers fixed time access to individual elements in any order.
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a CBOR serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_cbor(
basic_json const& j,
detail::output_adapter<char> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a CBOR serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_cbor(
basic_json const& j,
detail::output_adapter<uint8_t> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a MessagePack serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_msgpack(basic_json const& j);
A standard container which offers fixed time access to individual elements in any order.
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a MessagePack serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_msgpack(
basic_json const& j,
detail::output_adapter<char> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a MessagePack serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_msgpack(
basic_json const& j,
detail::output_adapter<uint8_t> o);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a UBJSON serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
std::vector<uint8_t>
to_ubjson(
basic_json const& j,
bool const use_size = false,
bool const use_type = false);
A standard container which offers fixed time access to individual elements in any order.
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a UBJSON serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_ubjson(
basic_json const& j,
detail::output_adapter<char> o,
bool const use_size = false,
bool const use_type = false);
| Name | Description |
|---|---|
| j | a class to store JSON values |
create a UBJSON serialization of a given JSON value
Declared in <nlohmann/json.hpp>
static
void
to_ubjson(
basic_json const& j,
detail::output_adapter<uint8_t> o,
bool const use_size = false,
bool const use_type = false);
| Name | Description |
|---|---|
| j | a class to store JSON values |
an internal type for a backed binary type
Declared in <nlohmann/byte_container_with_subtype.hpp>
template<typename BinaryType>
class byte_container_with_subtype
: public BinaryType
| Name | Description |
|---|---|
BinaryType |
| Name |
|---|
container_type |
subtype_type |
| Name | Description |
|---|---|
byte_container_with_subtype [constructor] | Default constructor |
byte_container_with_subtype [constructor] | Construct from container_type |
byte_container_with_subtype [constructor] | Construct from container_type |
byte_container_with_subtype [constructor] | |
byte_container_with_subtype [constructor] | |
clear_subtype | clears the binary subtype |
has_subtype | return whether the value has a subtype |
set_subtype | sets the binary subtype |
subtype | return the binary subtype |
operator== | Equality operator |
operator!= | Inequality operator |
Declared in <nlohmann/byte_container_with_subtype.hpp>
using container_type = BinaryType;
Declared in <nlohmann/byte_container_with_subtype.hpp>
using subtype_type = uint64_t;
Default constructor
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype() noexcept(noexcept(container_type()));
Construct from container_type
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(container_type const& b) noexcept(noexcept(container_type(b)));
| Name | Description |
|---|---|
| b | The object to copy construct from |
Construct from container_type
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))));
| Name | Description |
|---|---|
| b | The object to move construct from |
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(
container_type const& b,
subtype_type subtype_) noexcept(noexcept(container_type(b)));
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(
container_type&& b,
subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))));
clears the binary subtype
Declared in <nlohmann/byte_container_with_subtype.hpp>
void
clear_subtype() noexcept;
return whether the value has a subtype
Declared in <nlohmann/byte_container_with_subtype.hpp>
constexpr
bool
has_subtype() const noexcept;
sets the binary subtype
Declared in <nlohmann/byte_container_with_subtype.hpp>
void
set_subtype(subtype_type subtype_) noexcept;
return the binary subtype
Declared in <nlohmann/byte_container_with_subtype.hpp>
constexpr
subtype_type
subtype() const noexcept;
Equality operator
Declared in <nlohmann/byte_container_with_subtype.hpp>
bool
operator==(byte_container_with_subtype const& rhs) const;
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Inequality operator
Declared in <nlohmann/byte_container_with_subtype.hpp>
bool
operator!=(byte_container_with_subtype const& rhs) const;
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Declared in <nlohmann/byte_container_with_subtype.hpp>
template<>
class byte_container_with_subtype<vector<unsigned char>>
: public vector<unsigned char>
| Name | Description |
|---|---|
vector<unsigned char> | A standard container which offers fixed time access to individual elements in any order. |
| Name |
|---|
container_type |
size_type |
subtype_type |
| Name | Description |
|---|---|
byte_container_with_subtype [constructor] | Constructors |
clear_subtype | |
has_subtype | |
set_subtype | |
subtype | |
operator== | Equality operator |
operator!= | Inequality operator |
Declared in <nlohmann/byte_container_with_subtype.hpp>
using container_type = vector<unsigned char>;
Declared in <bits/stl_vector.h>
typedef size_t size_type;
Declared in <nlohmann/byte_container_with_subtype.hpp>
using subtype_type = uint64_t;
Constructors
Declared in <nlohmann/byte_container_with_subtype.hpp>
Default constructor
byte_container_with_subtype() noexcept(noexcept(container_type()));
» more...
Construct from container_type
byte_container_with_subtype(container_type const& b) noexcept(noexcept(container_type(b)));
» more...
Construct from container_type
byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))));
» more...
byte_container_with_subtype(
container_type const& b,
subtype_type subtype_) noexcept(noexcept(container_type(b)));
» more...
byte_container_with_subtype(
container_type&& b,
subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))));
» more...
Default constructor
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype() noexcept(noexcept(container_type()));
Construct from container_type
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(container_type const& b) noexcept(noexcept(container_type(b)));
| Name | Description |
|---|---|
| b | The object to copy construct from |
Construct from container_type
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(container_type&& b) noexcept(noexcept(container_type(std::move(b))));
| Name | Description |
|---|---|
| b | The object to move construct from |
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(
container_type const& b,
subtype_type subtype_) noexcept(noexcept(container_type(b)));
Declared in <nlohmann/byte_container_with_subtype.hpp>
byte_container_with_subtype(
container_type&& b,
subtype_type subtype_) noexcept(noexcept(container_type(std::move(b))));
Declared in <nlohmann/byte_container_with_subtype.hpp>
void
clear_subtype() noexcept;
Declared in <nlohmann/byte_container_with_subtype.hpp>
constexpr
bool
has_subtype() const noexcept;
Declared in <nlohmann/byte_container_with_subtype.hpp>
void
set_subtype(subtype_type subtype_) noexcept;
Declared in <nlohmann/byte_container_with_subtype.hpp>
constexpr
subtype_type
subtype() const noexcept;
Equality operator
Declared in <nlohmann/byte_container_with_subtype.hpp>
bool
operator==(byte_container_with_subtype<vector<unsigned char>> const& rhs) const;
true if the objects are equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Inequality operator
Declared in <nlohmann/byte_container_with_subtype.hpp>
bool
operator!=(byte_container_with_subtype<vector<unsigned char>> const& rhs) const;
true if the objects are not equal, false otherwise
| Name | Description |
|---|---|
| rhs | The right operand |
Declared in <nlohmann/json.hpp>
template<typename>
class json_pointer;
JSON Pointer defines a string syntax for identifying a specific value within a JSON document
Declared in <nlohmann/json_fwd.hpp>
template<typename RefStringType>
class json_pointer;
| Name | Description |
|---|---|
nlohmann::operator/ | create a new JSON pointer by appending the array-index-token at the end of the JSON pointer |
nlohmann::operator/ | create a new JSON pointer by appending the unescaped token at the end of the JSON pointer |
nlohmann::operator/ | create a new JSON pointer by appending the right JSON pointer at the end of the left JSON pointer |
nlohmann::operator<< | write string representation of the JSON pointer to stream |
nlohmann::json_pointer | JSON Pointer defines a string syntax for identifying a specific value within a JSON document |
nlohmann::basic_json | a class to store JSON values |
a minimal map-like container that preserves insertion order
Declared in <nlohmann/ordered_map.hpp>
template<
class Key,
class T,
class IgnoredLess = std::less<Key>,
class Allocator = std::allocator<std::pair<Key const, T>>>
struct ordered_map
: std::vector<std::pair<Key const, T>, Allocator>
ordered_map: a minimal map-like container that preserves insertion order for use within nlohmann::basic_json<ordered_map>
| Name | Description |
|---|---|
std::vector<std::pair<Key const, T>, Allocator> | A standard container which offers fixed time access to individual elements in any order. |
| Name |
|---|
Container |
const_iterator |
iterator |
key_compare |
key_type |
mapped_type |
require_input_iter |
size_type |
value_type |
| Name | Description |
|---|---|
ordered_map [constructor] | Constructors |
~ordered_map [destructor] | Destructor |
operator= | Assignment operators |
at | |
count | |
emplace | |
erase | |
find | |
insert | |
operator[] | Subscript operators |
Declared in <nlohmann/ordered_map.hpp>
using Container = std::vector<std::pair<Key const, T>, Allocator>;
Declared in <nlohmann/ordered_map.hpp>
using const_iterator = Container::const_iterator;
Declared in <nlohmann/ordered_map.hpp>
using iterator = Container::iterator;
Declared in <nlohmann/ordered_map.hpp>
using key_compare = std::equal_to<>;
Declared in <nlohmann/ordered_map.hpp>
using key_type = Key;
Declared in <nlohmann/ordered_map.hpp>
using mapped_type = T;
Declared in <nlohmann/ordered_map.hpp>
template<typename InputIt>
using require_input_iter = void;
Declared in <nlohmann/ordered_map.hpp>
using size_type = Container::size_type;
Declared in <nlohmann/ordered_map.hpp>
using value_type = Container::value_type;
Constructors
Declared in <nlohmann/ordered_map.hpp>
Default constructor
ordered_map() noexcept(noexcept(Container()));
» more...
Copy constructor
ordered_map(ordered_map const& other) = default;
» more...
Move constructor
ordered_map(ordered_map&& other) noexcept(std::is_nothrow_move_constructible<Container>::value) = default;
» more...
Construct from Allocator
explicit
ordered_map(Allocator const& alloc) noexcept(noexcept(Container(alloc)));
» more...
ordered_map(
std::initializer_list<value_type> init,
Allocator const& alloc = Allocator());
» more...
template<class It>
ordered_map(
It first,
It last,
Allocator const& alloc = Allocator());
» more...
Default constructor
Declared in <nlohmann/ordered_map.hpp>
ordered_map() noexcept(noexcept(Container()));
Copy constructor
| Name | Description |
|---|---|
| other | The object to copy construct from |
Move constructor
Declared in <nlohmann/ordered_map.hpp>
ordered_map(ordered_map&& other) noexcept(std::is_nothrow_move_constructible<Container>::value) = default;
| Name | Description |
|---|---|
| other | The object to move construct from |
Construct from Allocator
Declared in <nlohmann/ordered_map.hpp>
explicit
ordered_map(Allocator const& alloc) noexcept(noexcept(Container(alloc)));
| Name | Description |
|---|---|
| alloc | The object to copy construct from |
Declared in <nlohmann/ordered_map.hpp>
ordered_map(
std::initializer_list<value_type> init,
Allocator const& alloc = Allocator());
Declared in <nlohmann/ordered_map.hpp>
template<class It>
ordered_map(
It first,
It last,
Allocator const& alloc = Allocator());
Destructor
Declared in <nlohmann/ordered_map.hpp>
~ordered_map() = default;
Assignment operators
Declared in <nlohmann/ordered_map.hpp>
Copy assignment operator
ordered_map&
operator=(ordered_map const& other);
» more...
Move assignment operator
ordered_map&
operator=(ordered_map&& other) noexcept(std::is_nothrow_move_assignable<Container>::value);
» more...
Copy assignment operator
Reference to the current object
| Name | Description |
|---|---|
| other | The object to copy assign from |
Move assignment operator
Declared in <nlohmann/ordered_map.hpp>
ordered_map&
operator=(ordered_map&& other) noexcept(std::is_nothrow_move_assignable<Container>::value);
Reference to the current object
| Name | Description |
|---|---|
| other | The object to move assign from |
Declared in <nlohmann/ordered_map.hpp>
T&
at(key_type const& key);
» more...
T const&
at(key_type const& key) const;
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T&
at(KeyType&& key);
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T const&
at(KeyType&& key) const;
» more...
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T&
at(KeyType&& key);
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T const&
at(KeyType&& key) const;
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
size_type
count(KeyType&& key) const;
Declared in <nlohmann/ordered_map.hpp>
std::pair<iterator, bool>
emplace(
key_type const& key,
T&& t);
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
std::pair<iterator, bool>
emplace(
KeyType&& key,
T&& t);
Declared in <nlohmann/ordered_map.hpp>
iterator
erase(iterator pos);
» more...
size_type
erase(key_type const& key);
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
size_type
erase(KeyType&& key);
» more...
iterator
erase(
iterator first,
iterator last);
» more...
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
size_type
erase(KeyType&& key);
Declared in <nlohmann/ordered_map.hpp>
iterator
find(key_type const& key);
» more...
const_iterator
find(key_type const& key) const;
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
iterator
find(KeyType&& key);
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
const_iterator
find(KeyType&& key) const;
» more...
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
iterator
find(KeyType&& key);
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
const_iterator
find(KeyType&& key) const;
Declared in <nlohmann/ordered_map.hpp>
std::pair<iterator, bool>
insert(value_type const& value);
» more...
std::pair<iterator, bool>
insert(value_type&& value);
» more...
template<
typename InputIt,
typename = require_input_iter<InputIt>>
void
insert(
InputIt first,
InputIt last);
» more...
Declared in <nlohmann/ordered_map.hpp>
std::pair<iterator, bool>
insert(value_type const& value);
Declared in <nlohmann/ordered_map.hpp>
std::pair<iterator, bool>
insert(value_type&& value);
Declared in <nlohmann/ordered_map.hpp>
template<
typename InputIt,
typename = require_input_iter<InputIt>>
void
insert(
InputIt first,
InputIt last);
Subscript operators
Declared in <nlohmann/ordered_map.hpp>
T&
operator[](key_type const& key);
» more...
T const&
operator[](key_type const& key) const;
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T&
operator[](KeyType&& key);
» more...
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T const&
operator[](KeyType&& key) const;
» more...
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T&
operator[](KeyType&& key);
Declared in <nlohmann/ordered_map.hpp>
template<class KeyType>
requires detail::is_usable_as_key_type<key_compare, key_type, KeyType>::value
T const&
operator[](KeyType&& key) const;
Declared in <nlohmann/json.hpp>
[[__nonnull__]]
nlohmann::json
Unnamed function(
char const* s,
std::size_t n);
» more...
[[__nonnull__]]
nlohmann::json::json_pointer
Unnamed function(
char const* s,
std::size_t n);
» more...
[[__nonnull__]]
nlohmann::json
Unnamed function(
char8_t const* s,
std::size_t n);
» more...
nlohmann::json::json_pointer
Unnamed function(
char8_t const* s,
std::size_t n);
» more...
Declared in <nlohmann/json.hpp>
[[__nonnull__]]
nlohmann::json
Unnamed function(
char const* s,
std::size_t n);
Declared in <nlohmann/json.hpp>
[[__nonnull__]]
nlohmann::json::json_pointer
Unnamed function(
char const* s,
std::size_t n);
Declared in <nlohmann/json.hpp>
[[__nonnull__]]
nlohmann::json
Unnamed function(
char8_t const* s,
std::size_t n);
Declared in <nlohmann/json.hpp>
nlohmann::json::json_pointer
Unnamed function(
char8_t const* s,
std::size_t n);
Right shift operators
Declared in <nlohmann/json.hpp>
deserialize from stream
std::istream&
operator>>(
std::istream& i,
basic_json& j);
» more...
deserialize from stream
std::istream&
operator>>(
std::istream& i,
basic_json<>& j);
» more...
serialize to stream
[[__deprecated__]]
std::ostream&
operator>>(
basic_json const& j,
std::ostream& o);
» more...
serialize to stream
[[__deprecated__]]
std::ostream&
operator>>(
basic_json<> const& j,
std::ostream& o);
» more...
deserialize from stream
| Name | Description |
|---|---|
| i | The left operand |
| j | The right operand |
deserialize from stream
Declared in <nlohmann/json.hpp>
std::istream&
operator>>(
std::istream& i,
basic_json<>& j);
| Name | Description |
|---|---|
| i | The left operand |
| j | The right operand |
serialize to stream
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
std::ostream&
operator>>(
basic_json const& j,
std::ostream& o);
| Name | Description |
|---|---|
| j | The left operand |
| o | The right operand |
serialize to stream
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
std::ostream&
operator>>(
basic_json<> const& j,
std::ostream& o);
| Name | Description |
|---|---|
| j | The left operand |
| o | The right operand |
exchanges the values
Declared in <nlohmann/json.hpp>
exchanges the values
void
swap(
reference left,
reference right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
» more...
exchanges the values
void
swap(
reference left,
reference right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
» more...
exchanges the values
Declared in <nlohmann/json.hpp>
void
swap(
reference left,
reference right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
| Name | Description |
|---|---|
| left | the type of an element reference |
| right | the type of an element reference |
exchanges the values
Declared in <nlohmann/json.hpp>
void
swap(
reference left,
reference right) noexcept(std::is_nothrow_move_constructible<value_t>::value && std::is_nothrow_move_assignable<value_t>::value && std::is_nothrow_move_constructible<json_value>::value && std::is_nothrow_move_assignable<json_value>::value);
| Name | Description |
|---|---|
| left | the type of an element reference |
| right | the type of an element reference |
user-defined to_string function for JSON values
Declared in <nlohmann/json.hpp>
template<
template<
typename,
typename,
typename...> typename ObjectType,
template<
typename,
typename...> typename ArrayType,
class StringType,
class BooleanType,
class NumberIntegerType,
class NumberUnsignedType,
class NumberFloatType,
template<typename> typename AllocatorType,
template<
typename,
typename = void> typename JSONSerializer,
class BinaryType,
class CustomBaseClass>
std::string
to_string(basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass> const& j);
| Name | Description |
|---|---|
| j | a class to store JSON values |
Left shift operators
Declared in <nlohmann/json.hpp>
deserialize from stream
[[__deprecated__]]
std::istream&
operator<<(
basic_json& j,
std::istream& i);
» more...
serialize to stream
std::ostream&
operator<<(
std::ostream& o,
basic_json const& j);
» more...
write string representation of the JSON pointer to stream
std::ostream&
operator<<(
std::ostream& o,
json_pointer const& ptr);
» more...
deserialize from stream
[[__deprecated__]]
std::istream&
operator<<(
basic_json<>& j,
std::istream& i);
» more...
serialize to stream
std::ostream&
operator<<(
std::ostream& o,
basic_json<> const& j);
» more...
deserialize from stream
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
std::istream&
operator<<(
basic_json& j,
std::istream& i);
| Name | Description |
|---|---|
| j | The left operand |
| i | The right operand |
serialize to stream
Declared in <nlohmann/json.hpp>
std::ostream&
operator<<(
std::ostream& o,
basic_json const& j);
Reference to the current output stream
| Name | Description |
|---|---|
| o | An output stream |
| j | The object to output |
deserialize from stream
Declared in <nlohmann/json.hpp>
[[__deprecated__]]
std::istream&
operator<<(
basic_json<>& j,
std::istream& i);
| Name | Description |
|---|---|
| j | The left operand |
| i | The right operand |
serialize to stream
Declared in <nlohmann/json.hpp>
std::ostream&
operator<<(
std::ostream& o,
basic_json<> const& j);
Reference to the current output stream
| Name | Description |
|---|---|
| o | An output stream |
| j | The object to output |