From 88ddb12afc7d12ec32d3f935b25d701ee14ecb81 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Mon, 18 Dec 2017 19:46:53 +0100 Subject: [PATCH] :memo: fix for #883 - Adjusted table to user-defined exceptions. This was forgotten in the 3.0.0 update. - Added update function to the table. --- doc/index.md | 55 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/doc/index.md b/doc/index.md index 36bde60b4..3c23b3a91 100644 --- a/doc/index.md +++ b/doc/index.md @@ -45,6 +45,8 @@ These pages contain the API documentation of JSON for Modern C++, a C++11 header The container functions known from STL have been extended to support the different value types from JSON. However, not all functions can be applied to all value types. Note that the signature of some functions differ between the types; for instance, `at` may be called with either a string to address a key in an object or with an integer to address a value in an array. +Note that this table only lists those exceptions thrown due to the type. For instance, the @link nlohmann::basic_json::at(const typename object_t::key_type & key) `at` @endlink function will always throw a @link nlohmann::basic_json::type_error `json::type_error` @endlink exception when called for a string type. When called for an array, it *may* throw an @link nlohmann::basic_json::out_of_range `json::out_of_range` @endlink exception if the passed index is invalid. + - - - - + + + + - - - + + + @@ -158,7 +160,7 @@ The container functions known from STL have been extended to support the differe - + @@ -167,7 +169,7 @@ The container functions known from STL have been extended to support the differe - + @@ -198,7 +200,7 @@ The container functions known from STL have been extended to support the differe - + @@ -209,12 +211,12 @@ The container functions known from STL have been extended to support the differe - + - - - - + + + + @@ -223,26 +225,35 @@ The container functions known from STL have been extended to support the differe - + - - - + + + - - - + + + + + + + + + + + +
group @@ -137,18 +139,18 @@ The container functions known from STL have been extended to support the differe `at` @link nlohmann::basic_json::at(const typename object_t::key_type & key) `at` @endlink @link nlohmann::basic_json::at(size_type) `at` @endlinkthrows `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (304)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (304)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (304)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (304)
`operator[]` @link nlohmann::basic_json::operator[](const typename object_t::key_type &key) `operator[]` @endlink @link nlohmann::basic_json::operator[](size_type) `operator[]` @endlinkthrows `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (305)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (305)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (305) @link nlohmann::basic_json::operator[](const typename object_t::key_type & key) `operator[]` @endlink (creates object)
@link nlohmann::basic_json::operator[](size_type) `operator[]` @endlink (creates array)
@link nlohmann::basic_json::front `front` @endlink @link nlohmann::basic_json::front `front` @endlink @link nlohmann::basic_json::front `front` @endlinkthrows `std::out_of_range`throws @link nlohmann::basic_json::invalid_iterator `json::invalid_iterator` @endlink (214)
`back`@link nlohmann::basic_json::back `back` @endlink @link nlohmann::basic_json::back `back` @endlink @link nlohmann::basic_json::back `back` @endlinkthrows `std::out_of_range`throws @link nlohmann::basic_json::invalid_iterator `json::invalid_iterator` @endlink (214)
capacity@link nlohmann::basic_json::max_size `max_size` @endlink (returns `0`)
modifiersmodifiers `clear` @link nlohmann::basic_json::clear `clear` @endlink @link nlohmann::basic_json::clear `clear` @endlink
`insert`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (309) @link nlohmann::basic_json::insert `insert` @endlinkthrows `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (309)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (309)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (309)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (309)
`erase`@link nlohmann::basic_json::erase `erase` @endlink (converts to null) @link nlohmann::basic_json::erase `erase` @endlink (converts to null) @link nlohmann::basic_json::erase `erase` @endlink (converts to null)throwsthrows @link nlohmann::basic_json::type_error `json::type_error` @endlink (307)
`push_back` @link nlohmann::basic_json::push_back(const typename object_t::value_type & val) `push_back` @endlink @link nlohmann::basic_json::push_back(const nlohmann::basic_json &) `push_back` @endlinkthrows `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (308)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (308)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (308) @link nlohmann::basic_json::push_back(const typename object_t::value_type & val) `push_back` @endlink (creates object)
@link nlohmann::basic_json::push_back(const nlohmann::basic_json &) `push_back` @endlink (creates array)
`emplace` / `emplace_back` @link nlohmann::basic_json::emplace() `emplace` @endlink @link nlohmann::basic_json::emplace_back() `emplace_back` @endlinkthrows `std::domain_error`throws `std::domain_error`throws `std::domain_error`throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (311)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (311)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (311) @link nlohmann::basic_json::emplace() `emplace` @endlink (creates object)
@link nlohmann::basic_json::emplace_back() `emplace_back` @endlink (creates array)
`update`@link nlohmann::basic_json::update() `update` @endlinkthrows @link nlohmann::basic_json::type_error `json::type_error` @endlink (312)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (312)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (312)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (312)throws @link nlohmann::basic_json::type_error `json::type_error` @endlink (312)
`swap` @link nlohmann::basic_json::swap `swap` @endlink