Parsed JSON tree that owns the source bytes referenced by node offsets.
More...
#include <schema_json.hpp>
|
| const JsonValue & | root () const noexcept |
| | Returns the root node.
|
| std::string_view | source () const noexcept |
| | Returns the complete owned source.
|
| std::string_view | raw (const JsonValue &value) const noexcept |
| | Returns the original byte slice for a node from this parse.
|
Parsed JSON tree that owns the source bytes referenced by node offsets.
The object is immutable after parsing and safe for concurrent reads. Views returned by source() and raw() remain valid while this ParsedJson lives.
◆ raw()
| std::string_view pulp::timeline::ParsedJson::raw |
( |
const JsonValue & | value | ) |
const |
|
noexcept |
Returns the original byte slice for a node from this parse.
Provenance is checked by node identity, not inferred from byte offsets: value must be the exact root() object or one of its exact descendants. A copied node, a manually constructed node, or a node owned by another ParsedJson is rejected even when its bounds fit source().
- Parameters
-
| value | Node belonging to this parse tree. |
- Returns
- The node's original source bytes, or an empty view when provenance or source bounds fail validation. The function never throws.
◆ root()
| const JsonValue & pulp::timeline::ParsedJson::root |
( |
| ) |
const |
|
inlinenoexcept |
◆ source()
| std::string_view pulp::timeline::ParsedJson::source |
( |
| ) |
const |
|
inlinenoexcept |
Returns the complete owned source.
◆ parse_json
Parses one complete UTF-8 JSON value into an owning immutable document.
Duplicate object keys are rejected. Input bytes are copied, and all parser depth, value, container, and string ceilings are enforced before success.
- Parameters
-
| json | Complete JSON text, borrowed for the call. |
| limits | Parser resource ceilings. |
- Returns
- An owning immutable parse tree or a structured parse error.
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/timeline/include/pulp/timeline/schema_json.hpp