🔧 add namespaces
This commit is contained in:
parent
5a5073dd2b
commit
e97c93f451
43
doc/examples/ordered_map.cpp
Normal file
43
doc/examples/ordered_map.cpp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
// simple output function
|
||||||
|
template<typename Map>
|
||||||
|
void output(const char* prefix, const Map& m)
|
||||||
|
{
|
||||||
|
std::cout << prefix << " = { ";
|
||||||
|
for (auto& element : m)
|
||||||
|
{
|
||||||
|
std::cout << element.first << ":" << element.second << ' ';
|
||||||
|
}
|
||||||
|
std::cout << "}" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
// create and fill two maps
|
||||||
|
nlohmann::ordered_map<std::string, std::string> m_ordered;
|
||||||
|
m_ordered["one"] = "eins";
|
||||||
|
m_ordered["two"] = "zwei";
|
||||||
|
m_ordered["three"] = "drei";
|
||||||
|
|
||||||
|
std::map<std::string, std::string> m_std;
|
||||||
|
m_std["one"] = "eins";
|
||||||
|
m_std["two"] = "zwei";
|
||||||
|
m_std["three"] = "drei";
|
||||||
|
|
||||||
|
// output: m_ordered is ordered by insertion order, m_std is ordered by key
|
||||||
|
output("m_ordered", m_ordered);
|
||||||
|
output("m_std", m_std);
|
||||||
|
|
||||||
|
// erase and re-add "one" key
|
||||||
|
m_ordered.erase("one");
|
||||||
|
m_ordered["one"] = "eins";
|
||||||
|
|
||||||
|
m_std.erase("one");
|
||||||
|
m_std["one"] = "eins";
|
||||||
|
|
||||||
|
// output: m_ordered shows newly added key at the end; m_std is again ordered by key
|
||||||
|
output("m_ordered", m_ordered);
|
||||||
|
output("m_std", m_std);
|
||||||
|
}
|
||||||
4
doc/examples/ordered_map.output
Normal file
4
doc/examples/ordered_map.output
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
m_ordered = { one:eins two:zwei three:drei }
|
||||||
|
m_std = { one:eins three:drei two:zwei }
|
||||||
|
m_ordered = { two:zwei three:drei one:eins }
|
||||||
|
m_std = { one:eins three:drei two:zwei }
|
||||||
18
doc/examples/std_hash.cpp
Normal file
18
doc/examples/std_hash.cpp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
#include <nlohmann/json.hpp>
|
||||||
|
|
||||||
|
using json = nlohmann::json;
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
std::cout << "hash(null) = " << std::hash<json> {}(json(nullptr)) << '\n'
|
||||||
|
<< "hash(false) = " << std::hash<json> {}(json(false)) << '\n'
|
||||||
|
<< "hash(0) = " << std::hash<json> {}(json(0)) << '\n'
|
||||||
|
<< "hash(0U) = " << std::hash<json> {}(json(0U)) << '\n'
|
||||||
|
<< "hash(\"\") = " << std::hash<json> {}(json("")) << '\n'
|
||||||
|
<< "hash({}) = " << std::hash<json> {}(json::object()) << '\n'
|
||||||
|
<< "hash([]) = " << std::hash<json> {}(json::array()) << '\n'
|
||||||
|
<< "hash({\"hello\": \"world\"}) = " << std::hash<json> {}("{\"hello\": \"world\"}"_json)
|
||||||
|
<< std::endl;
|
||||||
|
}
|
||||||
8
doc/examples/std_hash.output
Normal file
8
doc/examples/std_hash.output
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
hash(null) = 2654435769
|
||||||
|
hash(false) = 2654436030
|
||||||
|
hash(0) = 2654436095
|
||||||
|
hash(0U) = 2654436156
|
||||||
|
hash("") = 11160318156688833227
|
||||||
|
hash({}) = 2654435832
|
||||||
|
hash([]) = 2654435899
|
||||||
|
hash({"hello": "world"}) = 3701319991624763853
|
||||||
@ -1,4 +1,4 @@
|
|||||||
# adl_serializer::from_json
|
# <small>nlohmann::adl_serializer::</small>from_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# adl_serializer
|
# <small>nlohmann::</small>adl_serializer
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename, typename>
|
template<typename, typename>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# adl_serializer::to_json
|
# <small>nlohmann::adl_serializer::</small>to_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename BasicJsonType, typename TargetType = ValueType>
|
template<typename BasicJsonType, typename TargetType = ValueType>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::accept
|
# <small>nlohmann::basic_json::</small>accept
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
@ -84,6 +84,11 @@ Linear in the length of the input. The parser is a predictive LL(1) parser.
|
|||||||
--8<-- "examples/accept__string.output"
|
--8<-- "examples/accept__string.output"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
- [parse](parse.md) - deserialize from a compatible input
|
||||||
|
- [operator>>](operator_gtgt.md) - deserialize from stream
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
- Added in version 3.0.0.
|
- Added in version 3.0.0.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::array
|
# <small>nlohmann::basic_json::</small>array
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
static basic_json array(initializer_list_t init = {});
|
static basic_json array(initializer_list_t init = {});
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::array_t
|
# <small>nlohmann::basic_json::</small>array_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using array_t = ArrayType<basic_json, AllocatorType<basic_json>>;
|
using array_t = ArrayType<basic_json, AllocatorType<basic_json>>;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::at
|
# <small>nlohmann::basic_json::</small>at
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::back
|
# <small>nlohmann::basic_json::</small>back
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
reference back();
|
reference back();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::basic_json
|
# <small>nlohmann::basic_json::</small>basic_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::begin
|
# <small>nlohmann::basic_json::</small>begin
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
iterator begin() noexcept;
|
iterator begin() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::binary
|
# <small>nlohmann::basic_json::</small>binary
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::binary_t
|
# <small>nlohmann::basic_json::</small>binary_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using binary_t = byte_container_with_subtype<BinaryType>;
|
using binary_t = byte_container_with_subtype<BinaryType>;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::boolean_t
|
# <small>nlohmann::basic_json::</small>boolean_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using boolean_t = BooleanType;
|
using boolean_t = BooleanType;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::cbegin
|
# <small>nlohmann::basic_json::</small>cbegin
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
const_iterator cbegin() const noexcept;
|
const_iterator cbegin() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::cbor_tag_handler_t
|
# <small>nlohmann::basic_json::</small>cbor_tag_handler_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
enum class cbor_tag_handler_t
|
enum class cbor_tag_handler_t
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::cend
|
# <small>nlohmann::basic_json::</small>cend
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
const_iterator cend() const noexcept;
|
const_iterator cend() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::clear
|
# <small>nlohmann::basic_json::</small>clear
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void clear() noexcept;
|
void clear() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::contains
|
# <small>nlohmann::basic_json::</small>contains
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::count
|
# <small>nlohmann::basic_json::</small>count
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename KeyT>
|
template<typename KeyT>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::crbegin
|
# <small>nlohmann::basic_json::</small>crbegin
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
const_reverse_iterator crbegin() const noexcept;
|
const_reverse_iterator crbegin() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::crend
|
# <small>nlohmann::basic_json::</small>crend
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
const_reverse_iterator crend() const noexcept;
|
const_reverse_iterator crend() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::diff
|
# <small>nlohmann::basic_json::</small>diff
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
static basic_json diff(const basic_json& source,
|
static basic_json diff(const basic_json& source,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::dump
|
# <small>nlohmann::basic_json::</small>dump
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
string_t dump(const int indent = -1,
|
string_t dump(const int indent = -1,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::emplace
|
# <small>nlohmann::basic_json::</small>emplace
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<class... Args>
|
template<class... Args>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::emplace_back
|
# <small>nlohmann::basic_json::</small>emplace_back
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<class... Args>
|
template<class... Args>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::empty
|
# <small>nlohmann::basic_json::</small>empty
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool empty() const noexcept;
|
bool empty() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::end
|
# <small>nlohmann::basic_json::</small>end
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
iterator end() noexcept;
|
iterator end() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::erase
|
# <small>nlohmann::basic_json::</small>erase
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::error_handler_t
|
# <small>nlohmann::basic_json::</small>error_handler_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
enum class error_handler_t {
|
enum class error_handler_t {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::exception
|
# <small>nlohmann::basic_json::</small>exception
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class exception : public std::exception;
|
class exception : public std::exception;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::find
|
# <small>nlohmann::basic_json::</small>find
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename KeyT>
|
template<typename KeyT>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::flatten
|
# <small>nlohmann::basic_json::</small>flatten
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
basic_json flatten() const;
|
basic_json flatten() const;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::from_bson
|
# <small>nlohmann::basic_json::</small>from_bson
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::from_cbor
|
# <small>nlohmann::basic_json::</small>from_cbor
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::from_msgpack
|
# <small>nlohmann::basic_json::</small>from_msgpack
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::from_ubjson
|
# <small>nlohmann::basic_json::</small>from_ubjson
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::front
|
# <small>nlohmann::basic_json::</small>front
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
reference front();
|
reference front();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get
|
# <small>nlohmann::basic_json::</small>get
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get_allocator
|
# <small>nlohmann::basic_json::</small>get_allocator
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
static allocator_type get_allocator();
|
static allocator_type get_allocator();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get_binary
|
# <small>nlohmann::basic_json::</small>get_binary
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
binary_t& get_binary();
|
binary_t& get_binary();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get_ptr
|
# <small>nlohmann::basic_json::</small>get_ptr
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename PointerType>
|
template<typename PointerType>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get_ref
|
# <small>nlohmann::basic_json::</small>get_ref
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename ReferenceType>
|
template<typename ReferenceType>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::get_to
|
# <small>nlohmann::basic_json::</small>get_to
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename ValueType>
|
template<typename ValueType>
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# basic_json
|
# <small>nlohmann::</small>basic_json
|
||||||
|
|
||||||
Defined in header `<json.hpp>`
|
<small>Defined in header `<nlohmann/json.hpp>`</small>
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<
|
template<
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::input_format_t
|
# <small>nlohmann::basic_json::</small>input_format_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
enum class input_format_t {
|
enum class input_format_t {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::insert
|
# <small>nlohmann::basic_json::</small>insert
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::invalid_iterator
|
# <small>nlohmann::basic_json::</small>invalid_iterator
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class invalid_iterator : public exception;
|
class invalid_iterator : public exception;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_array
|
# <small>nlohmann::basic_json::</small>is_array
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_array() const noexcept;
|
constexpr bool is_array() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_binary
|
# <small>nlohmann::basic_json::</small>is_binary
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_binary() const noexcept;
|
constexpr bool is_binary() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_boolean
|
# <small>nlohmann::basic_json::</small>is_boolean
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_boolean() const noexcept;
|
constexpr bool is_boolean() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_discarded
|
# <small>nlohmann::basic_json::</small>is_discarded
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_discarded() const noexcept;
|
constexpr bool is_discarded() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_null
|
# <small>nlohmann::basic_json::</small>is_null
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_null() const noexcept;
|
constexpr bool is_null() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_number
|
# <small>nlohmann::basic_json::</small>is_number
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_number() const noexcept;
|
constexpr bool is_number() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_number_float
|
# <small>nlohmann::basic_json::</small>is_number_float
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_number_float() const noexcept;
|
constexpr bool is_number_float() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_number_integer
|
# <small>nlohmann::basic_json::</small>is_number_integer
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_number_integer() const noexcept;
|
constexpr bool is_number_integer() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_number_unsigned
|
# <small>nlohmann::basic_json::</small>is_number_unsigned
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_number_unsigned() const noexcept;
|
constexpr bool is_number_unsigned() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_object
|
# <small>nlohmann::basic_json::</small>is_object
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_object() const noexcept;
|
constexpr bool is_object() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_primitive
|
# <small>nlohmann::basic_json::</small>is_primitive
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_primitive() const noexcept;
|
constexpr bool is_primitive() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_string
|
# <small>nlohmann::basic_json::</small>is_string
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_string() const noexcept;
|
constexpr bool is_string() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::is_structured
|
# <small>nlohmann::basic_json::</small>is_structured
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr bool is_structured() const noexcept;
|
constexpr bool is_structured() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::items
|
# <small>nlohmann::basic_json::</small>items
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
iteration_proxy<iterator> items() noexcept;
|
iteration_proxy<iterator> items() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::json_serializer
|
# <small>nlohmann::basic_json::</small>json_serializer
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename T, typename SFINAE>
|
template<typename T, typename SFINAE>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::max_size
|
# <small>nlohmann::basic_json::</small>max_size
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
size_type max_size() const noexcept;
|
size_type max_size() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::merge_patch
|
# <small>nlohmann::basic_json::</small>merge_patch
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
void merge_patch(const basic_json& apply_patch);
|
void merge_patch(const basic_json& apply_patch);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::meta
|
# <small>nlohmann::basic_json::</small>meta
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
static basic_json meta();
|
static basic_json meta();
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::number_float_t
|
# <small>nlohmann::basic_json::</small>number_float_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using number_float_t = NumberFloatType;
|
using number_float_t = NumberFloatType;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::number_integer_t
|
# <small>nlohmann::basic_json::</small>number_integer_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using number_integer_t = NumberIntegerType;
|
using number_integer_t = NumberIntegerType;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::number_unsigned_t
|
# <small>nlohmann::basic_json::</small>number_unsigned_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using number_unsigned_t = NumberUnsignedType;
|
using number_unsigned_t = NumberUnsignedType;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::object
|
# <small>nlohmann::basic_json::</small>object
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
static basic_json object(initializer_list_t init = {});
|
static basic_json object(initializer_list_t init = {});
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::object_comparator_t
|
# <small>nlohmann::basic_json::</small>object_comparator_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using object_comparator_t = std::less<StringType>; // until C++14
|
using object_comparator_t = std::less<StringType>; // until C++14
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::object_t
|
# <small>nlohmann::basic_json::</small>object_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
using object_t = ObjectType<StringType,
|
using object_t = ObjectType<StringType,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator+=
|
# <small>nlohmann::basic_json::</small>operator+=
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator=
|
# <small>nlohmann::basic_json::</small>operator=
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
basic_json& operator=(basic_json other) noexcept (
|
basic_json& operator=(basic_json other) noexcept (
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator[]
|
# <small>nlohmann::basic_json::</small>operator[]
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator ValueType
|
# <small>nlohmann::basic_json::</small>operator ValueType
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename ValueType>
|
template<typename ValueType>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator==
|
# <small>nlohmann::basic_json::</small>operator==
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator==(const_reference lhs, const_reference rhs) noexcept;
|
bool operator==(const_reference lhs, const_reference rhs) noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator>=
|
# <small>nlohmann::basic_json::</small>operator>=
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator>=(const_reference lhs, const_reference rhs) noexcept,
|
bool operator>=(const_reference lhs, const_reference rhs) noexcept,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator>
|
# <small>nlohmann::basic_json::</small>operator>
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator>(const_reference lhs, const_reference rhs) noexcept,
|
bool operator>(const_reference lhs, const_reference rhs) noexcept,
|
||||||
|
|||||||
@ -51,7 +51,8 @@ A UTF-8 byte order mark is silently ignored.
|
|||||||
|
|
||||||
## See also
|
## See also
|
||||||
|
|
||||||
- [parse](parse.md) for a variant with a parser callback function to filter values while parsing
|
- [accept](accept.md) - check if the input is valid JSON
|
||||||
|
- [parse](parse.md) - deserialize from a compatible input
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator<=
|
# <small>nlohmann::basic_json::</small>operator<=
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator<=(const_reference lhs, const_reference rhs) noexcept,
|
bool operator<=(const_reference lhs, const_reference rhs) noexcept,
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator""_json
|
# <small>nlohmann::basic_json::</small>operator""_json
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
json operator "" _json(const char* s, std::size_t n);
|
json operator "" _json(const char* s, std::size_t n);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator""_json_pointer
|
# <small>nlohmann::basic_json::</small>operator""_json_pointer
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
json_pointer operator "" _json_pointer(const char* s, std::size_t n);
|
json_pointer operator "" _json_pointer(const char* s, std::size_t n);
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator<
|
# <small>nlohmann::basic_json::</small>operator<
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator<(const_reference lhs, const_reference rhs) noexcept;
|
bool operator<(const_reference lhs, const_reference rhs) noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator!=
|
# <small>nlohmann::basic_json::</small>operator!=
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
bool operator!=(const_reference lhs, const_reference rhs) noexcept;
|
bool operator!=(const_reference lhs, const_reference rhs) noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::operator value_t
|
# <small>nlohmann::basic_json::</small>operator value_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
constexpr operator value_t() const noexcept;
|
constexpr operator value_t() const noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::other_error
|
# <small>nlohmann::basic_json::</small>other_error
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class other_error : public exception;
|
class other_error : public exception;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::out_of_range
|
# <small>nlohmann::basic_json::</small>out_of_range
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class out_of_range : public exception;
|
class out_of_range : public exception;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::parse
|
# <small>nlohmann::basic_json::</small>parse
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
@ -180,6 +180,11 @@ super-linear complexity.
|
|||||||
--8<-- "examples/parse__allow_exceptions.output"
|
--8<-- "examples/parse__allow_exceptions.output"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## See also
|
||||||
|
|
||||||
|
- [accept](accept.md) - check if the input is valid JSON
|
||||||
|
- [operator>>](operator_gtgt.md) - deserialize from stream
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
- Added in version 1.0.0.
|
- Added in version 1.0.0.
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::parse_error
|
# <small>nlohmann::basic_json::</small>parse_error
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
class parse_error : public exception;
|
class parse_error : public exception;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::parse_event_t
|
# <small>nlohmann::basic_json::</small>parse_event_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
enum class parse_event_t : std::uint8_t {
|
enum class parse_event_t : std::uint8_t {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::parser_callback_t
|
# <small>nlohmann::basic_json::</small>parser_callback_t
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
template<typename BasicJsonType>
|
template<typename BasicJsonType>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::patch
|
# <small>nlohmann::basic_json::</small>patch
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
basic_json patch(const basic_json& json_patch) const;
|
basic_json patch(const basic_json& json_patch) const;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::push_back
|
# <small>nlohmann::basic_json::</small>push_back
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::rbegin
|
# <small>nlohmann::basic_json::</small>rbegin
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
reverse_iterator rbegin() noexcept;
|
reverse_iterator rbegin() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::rend
|
# <small>nlohmann::basic_json::</small>rend
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
reverse_iterator rend() noexcept;
|
reverse_iterator rend() noexcept;
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# basic_json::sax_parse
|
# <small>nlohmann::basic_json::</small>sax_parse
|
||||||
|
|
||||||
```cpp
|
```cpp
|
||||||
// (1)
|
// (1)
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user