![]() |
Lysa
0.0
Lysa 3D Engine
|
A JSON document, owner of the values tree.
Public Member Functions | |
| JsonDocument () | |
| ~JsonDocument () | |
| JsonDocument (JsonDocument &&other) noexcept | |
| JsonDocument & | operator= (JsonDocument &&other) noexcept |
| JsonDocument (const JsonDocument &) = delete | |
| JsonDocument & | operator= (const JsonDocument &) = delete |
| void | save (const std::string &uri, int indent=4) const |
| void | save (const VirtualFS &fs, const std::string &uri, int indent=4) const |
| std::string | dump (int indent=4) const |
| JsonValue | getRoot () const & |
| JsonValue | getRoot () const && = delete |
Static Public Member Functions | |
| static JsonDocument | parse (const std::string &text) |
| static JsonDocument | load (const std::string &uri) |
| static JsonDocument | load (const VirtualFS &fs, const std::string &uri) |
| JsonDocument | ( | ) |
| ~JsonDocument | ( | ) |
|
noexcept |
|
delete |
| std::string dump | ( | int | indent = 4 | ) | const |
Returns the document as a JSON string
| indent | Number of spaces used to indent, -1 for the most compact form |
| JsonValue getRoot | ( | ) | const & |
Returns a read/write handle on the root value of the document
|
delete |
|
static |
Loads and parses a document from a file
|
static |
Loads and parses a document from a file
| fs | Virtual file system resolving the URI |
| uri | URI of the JSON file |
|
delete |
|
noexcept |
|
static |
Parses a document from a string
| void save | ( | const std::string & | uri, |
| int | indent = 4 |
||
| ) | const |
Writes the document into a file
| uri | URI of the JSON file |
| indent | Number of spaces used to indent, -1 to write the most compact form |
| void save | ( | const VirtualFS & | fs, |
| const std::string & | uri, | ||
| int | indent = 4 |
||
| ) | const |
Writes the document into a file
| fs | Virtual file system resolving the URI |
| uri | URI of the JSON file |
| indent | Number of spaces used to indent, -1 to write the most compact form |