mirror of
https://github.com/nlohmann/json.git
synced 2026-11-19 01:41:22 +00:00
Document json_document and json_view
- API pages for basic_json_document and basic_json_view, one per member, and for the four aliases, each with an example - features/json_view.md: the problem the view solves, ownership and lifetime, what matches basic_json::parse() and what differs, and when to choose json, ordered_json, SAX, or the view - the examples show why one would use the view, not only how: borrowed vs. owned input, reading a few fields and materializing one subtree, reusing a document across many messages - registered in the mkdocs navigation, llms.txt, the docset, the exceptions page (out_of_range.416), architecture.md, the integration page, and the README; the yyjson credit is added to the README and license.md Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
109 files changed
+2983
-1
No files matched your search
@@ -0,0 +1,10 @@
|
||||
#include <iostream>
|
||||
#include <nlohmann/json_view.hpp>
|
||||
|
||||
int main()
|
||||
{
|
||||
nlohmann::ordered_json_document doc = nlohmann::ordered_json_document::parse(R"({"z": 1, "a": 2})");
|
||||
nlohmann::ordered_json_view v = doc.root();
|
||||
|
||||
std::cout << std::boolalpha << v.is_object() << ' ' << v.size() << '\n';
|
||||
}
|
||||
Reference in new issue
Block a user