Represents an entry in a JSON AST.
More...
#include <jsonv/ast.hpp>
|
| using | storage_type = std::variant< document_end, document_start, object_begin, object_end, array_begin, array_end, string_canonical, string_escaped, key_canonical, key_escaped, literal_true, literal_false, literal_null, integer, decimal, error > |
| |
Represents an entry in a JSON AST.
- See also
- parse_index
Definition at line 159 of file ast.hpp.
◆ storage_type
| using jsonv::ast_node::storage_type = std::variant<document_end, document_start, object_begin, object_end, array_begin, array_end, string_canonical, string_escaped, key_canonical, key_escaped, literal_true, literal_false, literal_null, integer, decimal, error > |
◆ ast_node() [1/2]
| jsonv::ast_node::ast_node |
( |
const storage_type & |
value | ) |
|
|
inline |
◆ ast_node() [2/2]
template<
typename T , typename... TArgs>
| jsonv::ast_node::ast_node |
( |
std::in_place_type_t< T > |
type, |
|
|
TArgs &&... |
args |
|
) |
| |
|
inlineexplicit |
◆ as()
| const T & jsonv::ast_node::as |
( |
| ) |
const |
|
inline |
Get the underlying data of this node as T.
- Exceptions
-
| std::bad_variant_access | if the requested T is different from the type of this instance. |
Definition at line 485 of file ast.hpp.
◆ as_key()
◆ storage()
| const storage_type & jsonv::ast_node::storage |
( |
| ) |
const |
|
inline |
Get the std::variant that backs this type.
- See also
- visit
Definition at line 449 of file ast.hpp.
◆ token_raw()
Get a view of the raw token.
For example, "true", "{", or "1234". Note that this includes the complete source, so string types such as ast_node_type::string_canonical include the opening and closing quotations.
Definition at line 476 of file ast.hpp.
◆ type()
Get the ast_node_type that tells the underlying type of this instance.
Definition at line 469 of file ast.hpp.
◆ visit()
Convenience function for calling std::visit on the underlying storage of this node.
Definition at line 456 of file ast.hpp.
◆ visit_key()
| auto jsonv::ast_node::visit_key |
( |
FVisitor && |
visitor | ) |
const |
|
inline |
Convenience function for calling std::visit on a key (see as_key).
Definition at line 463 of file ast.hpp.
The documentation for this class was generated from the following file: