Internal document class wrapping the JSON data tree.
More...
#include <fdl_doc.h>
|
| static Document | parse (const char *json_str, size_t json_len) |
| | Parse JSON string.
|
| |
Internal document class wrapping the JSON data tree.
◆ Document()
| fdl::detail::Document::Document |
( |
ojson |
data | ) |
|
|
inlineexplicit |
Construct from an existing JSON tree.
- Parameters
-
| data | JSON data (moved into the document). |
◆ parse()
| Document fdl::detail::Document::parse |
( |
const char * |
json_str, |
|
|
size_t |
json_len |
|
) |
| |
|
static |
Parse JSON string.
Throws jsoncons::ser_error on failure.
- Parameters
-
| json_str | Pointer to JSON text. |
| json_len | Length of JSON text in bytes. |
- Returns
- Parsed Document.
◆ data() [1/2]
| const ojson & fdl::detail::Document::data |
( |
| ) |
const |
|
inline |
Access the internal JSON data (const).
- Returns
- Const reference to the ojson tree.
◆ data() [2/2]
| ojson & fdl::detail::Document::data |
( |
| ) |
|
|
inline |
Access the internal JSON data (mutable).
- Returns
- Mutable reference to the ojson tree.
◆ get_uuid()
| std::string fdl::detail::Document::get_uuid |
( |
| ) |
const |
Get UUID from the document.
- Returns
- UUID string, or empty string if missing.
◆ get_fdl_creator()
| std::string fdl::detail::Document::get_fdl_creator |
( |
| ) |
const |
Get fdl_creator from the document.
- Returns
- Creator string, or empty string if missing.
◆ to_canonical_json()
Canonical JSON serialization.
Reorders keys per FDL type-specific tables and strips null values.
- Parameters
-
| indent | Spaces per indent level (default 2, 0 for compact). |
- Returns
- Formatted JSON string.
The documentation for this class was generated from the following files: