text
stringlengths
24
1.04M
metadata
stringlengths
233
497
### File: docs/examples/number_unsigned_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { std::cout << std::boolalpha << std::is_same<std::uint64_t, json::number_unsigned_t>::value << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/number_unsigned_t.cpp", "license": "mit", "size": 223}
### File: docs/examples/object.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON objects json j_no_init_list = json::object(); json j_empty_init_list = json::object({}); json j_list_of_pairs = json::object({ {"one", 1}, {"two", 2} }); //...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/object.cpp", "license": "mit", "size": 707}
### File: docs/examples/object_comparator_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { std::cout << std::boolalpha << "json::object_comparator_t(\"one\", \"two\") = " << json::object_comparator_t{}("one", "two") << "\n" << "json::obje...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/object_comparator_t.cpp", "license": "mit", "size": 377}
### File: docs/examples/object_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { std::cout << std::boolalpha << std::is_same<std::map<json::string_t, json>, json::object_t>::value << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/object_t.cpp", "license": "mit", "size": 231}
### File: docs/examples/operator__ValueType.cpp #include <iostream> #include <unordered_map> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON value with different types json json_types = { {"boolean", true}, { "number", { {...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__ValueType.cpp", "license": "mit", "size": 1431}
### File: docs/examples/operator__equal.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A", "a"}...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__equal.cpp", "license": "mit", "size": 827}
### File: docs/examples/operator__equal__nullptr_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array = {1, 2, 3}; json object = {{"A", "a"}, {"B", "b"}}; json number = 17; json string = "foo"; json null; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__equal__nullptr_t.cpp", "license": "mit", "size": 698}
### File: docs/examples/operator__equal__specializations.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { nlohmann::json uj1 = {{"version", 1}, {"type", "integer"}}; nlohmann::json uj2 = {{"type", "integer"}, {"version", 1}}; nlohmann::orde...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__equal__specializations.cpp", "license": "mit", "size": 474}
### File: docs/examples/operator__greater.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A", "a...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__greater.cpp", "license": "mit", "size": 817}
### File: docs/examples/operator__greaterequal.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__greaterequal.cpp", "license": "mit", "size": 825}
### File: docs/examples/operator__less.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A", "a"}}...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__less.cpp", "license": "mit", "size": 821}
### File: docs/examples/operator__lessequal.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A", ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__lessequal.cpp", "license": "mit", "size": 825}
### File: docs/examples/operator__notequal.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array_1 = {1, 2, 3}; json array_2 = {1, 2, 4}; json object_1 = {{"A", "a"}, {"B", "b"}}; json object_2 = {{"B", "b"}, {"A", "...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__notequal.cpp", "license": "mit", "size": 827}
### File: docs/examples/operator__notequal__nullptr_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create several JSON values json array = {1, 2, 3}; json object = {{"A", "a"}, {"B", "b"}}; json number = 17; json string = "foo"; json null; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__notequal__nullptr_t.cpp", "license": "mit", "size": 698}
### File: docs/examples/operator__value_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j_null; json j_boolean = true; json j_number_integer = -17; json j_number_unsigned = 42u; json j_number_float = 23.42; json j_...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator__value_t.cpp", "license": "mit", "size": 1361}
### File: docs/examples/operator_array__json_pointer.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON value json j = { {"number", 1}, {"string", "foo"}, {"array", {1, 2}} }; // read-only acc...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__json_pointer.cpp", "license": "mit", "size": 1366}
### File: docs/examples/operator_array__json_pointer_const.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON value const json j = { {"number", 1}, {"string", "foo"}, {"array", {1, 2}} }; // r...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__json_pointer_const.cpp", "license": "mit", "size": 684}
### File: docs/examples/operator_array__keytype.c++17.cpp #include <iostream> #include <iomanip> #include <string_view> #include <nlohmann/json.hpp> using namespace std::string_view_literals; using json = nlohmann::json; int main() { // create a JSON object json object = { {"one", 1}, {"two", 2}, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__keytype.c++17.cpp", "license": "mit", "size": 734}
### File: docs/examples/operator_array__keytype_const.c++17.cpp #include <iostream> #include <string_view> #include <nlohmann/json.hpp> using namespace std::string_view_literals; using json = nlohmann::json; int main() { // create a JSON object const json object = { {"one", 1}, {"two", 2}, {"three...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__keytype_const.c++17.cpp", "license": "mit", "size": 353}
### File: docs/examples/operator_array__object_t_key_type.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON object json object = { {"one", 1}, {"two", 2}, {"three", 2.9} }; // output element with key "two" ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__object_t_key_type.cpp", "license": "mit", "size": 656}
### File: docs/examples/operator_array__object_t_key_type_const.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON object const json object = { {"one", 1}, {"two", 2}, {"three", 2.9} }; // output element with key "two" std::...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__object_t_key_type_const.cpp", "license": "mit", "size": 285}
### File: docs/examples/operator_array__size_type.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON array json array = {1, 2, 3, 4, 5}; // output element at index 3 (fourth element) std::cout << array[3] << '\n'; // change last elemen...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__size_type.cpp", "license": "mit", "size": 483}
### File: docs/examples/operator_array__size_type_const.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON array const json array = {"first", "2nd", "third", "fourth"}; // output element at index 2 (third element) std::cout << array.at(2) << ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_array__size_type_const.cpp", "license": "mit", "size": 268}
### File: docs/examples/operator_deserialize.cpp #include <iostream> #include <iomanip> #include <sstream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create stream with serialized JSON std::stringstream ss; ss << R"({ "number": 23, "string": "Hello, world!", ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_deserialize.cpp", "license": "mit", "size": 524}
### File: docs/examples/operator_literal_json.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { json j = R"( {"hello": "world", "answer": 42} )"_json; std::cout << std::setw(2) << j << '\n'; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_literal_json.cpp", "license": "mit", "size": 254}
### File: docs/examples/operator_literal_json_pointer.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { json j = R"( {"hello": "world", "answer": 42} )"_json; auto val = j["/hello"_json_pointer]; std::cout...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_literal_json_pointer.cpp", "license": "mit", "size": 297}
### File: docs/examples/operator_ltlt__basic_json.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j_object = {{"one", 1}, {"two", 2}}; json j_array = {1, 2, 4, 8, 16}; // serialize without indentation std...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_ltlt__basic_json.cpp", "license": "mit", "size": 549}
### File: docs/examples/operator_ltlt__json_pointer.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON poiner json::json_pointer ptr("/foo/bar/baz"); // write string representation to stream std::cout << ptr << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_ltlt__json_pointer.cpp", "license": "mit", "size": 246}
### File: docs/examples/operator_spaceship__const_reference.c++20.cpp #include <compare> #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; const char* to_string(const std::partial_ordering& po) { if (std::is_lt(po)) { return "less"; } else if (std::is_gt(po)) { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_spaceship__const_reference.c++20.cpp", "license": "mit", "size": 1164}
### File: docs/examples/operator_spaceship__scalartype.c++20.cpp #include <compare> #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; const char* to_string(const std::partial_ordering& po) { if (std::is_lt(po)) { return "less"; } else if (std::is_gt(po)) { ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/operator_spaceship__scalartype.c++20.cpp", "license": "mit", "size": 1114}
### File: docs/examples/ordered_json.cpp #include <iostream> #include <nlohmann/json.hpp> using ordered_json = nlohmann::ordered_json; int main() { ordered_json j; j["one"] = 1; j["two"] = 2; j["three"] = 3; std::cout << j.dump(2) << '\n'; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/ordered_json.cpp", "license": "mit", "size": 224}
### File: docs/examples/ordered_map.cpp #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 << ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/ordered_map.cpp", "license": "mit", "size": 1109}
### File: docs/examples/other_error.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { try { // executing a failing JSON Patch operation json value = R"({ "best_biscuit": { "name": "Oreo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/other_error.cpp", "license": "mit", "size": 705}
### File: docs/examples/out_of_range.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { try { // calling at() for an invalid index json j = {1, 2, 3, 4}; j.at(4) = 10; } catch (const json::out_of_range& e) { // output exce...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/out_of_range.cpp", "license": "mit", "size": 418}
### File: docs/examples/parse__allow_exceptions.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // an invalid JSON text std::string text = R"( { "key": "value without closing quotes } )"; // parse with exceptions try { jso...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__allow_exceptions.cpp", "license": "mit", "size": 668}
### File: docs/examples/parse__array__parser_callback_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text char text[] = R"( { "Image": { "Width": 800, "Height": 600, "Title": "View ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__array__parser_callback_t.cpp", "license": "mit", "size": 678}
### File: docs/examples/parse__contiguouscontainer__parser_callback_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text given as std::vector std::vector<std::uint8_t> text = {'[', '1', ',', '2', ',', '3', ']', '\0'}; // parse ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__contiguouscontainer__parser_callback_t.cpp", "license": "mit", "size": 363}
### File: docs/examples/parse__istream__parser_callback_t.cpp #include <iostream> #include <iomanip> #include <sstream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text auto text = R"( { "Image": { "Width": 800, "Height": 600, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__istream__parser_callback_t.cpp", "license": "mit", "size": 1354}
### File: docs/examples/parse__iterator_pair.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text given an input with other values std::vector<std::uint8_t> input = {'[', '1', ',', '2', ',', '3', ']', 'o', 't', 'h', 'e', 'r'}; //...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__iterator_pair.cpp", "license": "mit", "size": 423}
### File: docs/examples/parse__pointers.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text given as string that is not null-terminated const char* ptr = "[1,2,3]another value"; // parse and serialize JSON json j_complete = ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__pointers.cpp", "license": "mit", "size": 360}
### File: docs/examples/parse__string__parser_callback_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // a JSON text auto text = R"( { "Image": { "Width": 800, "Height": 600, "Title": "View f...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse__string__parser_callback_t.cpp", "license": "mit", "size": 1192}
### File: docs/examples/parse_error.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { try { // parsing input with a syntax error json::parse("[1,2,3,]"); } catch (const json::parse_error& e) { // output exception information ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/parse_error.cpp", "license": "mit", "size": 463}
### File: docs/examples/patch.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // the original document json doc = R"( { "baz": "qux", "foo": "bar" } )"_json; // th...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/patch.cpp", "license": "mit", "size": 738}
### File: docs/examples/patch_inplace.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // the original document json doc = R"( { "baz": "qux", "foo": "bar" } )"_json; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/patch_inplace.cpp", "license": "mit", "size": 772}
### File: docs/examples/push_back.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json array = {1, 2, 3, 4, 5}; json null; // print values std::cout << array << '\n'; std::cout << null << '\n'; // add values array.p...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/push_back.cpp", "license": "mit", "size": 440}
### File: docs/examples/push_back__initializer_list.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json object = {{"one", 1}, {"two", 2}}; json null; // print values std::cout << object << '\n'; std::cout << null << '\n'; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/push_back__initializer_list.cpp", "license": "mit", "size": 611}
### File: docs/examples/push_back__object_t__value.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json object = {{"one", 1}, {"two", 2}}; json null; // print values std::cout << object << '\n'; std::cout << null << '\n'; ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/push_back__object_t__value.cpp", "license": "mit", "size": 584}
### File: docs/examples/rbegin.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create an array value json array = {1, 2, 3, 4, 5}; // get an iterator to the reverse-beginning json::reverse_iterator it = array.rbegin(); // serialize the element th...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/rbegin.cpp", "license": "mit", "size": 343}
### File: docs/examples/rend.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create an array value json array = {1, 2, 3, 4, 5}; // get an iterator to the reverse-end json::reverse_iterator it = array.rend(); // increment the iterator to point to...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/rend.cpp", "license": "mit", "size": 406}
### File: docs/examples/sax_parse.cpp #include <iostream> #include <iomanip> #include <sstream> #include <nlohmann/json.hpp> using json = nlohmann::json; // a simple event consumer that collects string representations of the passed // values; note inheriting from json::json_sax_t is not required, but can // help not ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/sax_parse.cpp", "license": "mit", "size": 3319}
### File: docs/examples/sax_parse__binary.cpp #include <iostream> #include <iomanip> #include <sstream> #include <nlohmann/json.hpp> using json = nlohmann::json; // a simple event consumer that collects string representations of the passed // values; note inheriting from json::json_sax_t is not required, but can // h...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/sax_parse__binary.cpp", "license": "mit", "size": 2933}
### File: docs/examples/size.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j_null; json j_boolean = true; json j_number_integer = 17; json j_number_float = 23.42; json j_object = {{"one", 1}, {"two", 2}}; json j_ob...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/size.cpp", "license": "mit", "size": 864}
### File: docs/examples/std_hash.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { std::cout << "hash(null) = " << std::hash<json> {}(json(nullptr)) << '\n' << "hash(false) = " << std::hash<json> {}(j...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/std_hash.cpp", "license": "mit", "size": 803}
### File: docs/examples/std_swap.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j1 = {{"one", 1}, {"two", 2}}; json j2 = {1, 2, 4, 8, 16}; std::cout << "j1 = " << j1 << " | j2 = " << j2 << '\n'; // swap...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/std_swap.cpp", "license": "mit", "size": 382}
### File: docs/examples/string_t.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { std::cout << std::boolalpha << std::is_same<std::string, json::string_t>::value << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/string_t.cpp", "license": "mit", "size": 212}
### File: docs/examples/swap__array_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON value json value = {{"array", {1, 2, 3, 4}}}; // create an array_t json::array_t array = {"Snap", "Crackle", "Pop"}; // swap the array stored in t...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/swap__array_t.cpp", "license": "mit", "size": 444}
### File: docs/examples/swap__binary_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a binary value json value = json::binary({1, 2, 3}); // create a binary_t json::binary_t binary = {{4, 5, 6}}; // swap the object stored in the JSON val...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/swap__binary_t.cpp", "license": "mit", "size": 432}
### File: docs/examples/swap__object_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON value json value = { {"translation", {{"one", "eins"}, {"two", "zwei"}}} }; // create an object_t json::object_t object = {{"cow", "Kuh"}, {"dog", "Hu...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/swap__object_t.cpp", "license": "mit", "size": 494}
### File: docs/examples/swap__reference.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create two JSON values json j1 = {1, 2, 3, 4, 5}; json j2 = {{"pi", 3.141592653589793}, {"e", 2.718281828459045}}; // swap the values j1.swap(j2); // outp...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/swap__reference.cpp", "license": "mit", "size": 372}
### File: docs/examples/swap__string_t.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON value json value = { "the good", "the bad", "the ugly" }; // create string_t json::string_t string = "the fast"; // swap the object stored in the...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/swap__string_t.cpp", "license": "mit", "size": 438}
### File: docs/examples/to_bjdata.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; // function to print BJData's diagnostic format void print_byte(uint8_t byte) { if (32 < byte and byte < 128) { std::cout << (char)...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_bjdata.cpp", "license": "mit", "size": 1481}
### File: docs/examples/to_bson.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON value json j = R"({"compact": true, "schema": 0})"_json; // serialize it to BSON std::vector<std::uint...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_bson.cpp", "license": "mit", "size": 507}
### File: docs/examples/to_cbor.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON value json j = R"({"compact": true, "schema": 0})"_json; // serialize it to CBOR std::vector<std::uint...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_cbor.cpp", "license": "mit", "size": 507}
### File: docs/examples/to_json.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; namespace ns { // a simple struct to model a person struct person { std::string name; std::string address; int age; }; } // namespace ns namespace ns { void to_json(json& j, const person& p) ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_json.cpp", "license": "mit", "size": 513}
### File: docs/examples/to_msgpack.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON value json j = R"({"compact": true, "schema": 0})"_json; // serialize it to MessagePack std::vector...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_msgpack.cpp", "license": "mit", "size": 517}
### File: docs/examples/to_string.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; using std::to_string; int main() { // create values json j = {{"one", 1}, {"two", 2}}; int i = 42; // use ADL to select best to_string function auto j_str = to_string(j); // callin...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_string.cpp", "license": "mit", "size": 472}
### File: docs/examples/to_ubjson.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; // function to print UBJSON's diagnostic format void print_byte(uint8_t byte) { if (32 < byte and byte < 128) { std::cout << (char)...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/to_ubjson.cpp", "license": "mit", "size": 1481}
### File: docs/examples/type.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j_null; json j_boolean = true; json j_number_integer = -17; json j_number_unsigned = 42u; json j_number_float = 23.42; json j_object = {{"o...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/type.cpp", "license": "mit", "size": 1031}
### File: docs/examples/type_error.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { try { // calling push_back() on a string value json j = "string"; j.push_back("another string"); } catch (const json::type_error& e) { /...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/type_error.cpp", "license": "mit", "size": 433}
### File: docs/examples/type_name.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON values json j_null; json j_boolean = true; json j_number_integer = -17; json j_number_unsigned = 42u; json j_number_float = 23.42; json j_object =...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/type_name.cpp", "license": "mit", "size": 1021}
### File: docs/examples/unflatten.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create JSON value json j_flattened = { {"/answer/everything", 42}, {"/happy", true}, {"/list/0", 1}, {"/list/1", 0}, ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/unflatten.cpp", "license": "mit", "size": 553}
### File: docs/examples/update.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create two JSON objects json o1 = R"( {"color": "red", "price": 17.99, "names": {"de": "Flugzeug"}} )"_json; json o2 = R"(...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/update.cpp", "license": "mit", "size": 691}
### File: docs/examples/update__range.cpp #include <iostream> #include <iomanip> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create two JSON objects json o1 = R"( {"color": "red", "price": 17.99, "names": {"de": "Flugzeug"}} )"_json; json o...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/update__range.cpp", "license": "mit", "size": 727}
### File: docs/examples/value__json_ptr.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; using namespace nlohmann::literals; int main() { // create a JSON object with different entry types json j = { {"integer", 1}, {"floating", 42.23}, {"string", "...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/value__json_ptr.cpp", "license": "mit", "size": 907}
### File: docs/examples/value__keytype.c++17.cpp #include <iostream> #include <string_view> #include <nlohmann/json.hpp> using namespace std::string_view_literals; using json = nlohmann::json; int main() { // create a JSON object with different entry types json j = { {"integer", 1}, {"floa...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/value__keytype.c++17.cpp", "license": "mit", "size": 889}
### File: docs/examples/value__object_t_key_type.cpp #include <iostream> #include <nlohmann/json.hpp> using json = nlohmann::json; int main() { // create a JSON object with different entry types json j = { {"integer", 1}, {"floating", 42.23}, {"string", "hello world"}, {"bo...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/examples/value__object_t_key_type.cpp", "license": "mit", "size": 815}
### File: docs/mkdocs/Makefile # serve the site locally serve: prepare_files style_check venv/bin/mkdocs serve serve_dirty: prepare_files style_check venv/bin/mkdocs serve --dirtyreload build: prepare_files style_check venv/bin/mkdocs build # create files that are not versioned inside the mkdocs folder (images, e...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Makefile", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/Makefile", "license": "mit", "size": 986}
### File: docs/mkdocs/docs/css/custom.css /* disable ligatures in code and preformatted blocks */ code, pre { font-variant-ligatures: none; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CSS", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/css/custom.css", "license": "mit", "size": 104}
### File: docs/mkdocs/docs/integration/conan/CMakeLists.txt project(json_example) cmake_minimum_required(VERSION 2.8.12) add_definitions("-std=c++11") include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) conan_basic_setup() add_executable(json_example example.cpp) target_link_libraries(json_example ${CONAN_LIBS})
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/integration/conan/CMakeLists.txt", "license": "mit", "size": 254}
### File: docs/mkdocs/docs/integration/conan/example.cpp #include <nlohmann/json.hpp> #include <iostream> using json = nlohmann::json; int main() { std::cout << json::meta() << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/integration/conan/example.cpp", "license": "mit", "size": 139}
### File: docs/mkdocs/docs/integration/example.cpp #include <nlohmann/json.hpp> #include <iostream> #include <iomanip> using json = nlohmann::json; int main() { std::cout << std::setw(4) << json::meta() << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/integration/example.cpp", "license": "mit", "size": 174}
### File: docs/mkdocs/docs/integration/vcpkg/CMakeLists.txt project(json_example) cmake_minimum_required(VERSION 2.8.12) find_package(nlohmann_json CONFIG REQUIRED) add_executable(json_example example.cpp) target_link_libraries(json_example PRIVATE nlohmann_json::nlohmann_json)
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "CMake", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/integration/vcpkg/CMakeLists.txt", "license": "mit", "size": 221}
### File: docs/mkdocs/docs/integration/vcpkg/example.cpp #include <nlohmann/json.hpp> #include <iostream> using json = nlohmann::json; int main() { std::cout << json::meta() << std::endl; }
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/docs/integration/vcpkg/example.cpp", "license": "mit", "size": 139}
### File: docs/mkdocs/scripts/check_structure.py #!/usr/bin/env python import glob import os.path import re import sys warnings = 0 def report(rule, location, description): global warnings warnings += 1 print(f'{warnings:3}. {location}: {description} [{rule}]') def check_structure(): expected_sec...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "Python", "repo_name": "minhanghuang/nlohmann_json", "path": "docs/mkdocs/scripts/check_structure.py", "license": "mit", "size": 8453}
### File: include/nlohmann/adl_serializer.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-Lice...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/adl_serializer.hpp", "license": "mit", "size": 2279}
### File: include/nlohmann/byte_container_with_subtype.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/byte_container_with_subtype.hpp", "license": "mit", "size": 3533}
### File: include/nlohmann/detail/abi_macros.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-L...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/abi_macros.hpp", "license": "mit", "size": 3807}
### File: include/nlohmann/detail/conversions/from_json.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/conversions/from_json.hpp", "license": "mit", "size": 18880}
### File: include/nlohmann/detail/conversions/to_chars.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2009 Florian Loitsch <https://florian.loitsch...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/conversions/to_chars.hpp", "license": "mit", "size": 38562}
### File: include/nlohmann/detail/conversions/to_json.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/conversions/to_json.hpp", "license": "mit", "size": 16274}
### File: include/nlohmann/detail/exceptions.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-L...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/exceptions.hpp", "license": "mit", "size": 9267}
### File: include/nlohmann/detail/hash.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-License...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/hash.hpp", "license": "mit", "size": 4016}
### File: include/nlohmann/detail/input/binary_reader.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/binary_reader.hpp", "license": "mit", "size": 103146}
### File: include/nlohmann/detail/input/input_adapters.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me>...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/input_adapters.hpp", "license": "mit", "size": 17402}
### File: include/nlohmann/detail/input/json_sax.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SP...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/json_sax.hpp", "license": "mit", "size": 21420}
### File: include/nlohmann/detail/input/lexer.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX-...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/lexer.hpp", "license": "mit", "size": 54569}
### File: include/nlohmann/detail/input/parser.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // SPDX...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/parser.hpp", "license": "mit", "size": 19661}
### File: include/nlohmann/detail/input/position_t.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> // ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/input/position_t.hpp", "license": "mit", "size": 958}
### File: include/nlohmann/detail/iterators/internal_iterator.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohm...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/iterators/internal_iterator.hpp", "license": "mit", "size": 1071}
### File: include/nlohmann/detail/iterators/iter_impl.hpp // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++ // | | |__ | | | | | | version 3.11.3 // |_____|_____|_____|_|___| https://github.com/nlohmann/json // // SPDX-FileCopyrightText: 2013-2023 Niels Lohmann <https://nlohmann.me> ...
{"idx": "gitee_code", "domain": "code", "domain2": "gitee-permissive", "header_footer": "", "lang": "en", "source": "gitee_code-0.jsonl", "prog_lang": "C++", "repo_name": "minhanghuang/nlohmann_json", "path": "include/nlohmann/detail/iterators/iter_impl.hpp", "license": "mit", "size": 24046}