|
rapidyaml
0.7.2
parse and emit YAML, and do it fast
|
Namespaces | |
| detail | |
| a CRTP base providing read-only methods for ConstNodeRef and NodeRef | |
Classes | |
| struct | LineCol |
| holds a position into a source buffer More... | |
| struct | Location |
| a source file position More... | |
| struct | Callbacks |
| a c-style callbacks class. More... | |
| class | Emitter |
| A stateful emitter, for use with a writer such as WriterBuf, WriterFile, or WriterOStream. More... | |
| struct | EmitOptions |
| A lightweight object containing options to be used when emitting. More... | |
| struct | as_json |
| mark a tree or node to be emitted as yaml when using operator<<, with options. More... | |
| struct | as_yaml |
| mark a tree or node to be emitted as yaml when using operator<< . More... | |
| struct | EventHandlerStack |
| Use this class a base of implementations of event handler to simplify the stack logic. More... | |
| struct | EventHandlerTreeState |
| The stack state needed specifically by EventHandlerTree. More... | |
| struct | EventHandlerTree |
| The event handler to create a ryml Tree. More... | |
| struct | FilterProcessorSrcDst |
| Filters an input string into a different output string. More... | |
| struct | FilterProcessorInplaceEndExtending |
| Filters in place. More... | |
| struct | FilterProcessorInplaceMidExtending |
| Filters in place. More... | |
| class | ParseEngine |
| This is the main driver of parsing logic: it scans the YAML or JSON source for tokens, and emits the appropriate sequence of parsing events to its event handler. More... | |
| struct | Key |
| struct | Key< fmt::const_base64_wrapper > |
| struct | Key< fmt::base64_wrapper > |
| class | ConstNodeRef |
| Holds a pointer to an existing tree, and a node id. More... | |
| class | NodeRef |
| A reference to a node in an existing yaml tree, offering a more convenient API than the index-based API used in the tree. More... | |
| struct | NodeType |
| wraps a NodeType_e element with some syntactic sugar and predicates More... | |
| struct | ParserOptions |
| Options to give to the parser to control its behavior. More... | |
| struct | LineContents |
| Helper to control the line contents while parsing a buffer. More... | |
| struct | ParserState |
| struct | ReferenceResolver |
| Reusable object to resolve references/aliases in the tree. More... | |
| struct | TagDirective |
| struct | TagDirectiveRange |
| struct | NodeScalar |
| a node scalar is a csubstr, which may be tagged and anchored. More... | |
| struct | NodeInit |
| convenience class to initialize nodes More... | |
| struct | NodeData |
| contains the data for each YAML node. More... | |
| class | Tree |
| struct | WriterFile |
| A writer that outputs to a file. More... | |
| struct | WriterOStream |
| A writer that outputs to an STL-like ostream. More... | |
| struct | WriterBuf |
| a writer to a substr More... | |
| struct | EventHandlerYamlStdState |
| The stack state needed specifically by EventHandlerYamlStd. More... | |
| struct | EventHandlerYamlStd |
| The event handler producing standard YAML events as used in the YAML test suite. More... | |
Typedefs | |
| using | id_type = RYML_ID_TYPE |
| The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE to a suitable integer type. More... | |
| using | pfn_error = void(*)(const char *msg, size_t msg_len, Location location, void *user_data) |
| the type of the function used to report errors More... | |
| using | pfn_allocate = void *(*)(size_t len, void *hint, void *user_data) |
| the type of the function used to allocate memory; ryml will only allocate memory through this callback. More... | |
| using | pfn_free = void(*)(void *mem, size_t size, void *user_data) |
| the type of the function used to free memory; ryml will only free memory through this callback. More... | |
| template<class OStream > | |
| using | EmitterOStream = Emitter< WriterOStream< OStream > > |
| using | EmitterFile = Emitter< WriterFile > |
| using | EmitterBuf = Emitter< WriterBuf > |
| using | Parser = ParseEngine< EventHandlerTree > |
| This is the main ryml parser, where the parser events are handled to create a ryml tree. More... | |
| using | type_bits = uint32_t |
| the integral type necessary to cover all the bits for NodeType_e More... | |
| using | ParserFlag_t = int |
| data type for ParserState_e More... | |
| using | tag_bits = uint16_t |
| the integral type necessary to cover all the bits marking node tags More... | |
Enumerations | |
| enum | : id_type { NONE = id_type(-1) } |
| enum | : size_t { npos = size_t(-1) } |
| enum | EmitType_e { EMIT_YAML = 0 , EMIT_JSON = 1 } |
| Specifies the type of content to emit. More... | |
| enum | NodeType_e : type_bits { NOTYPE = 0 , KEY = __(0) , VAL = __(1) , MAP = __(2) , SEQ = __(3) , DOC = __(4) , STREAM = __(5)|SEQ , KEYREF = __(6) , VALREF = __(7) , KEYANCH = __(8) , VALANCH = __(9) , KEYTAG = __(10) , VALTAG = __(11) , _TYMASK = __(12)-1 , KEY_UNFILT = __(12) , VAL_UNFILT = __(13) , FLOW_SL = __(14) , FLOW_ML = __(15) , BLOCK = __(16) , KEY_LITERAL = __(17) , VAL_LITERAL = __(18) , KEY_FOLDED = __(19) , VAL_FOLDED = __(20) , KEY_SQUO = __(21) , VAL_SQUO = __(22) , KEY_DQUO = __(23) , VAL_DQUO = __(24) , KEY_PLAIN = __(25) , VAL_PLAIN = __(26) , KEYVAL = KEY|VAL , KEYSEQ = KEY|SEQ , KEYMAP = KEY|MAP , DOCMAP = DOC|MAP , DOCSEQ = DOC|SEQ , DOCVAL = DOC|VAL , SCALAR_LITERAL = KEY_LITERAL|VAL_LITERAL , SCALAR_FOLDED = KEY_FOLDED|VAL_FOLDED , SCALAR_SQUO = KEY_SQUO|VAL_SQUO , SCALAR_DQUO = KEY_DQUO|VAL_DQUO , SCALAR_PLAIN = KEY_PLAIN|VAL_PLAIN , KEYQUO = KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL , VALQUO = VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL , KEY_STYLE = KEY_LITERAL|KEY_FOLDED|KEY_SQUO|KEY_DQUO|KEY_PLAIN , VAL_STYLE = VAL_LITERAL|VAL_FOLDED|VAL_SQUO|VAL_DQUO|VAL_PLAIN , SCALAR_STYLE = KEY_STYLE|VAL_STYLE , CONTAINER_STYLE_FLOW = FLOW_SL|FLOW_ML , CONTAINER_STYLE_BLOCK = BLOCK , CONTAINER_STYLE = FLOW_SL|FLOW_ML|BLOCK , STYLE = SCALAR_STYLE | CONTAINER_STYLE , _KEYMASK = KEY | KEYQUO | KEYANCH | KEYREF | KEYTAG , _VALMASK = VAL | VALQUO | VALANCH | VALREF | VALTAG } |
| a bit mask for marking node types and styles More... | |
| enum | ParserState_e : ParserFlag_t { RTOP = 0x01 << 0 , RUNK = 0x01 << 1 , RMAP = 0x01 << 2 , RSEQ = 0x01 << 3 , FLOW = 0x01 << 4 , BLCK = 0x01 << 5 , QMRK = 0x01 << 6 , RKEY = 0x01 << 7 , RVAL = 0x01 << 9 , RKCL = 0x01 << 8 , RNXT = 0x01 << 10 , SSCL = 0x01 << 11 , QSCL = 0x01 << 12 , RSET = 0x01 << 13 , RDOC = 0x01 << 14 , NDOC = 0x01 << 15 , USTY = 0x01 << 16 , RSEQIMAP = 0x01 << 17 } |
| Enumeration of the state flags for the parser. More... | |
| enum | YamlTag_e : tag_bits { TAG_NONE = 0 , TAG_MAP = 1 , TAG_OMAP = 2 , TAG_PAIRS = 3 , TAG_SET = 4 , TAG_SEQ = 5 , TAG_BINARY = 6 , TAG_BOOL = 7 , TAG_FLOAT = 8 , TAG_INT = 9 , TAG_MERGE = 10 , TAG_NULL = 11 , TAG_STR = 12 , TAG_TIMESTAMP = 13 , TAG_VALUE = 14 , TAG_YAML = 15 } |
| a bit mask for marking tags for types More... | |
Functions | |
| void | report_error_impl (const char *msg, size_t length, Location loc, FILE *f) |
| void | error_impl (const char *msg, size_t length, Location loc, void *) |
| void * | allocate_impl (size_t length, void *, void *) |
| void | free_impl (void *mem, size_t, void *) |
| void | set_callbacks (Callbacks const &c) |
| set the global callbacks for the library; after a call to this function, these callbacks will be used by newly created objects (unless they are copying older objects with different callbacks). More... | |
| Callbacks const & | get_callbacks () |
| get the global callbacks More... | |
| void | reset_callbacks () |
| set the global callbacks back to their defaults () More... | |
| void | error (Callbacks const &cb, const char *msg, size_t msg_len, Location loc) |
| void | error (const char *msg, size_t msg_len, Location loc) |
| bool | _is_indented_block (csubstr s, size_t prev, size_t i) noexcept |
| size_t | emit_yaml (Tree const &t, id_type id, EmitOptions const &opts, FILE *f) |
| (1) emit YAML to the given file, starting at the given node. More... | |
| size_t | emit_yaml (Tree const &t, id_type id, FILE *f) |
| (2) like (1), but use default emit options More... | |
| size_t | emit_json (Tree const &t, id_type id, EmitOptions const &opts, FILE *f) |
| (1) emit JSON to the given file, starting at the given node. More... | |
| size_t | emit_json (Tree const &t, id_type id, FILE *f) |
| (2) like (1), but use default emit options More... | |
| size_t | emit_yaml (Tree const &t, EmitOptions const &opts, FILE *f=nullptr) |
| (1) emit YAML to the given file, starting at the root node. More... | |
| size_t | emit_yaml (Tree const &t, FILE *f=nullptr) |
| (2) like (1), but use default emit options More... | |
| size_t | emit_json (Tree const &t, EmitOptions const &opts, FILE *f=nullptr) |
| (1) emit JSON to the given file. More... | |
| size_t | emit_json (Tree const &t, FILE *f=nullptr) |
| (2) like (1), but use default emit options More... | |
| size_t | emit_yaml (ConstNodeRef const &r, EmitOptions const &opts, FILE *f=nullptr) |
| (1) emit YAML to the given file. More... | |
| size_t | emit_yaml (ConstNodeRef const &r, FILE *f=nullptr) |
| (2) like (1), but use default emit options More... | |
| size_t | emit_json (ConstNodeRef const &r, EmitOptions const &opts, FILE *f=nullptr) |
| (1) emit JSON to the given file. More... | |
| size_t | emit_json (ConstNodeRef const &r, FILE *f=nullptr) |
| (2) like (1), but use default emit options More... | |
| template<class OStream > | |
| OStream & | operator<< (OStream &s, Tree const &t) |
| emit YAML to an STL-like ostream More... | |
| template<class OStream > | |
| OStream & | operator<< (OStream &s, ConstNodeRef const &n) |
| emit YAML to an STL-like ostream This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
| template<class OStream > | |
| OStream & | operator<< (OStream &s, as_json const &j) |
| emit json to an STL-like stream More... | |
| template<class OStream > | |
| OStream & | operator<< (OStream &s, as_yaml const &y) |
| emit yaml to an STL-like stream More... | |
| substr | emit_yaml (Tree const &t, id_type id, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | emit_yaml (Tree const &t, id_type id, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | emit_json (Tree const &t, id_type id, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | emit_json (Tree const &t, id_type id, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | emit_yaml (Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | emit_yaml (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | emit_json (Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | emit_json (Tree const &t, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | emit_yaml (ConstNodeRef const &r, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit YAML to the given buffer. More... | |
| substr | emit_yaml (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| substr | emit_json (ConstNodeRef const &r, EmitOptions const &opts, substr buf, bool error_on_excess=true) |
| (1) emit JSON to the given buffer. More... | |
| substr | emit_json (ConstNodeRef const &r, substr buf, bool error_on_excess=true) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (Tree const &t, id_type id, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: emit YAML to the given std::string/std::vector-like container, resizing it as needed to fit the emitted YAML. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (Tree const &t, id_type id, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (Tree const &t, id_type id, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: emit JSON to the given std::string/std::vector-like container, resizing it as needed to fit the emitted JSON. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (Tree const &t, id_type id, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_yaml (Tree const &t, id_type id, EmitOptions const &opts={}) |
(3) emit+resize: YAML to a newly-created std::string/std::vector-like container. More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_json (Tree const &t, id_type id, EmitOptions const &opts={}) |
(3) emit+resize: JSON to a newly-created std::string/std::vector-like container. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (Tree const &t, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: YAML to the given std::string/std::vector-like container, resizing it as needed to fit the emitted YAML. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (Tree const &t, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (Tree const &t, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: JSON to the given std::string/std::vector-like container, resizing it as needed to fit the emitted JSON. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (Tree const &t, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_yaml (Tree const &t, EmitOptions const &opts={}) |
(3) emit+resize: YAML to a newly-created std::string/std::vector-like container. More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_json (Tree const &t, EmitOptions const &opts={}) |
(3) emit+resize: JSON to a newly-created std::string/std::vector-like container. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (ConstNodeRef const &n, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: YAML to the given std::string/std::vector-like container, resizing it as needed to fit the emitted YAML. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_yaml (ConstNodeRef const &n, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (ConstNodeRef const &n, EmitOptions const &opts, CharOwningContainer *cont, bool append=false) |
(1) emit+resize: JSON to the given std::string/std::vector-like container, resizing it as needed to fit the emitted JSON. More... | |
| template<class CharOwningContainer > | |
| substr | emitrs_json (ConstNodeRef const &n, CharOwningContainer *cont, bool append=false) |
| (2) like (1), but use default emit options More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_yaml (ConstNodeRef const &n, EmitOptions const &opts={}) |
(3) emit+resize: YAML to a newly-created std::string/std::vector-like container. More... | |
| template<class CharOwningContainer > | |
| CharOwningContainer | emitrs_json (ConstNodeRef const &n, EmitOptions const &opts={}) |
(3) emit+resize: JSON to a newly-created std::string/std::vector-like container. More... | |
| template<class K > | |
| Key< K > | key (K &k) |
| Key< fmt::const_base64_wrapper > | key (fmt::const_base64_wrapper w) |
| Key< fmt::base64_wrapper > | key (fmt::base64_wrapper w) |
| template<class T > | |
| void | write (NodeRef *n, T const &v) |
| template<class T > | |
| std::enable_if< ! std::is_floating_point< T >::value, bool >::type | read (NodeRef const &n, T *v) |
| convert the val of a scalar node to a floating point type, by forwarding its val to from_chars_float<T>(). More... | |
| template<class T > | |
| std::enable_if< std::is_floating_point< T >::value, bool >::type | read (NodeRef const &n, T *v) |
| convert the val of a scalar node to a floating point type, by forwarding its val to from_chars_float<T>(). More... | |
| template<class T > | |
| auto | read (NodeRef const &n, T *v) -> typename std::enable_if< ! std::is_floating_point< T >::value, bool >::type |
| convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>(). More... | |
| template<class T > | |
| auto | read (ConstNodeRef const &n, T *v) -> typename std::enable_if< ! std::is_floating_point< T >::value, bool >::type |
| convert the val of a scalar node to a particular type, by forwarding its val to from_chars<T>(). More... | |
| template<class T > | |
| std::enable_if< std::is_floating_point< T >::value, bool >::type | read (ConstNodeRef const &n, T *v) |
| convert the val of a scalar node to a floating point type, by forwarding its val to from_chars_float<T>(). More... | |
| constexpr C4_CONST NodeType_e | operator| (NodeType_e lhs, NodeType_e rhs) noexcept |
| constexpr C4_CONST NodeType_e | operator& (NodeType_e lhs, NodeType_e rhs) noexcept |
| constexpr C4_CONST NodeType_e | operator>> (NodeType_e bits, uint32_t n) noexcept |
| constexpr C4_CONST NodeType_e | operator<< (NodeType_e bits, uint32_t n) noexcept |
| constexpr C4_CONST NodeType_e | operator~ (NodeType_e bits) noexcept |
| NodeType_e & | operator&= (NodeType_e &subject, NodeType_e bits) noexcept |
| NodeType_e & | operator|= (NodeType_e &subject, NodeType_e bits) noexcept |
| void | parse_in_place (Parser *parser, csubstr filename, substr yaml, Tree *t, id_type node_id) |
| (1) parse YAML into an existing tree node. More... | |
| void | parse_json_in_place (Parser *parser, csubstr filename, substr json, Tree *t, id_type node_id) |
| (1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_in_place (Parser *parser, substr yaml, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_place (Parser *parser, csubstr filename, substr yaml, Tree *t) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_place (Parser *parser, substr yaml, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_place (Parser *parser, csubstr filename, substr yaml, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_place (Parser *parser, substr yaml, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_place (Parser *parser, csubstr filename, substr yaml) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_place (Parser *parser, substr yaml) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_in_place (csubstr filename, substr yaml, Tree *t, id_type node_id) |
| (1) parse YAML into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_in_place (substr yaml, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_place (csubstr filename, substr yaml, Tree *t) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_place (substr yaml, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_place (csubstr filename, substr yaml, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_place (substr yaml, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_place (csubstr filename, substr yaml) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_place (substr yaml) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_json_in_place (Parser *parser, substr json, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_place (Parser *parser, csubstr filename, substr json, Tree *t) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_place (Parser *parser, substr json, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_place (Parser *parser, csubstr filename, substr json, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_place (Parser *parser, substr json, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_place (Parser *parser, csubstr filename, substr json) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_place (Parser *parser, substr json) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_json_in_place (csubstr filename, substr json, Tree *t, id_type node_id) |
| (1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_json_in_place (substr json, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_place (csubstr filename, substr json, Tree *t) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_place (substr json, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_place (csubstr filename, substr json, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_place (substr json, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_place (csubstr filename, substr json) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_place (substr json) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_in_arena (Parser *parser, csubstr filename, csubstr yaml, Tree *t, id_type node_id) |
| (1) parse YAML into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_in_arena (Parser *parser, csubstr yaml, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_arena (Parser *parser, csubstr filename, csubstr yaml, Tree *t) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_arena (Parser *parser, csubstr yaml, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_arena (Parser *parser, csubstr filename, csubstr yaml, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_arena (Parser *parser, csubstr yaml, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_arena (Parser *parser, csubstr filename, csubstr yaml) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_arena (Parser *parser, csubstr yaml) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_in_arena (csubstr filename, csubstr yaml, Tree *t, id_type node_id) |
| (1) parse YAML into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_in_arena (csubstr yaml, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_arena (csubstr filename, csubstr yaml, Tree *t) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_arena (csubstr yaml, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_arena (csubstr filename, csubstr yaml, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_arena (csubstr yaml, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_arena (csubstr filename, csubstr yaml) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_arena (csubstr yaml) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_json_in_arena (Parser *parser, csubstr filename, csubstr json, Tree *t, id_type node_id) |
| (1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_json_in_arena (Parser *parser, csubstr json, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_arena (Parser *parser, csubstr filename, csubstr json, Tree *t) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_arena (Parser *parser, csubstr json, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_arena (Parser *parser, csubstr filename, csubstr json, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_arena (Parser *parser, csubstr json, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_arena (Parser *parser, csubstr filename, csubstr json) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_arena (Parser *parser, csubstr json) |
| (8) like (7) but no filename will be reported More... | |
| void | parse_json_in_arena (csubstr filename, csubstr json, Tree *t, id_type node_id) |
| (1) parse JSON into an existing tree node. The filename will be used in any error messages arising during the parse. More... | |
| void | parse_json_in_arena (csubstr json, Tree *t, id_type node_id) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_arena (csubstr filename, csubstr json, Tree *t) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_arena (csubstr json, Tree *t) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_arena (csubstr filename, csubstr json, NodeRef node) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_arena (csubstr json, NodeRef node) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_arena (csubstr filename, csubstr json) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_arena (csubstr json) |
| (8) like (7) but no filename will be reported More... | |
| size_t | _find_last_newline_and_larger_indentation (csubstr s, size_t indentation) noexcept |
| id_type | estimate_tree_capacity (csubstr src) |
| Quickly inspect the source to estimate the number of nodes the resulting tree is likely have. More... | |
| size_t | preprocess_rxmap (csubstr rxmap, substr buf) |
| Write into a given output buffer. More... | |
| template<class CharContainer > | |
| substr | preprocess_rxmap (csubstr rxmap, CharContainer *out) |
| template<class CharContainer > | |
| CharContainer | preprocess_rxmap (csubstr rxmap) |
| template<class K , class V , class Less , class Alloc > | |
| void | write (c4::yml::NodeRef *n, std::map< K, V, Less, Alloc > const &m) |
| template<class K , class V , class Less , class Alloc > | |
| bool | read (c4::yml::ConstNodeRef const &n, std::map< K, V, Less, Alloc > *m) |
| template<class V , class Alloc > | |
| void | write (c4::yml::NodeRef *n, std::vector< V, Alloc > const &vec) |
| template<class V , class Alloc > | |
| bool | read (c4::yml::ConstNodeRef const &n, std::vector< V, Alloc > *vec) |
| template<class Alloc > | |
| bool | read (c4::yml::ConstNodeRef const &n, std::vector< bool, Alloc > *vec) |
| specialization: std::vector<bool> uses std::vector<bool>::reference as the return value of its operator[]. More... | |
| bool | is_custom_tag (csubstr tag) |
| csubstr | normalize_tag (csubstr tag) |
| csubstr | normalize_tag_long (csubstr tag) |
| csubstr | normalize_tag_long (csubstr tag, substr output) |
| YamlTag_e | to_tag (csubstr tag) |
| csubstr | from_tag_long (YamlTag_e tag) |
| csubstr | from_tag (YamlTag_e tag) |
| template<class T > | |
| size_t | to_chars_float (substr buf, T val) |
| encode a floating point value to a string. More... | |
| template<class T > | |
| bool | from_chars_float (csubstr buf, T *val) |
| decode a floating point from string. More... | |
| csubstr | version () |
| int | version_major () |
| int | version_minor () |
| int | version_patch () |
| void | append_escaped (extra::string *s, csubstr val) |
scalar style helpers | |
| bool | scalar_style_query_squo (csubstr s) noexcept |
| query whether a scalar can be encoded using single quotes. More... | |
| bool | scalar_style_query_plain (csubstr s) noexcept |
| query whether a scalar can be encoded using plain style (no quotes, not a literal/folded block scalar). More... | |
| NodeType_e | scalar_style_choose (csubstr scalar) noexcept |
| choose a YAML emitting style based on the scalar's contents More... | |
| NodeType_e | scalar_style_json_choose (csubstr scalar) noexcept |
| choose a json style based on the scalar's contents More... | |
| bool | scalar_is_null (csubstr s) noexcept |
| YAML-sense query of nullity. More... | |
| using c4::yml::id_type = typedef RYML_ID_TYPE |
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE to a suitable integer type.
Definition at line 252 of file common.hpp.
| using c4::yml::ParserFlag_t = typedef int |
data type for ParserState_e
Definition at line 12 of file parser_state.hpp.
| anonymous enum : id_type |
| Enumerator | |
|---|---|
| NONE | an index to none |
Definition at line 257 of file common.hpp.
| anonymous enum : size_t |
Enumeration of the state flags for the parser.
| Enumerator | |
|---|---|
| RTOP | reading at top level |
| RUNK | reading unknown state (when starting): must determine whether scalar, map or seq |
| RMAP | reading a map |
| RSEQ | reading a seq |
| FLOW | reading is inside explicit flow chars: [] or {} |
| BLCK | reading in block mode |
| QMRK | reading an explicit key ( |
| RKEY | reading a scalar as key |
| RVAL | reading a scalar as val |
| RKCL | reading the key colon (ie the : after the key in the map) |
| RNXT | read next val or keyval |
| SSCL | there's a stored scalar |
| QSCL | stored scalar was quoted |
| RSET | the (implicit) map being read is a !!set.
|
| RDOC | reading a document |
| NDOC | no document mode. a document has ended and another has not started yet. |
| USTY | reading in unknown style mode - must determine FLOW or BLCK reading an implicit map nested in an explicit seq. eg, {key: [key2: value2, key3: value3]} is parsed as {key: [{key2: value2}, {key3: value3}]} |
| RSEQIMAP | |
Definition at line 15 of file parser_state.hpp.
| void c4::yml::report_error_impl | ( | const char * | msg, |
| size_t | length, | ||
| Location | loc, | ||
| FILE * | f | ||
| ) |
Definition at line 23 of file common.cpp.
References c4::yml::Location::col, c4::yml::Location::line, c4::yml::Location::name, and c4::yml::Location::offset.
Referenced by error_impl().
| void c4::yml::error_impl | ( | const char * | msg, |
| size_t | length, | ||
| Location | loc, | ||
| void * | |||
| ) |
Definition at line 49 of file common.cpp.
References report_error_impl().
Referenced by allocate_impl().
| void* c4::yml::allocate_impl | ( | size_t | length, |
| void * | , | ||
| void * | |||
| ) |
Definition at line 60 of file common.cpp.
References error_impl().
| void c4::yml::free_impl | ( | void * | mem, |
| size_t | , | ||
| void * | |||
| ) |
Definition at line 71 of file common.cpp.
Definition at line 130 of file common.cpp.
References c4::yml::Callbacks::m_error, and c4::yml::Callbacks::m_user_data.
Referenced by c4::yml::WriterBuf::_get(), and error().
| void c4::yml::error | ( | const char * | msg, |
| size_t | msg_len, | ||
| Location | loc | ||
| ) |
|
inlinenoexcept |
|
inline |
convert the val of a scalar node to a floating point type, by forwarding its val to from_chars_float<T>().
"34", "34 " "34hg" "34 gh" will be read as 34. If you are not sure about the contents of the data, you can use csubstr::first_real_span() to check before calling >>, for example like this:Definition at line 1707 of file node.hpp.
References from_chars_float(), and c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::val().
|
noexcept |
| void c4::yml::write | ( | c4::yml::NodeRef * | n, |
| std::map< K, V, Less, Alloc > const & | m | ||
| ) |
| bool c4::yml::read | ( | c4::yml::ConstNodeRef const & | n, |
| std::map< K, V, Less, Alloc > * | m | ||
| ) |
| void c4::yml::write | ( | c4::yml::NodeRef * | n, |
| std::vector< V, Alloc > const & | vec | ||
| ) |
| bool c4::yml::read | ( | c4::yml::ConstNodeRef const & | n, |
| std::vector< V, Alloc > * | vec | ||
| ) |
Definition at line 25 of file vector.hpp.
References c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children().
| bool c4::yml::read | ( | c4::yml::ConstNodeRef const & | n, |
| std::vector< bool, Alloc > * | vec | ||
| ) |
specialization: std::vector<bool> uses std::vector<bool>::reference as the return value of its operator[].
Definition at line 39 of file vector.hpp.
References c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children().
| size_t c4::yml::to_chars_float | ( | substr | buf, |
| T | val | ||
| ) |
encode a floating point value to a string.
Definition at line 42 of file tree.hpp.
References sample::to_chars().
Referenced by c4::yml::Tree::to_arena().
| bool c4::yml::from_chars_float | ( | csubstr | buf, |
| T * | val | ||
| ) |
decode a floating point from string.
Accepts special values: .nan, .inf, -.inf
Definition at line 60 of file tree.hpp.
References sample::from_chars().
Referenced by read().
| csubstr c4::yml::version | ( | ) |
Definition at line 6 of file version.cpp.
References RYML_VERSION.
| int c4::yml::version_major | ( | ) |
| int c4::yml::version_minor | ( | ) |
| int c4::yml::version_patch | ( | ) |