|
rapidyaml
0.12.1
parse and emit YAML, and do it fast
|
Namespaces | |
| detail | |
| a CRTP base providing read-only methods for ConstNodeRef and NodeRef | |
| extra | |
Classes | |
| struct | Location |
| holds a source or yaml file position, for example when an error is detected; See also location_format() and location_format_with_context(). More... | |
| struct | ErrorDataBasic |
| Data for a basic error. More... | |
| struct | ErrorDataParse |
| Data for a parse error. More... | |
| struct | ErrorDataVisit |
| Data for a visit error. More... | |
| struct | ParserOptions |
| Options to give to the parser to control its behavior. More... | |
| struct | Callbacks |
| A c-style callbacks class to customize behavior on errors or allocation. 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 | ExceptionBasic |
| Exception thrown by the default basic error implementation. More... | |
| struct | ExceptionParse |
| Exception thrown by the default parse error implementation. More... | |
| struct | ExceptionVisit |
| Exception thrown by the default visit error implementation. More... | |
| struct | escaped_scalar |
| formatting helper to escape a scalar with escape_scalar() More... | |
| struct | EventHandlerStack |
| Use this class a base of implementations of event handler to simplify the stack logic. More... | |
| struct | EventHandlerTree |
| The event handler to create a ryml Tree. More... | |
| struct | FilterResult |
| Abstracts the fact that a scalar filter result may not fit in the intended memory. More... | |
| struct | FilterResultExtending |
| Abstracts the fact that a scalar filter result may not fit in the intended memory. 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 | LineContents |
| Helper to control the line contents while parsing a buffer. More... | |
| struct | ParserState |
| struct | ReferenceResolver |
| Reusable object to resolve references/aliases in a Tree. More... | |
| struct | TagCache |
| Accelerator structure to reduce memory requirements by enabling reuse of resolved tags. More... | |
| struct | TagDirective |
| struct | TagDirectiveRange |
| struct | TagDirectives |
| 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... | |
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... | |
| typedef enum c4::yml::Encoding_ | Encoding_e |
| 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... | |
| using | pfn_error_basic = void(*)(csubstr msg, ErrorDataBasic const &errdata, void *user_data) |
| the type of the function used to report basic errors. More... | |
| using | pfn_error_parse = void(*)(csubstr msg, ErrorDataParse const &errdata, void *user_data) |
| the type of the function used to report parse errors. More... | |
| using | pfn_error_visit = void(*)(csubstr msg, ErrorDataVisit const &errdata, void *user_data) |
| the type of the function used to report visit errors. 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 | Encoding_ { NOBOM , UTF8 , UTF16LE , UTF16BE , UTF32LE , UTF32BE } |
| 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) , KEYNIL = __(12) , VALNIL = __(13) , _TYMASK = __(14)-1 , KEY_UNFILT = __(14) , VAL_UNFILT = __(15) , FLOW_SL = __(16) , FLOW_ML = __(17) , BLOCK = __(18) , KEY_LITERAL = __(19) , VAL_LITERAL = __(20) , KEY_FOLDED = __(21) , VAL_FOLDED = __(22) , KEY_SQUO = __(23) , VAL_SQUO = __(24) , KEY_DQUO = __(25) , VAL_DQUO = __(26) , KEY_PLAIN = __(27) , VAL_PLAIN = __(28) , 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 , RFLOW = 0x01 << 4 , RBLCK = 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 | 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 | err_basic (ErrorDataBasic const &errdata, const char *msg) |
| trigger a basic error to its respective handler, with a non-formatted error message. More... | |
| void | err_basic (Callbacks const &callbacks, ErrorDataBasic const &errdata, const char *msg_) |
| trigger a basic error to its respective handler, with a non-formatted error message. More... | |
| void | err_parse (ErrorDataParse const &errdata, const char *msg) |
| trigger a parse error to its respective handler, with a non-formatted error message. More... | |
| void | err_parse (Callbacks const &callbacks, ErrorDataParse const &errdata, const char *msg) |
| trigger a parse error to its respective handler, with a non-formatted error message More... | |
| void | err_visit (ErrorDataVisit const &errdata, const char *msg) |
| trigger a visit error to its respective handler, with a non-formatted error message. More... | |
| void | err_visit (Callbacks const &callbacks, ErrorDataVisit const &errdata, const char *msg) |
| trigger a visit error to its respective handler, with a non-formatted error message More... | |
| 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 DumpFn > | |
| size_t | location_format (DumpFn &&dumpfn, Location const &loc) |
| generic formatting of a location More... | |
| template<class DumpFn > | |
| void | location_format_with_context (DumpFn &&dumpfn, Location const &location, csubstr source_buffer, csubstr call="", size_t num_lines_before=3, size_t num_lines_after=0, size_t first_col_highlight=0, size_t last_col_highlight=0, size_t maxlen=80u) |
| Generic formatting of a location, printing the source code buffer region around the location. More... | |
| template<class DumpFn > | |
| void | err_basic_format (DumpFn &&dumpfn, csubstr msg, ErrorDataBasic const &errdata) |
| Given an error message and associated basic error data, format it fully as a basic error message. More... | |
| template<class DumpFn > | |
| void | err_parse_format (DumpFn &&dumpfn, csubstr msg, ErrorDataParse const &errdata) |
| Given an error message and associated parse error data, format it fully as a parse error message. More... | |
| template<class DumpFn > | |
| void | err_visit_format (DumpFn &&dumpfn, csubstr msg, ErrorDataVisit const &errdata) |
| Given an error message and associated visit error data, format it fully as a visit error message. More... | |
| template<class ... Args> | |
| void | err_basic (Callbacks const &callbacks, ErrorDataBasic const &errdata, const char *fmt, Args const &...args) |
| trigger a basic error to its respective handler, with a formatted error message. More... | |
| template<class ... Args> | |
| void | err_basic (ErrorDataBasic const &errdata, const char *fmt, Args const &...args) |
| trigger a basic error to its respective handler, with a formatted error message. More... | |
| template<class ... Args> | |
| void | err_parse (Callbacks const &callbacks, ErrorDataParse const &errdata, const char *fmt, Args const &...args) |
| trigger a parse error to its respective handler, with a formatted error message More... | |
| template<class ... Args> | |
| void | err_parse (ErrorDataParse const &errdata, const char *fmt, Args const &...args) |
| trigger a parse error to its respective handler, with a formatted error message. More... | |
| template<class ... Args> | |
| void | err_visit (Callbacks const &callbacks, ErrorDataVisit const &errdata, const char *fmt, Args const &...args) |
| trigger a visit error to its respective handler, with a formatted error message More... | |
| template<class ... Args> | |
| void | err_visit (ErrorDataVisit const &errdata, const char *fmt, Args const &...args) |
| trigger a visit error to its respective handler, with a formatted error message. More... | |
| template<class CharContainer > | |
| void | format_exc (CharContainer *out, ExceptionBasic const &exc) |
| Format a basic exception to an existing char container. More... | |
| template<class CharContainer > | |
| void | format_exc (CharContainer *out, ExceptionParse const &exc) |
| Format a parse exception to an existing char container. More... | |
| template<class CharContainer > | |
| void | format_exc (CharContainer *out, ExceptionVisit const &exc) |
| Format a visit exception to an existing char container. More... | |
| template<class CharContainer , class ExceptionT > | |
| CharContainer | format_exc (ExceptionT const &exc) |
| Format a parse exception, and return a newly-created char container. More... | |
| template<class Fn > | |
| void | escape_scalar_fn (Fn &&fn, csubstr scalar, bool keep_newlines=false) |
| Iterate through a scalar and escape special characters in it. More... | |
| size_t | adjust_pos_with_escapes (csubstr scalar, size_t pos, bool keep_newlines=false) |
| Adjust a position in a scalar, increasing it to account for any escaped characters. More... | |
| size_t | escape_scalar (substr buffer, csubstr scalar, bool keep_newlines=false) |
| Escape a scalar to an existing buffer, using escape_scalar_fn. More... | |
| size_t | to_chars (substr buf, escaped_scalar e) |
| formatting implementation to escape a scalar with escape_scalar() More... | |
| template<class SinkPfn > | |
| size_t | dump (SinkPfn &&sinkfn, substr buf, escaped_scalar const &e) |
| dumping implementation to escape a scalar with escape_scalar_fn() 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 > | |
| bool | read (ConstNodeRef const &n, T *v) |
| template<class T > | |
| bool | read (NodeRef const &n, T *v) |
| template<class T > | |
| bool | readkey (ConstNodeRef const &n, T *v) |
| template<class T > | |
| bool | readkey (NodeRef const &n, T *v) |
| 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 the root node of an existing tree. 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, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_place (csubstr filename, substr yaml, Tree *t, ParserOptions const &opts={}) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_place (substr yaml, Tree *t, ParserOptions const &opts={}) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_place (csubstr filename, substr yaml, NodeRef node, ParserOptions const &opts={}) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_place (substr yaml, NodeRef node, ParserOptions const &opts={}) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_place (csubstr filename, substr yaml, ParserOptions const &opts={}) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_place (substr yaml, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_place (csubstr filename, substr json, Tree *t, ParserOptions const &opts={}) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_place (substr json, Tree *t, ParserOptions const &opts={}) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_place (csubstr filename, substr json, NodeRef node, ParserOptions const &opts={}) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_place (substr json, NodeRef node, ParserOptions const &opts={}) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_place (csubstr filename, substr json, ParserOptions const &opts={}) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_place (substr json, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_in_arena (csubstr filename, csubstr yaml, Tree *t, ParserOptions const &opts={}) |
| (3) parse YAML into an existing tree, into its root node. More... | |
| void | parse_in_arena (csubstr yaml, Tree *t, ParserOptions const &opts={}) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_in_arena (csubstr filename, csubstr yaml, NodeRef node, ParserOptions const &opts={}) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_in_arena (csubstr yaml, NodeRef node, ParserOptions const &opts={}) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_in_arena (csubstr filename, csubstr yaml, ParserOptions const &opts={}) |
| (7) create a new tree, and parse YAML into its root node. More... | |
| Tree | parse_in_arena (csubstr yaml, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (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, ParserOptions const &opts={}) |
| (2) like (1) but no filename will be reported More... | |
| void | parse_json_in_arena (csubstr filename, csubstr json, Tree *t, ParserOptions const &opts={}) |
| (3) parse JSON into an existing tree, into its root node. More... | |
| void | parse_json_in_arena (csubstr json, Tree *t, ParserOptions const &opts={}) |
| (4) like (3) but no filename will be reported More... | |
| void | parse_json_in_arena (csubstr filename, csubstr json, NodeRef node, ParserOptions const &opts={}) |
| (5) like (1) but the node is given as a NodeRef More... | |
| void | parse_json_in_arena (csubstr json, NodeRef node, ParserOptions const &opts={}) |
| (6) like (5) but no filename will be reported More... | |
| Tree | parse_json_in_arena (csubstr filename, csubstr json, ParserOptions const &opts={}) |
| (7) create a new tree, and parse JSON into its root node. More... | |
| Tree | parse_json_in_arena (csubstr json, ParserOptions const &opts={}) |
| (8) like (7) but no filename will be reported More... | |
| id_type | estimate_tree_capacity (csubstr src) |
| Quickly inspect the source to estimate the number of nodes the resulting tree is likely to 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) |
| read the node members, assigning into the existing map. More... | |
| 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) |
| read the node members, overwriting existing vector entries. More... | |
| template<class Alloc > | |
| bool | read (c4::yml::ConstNodeRef const &n, std::vector< bool, Alloc > *vec) |
| read the node members, overwriting existing vector entries. More... | |
| bool | is_custom_tag (csubstr tag) |
is a tag of the form !handle!tag? More... | |
| 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) |
| bool | is_valid_tag_handle (csubstr handle) |
| size_t | transform_tag (substr output, csubstr handle, csubstr prefix, csubstr tag, Callbacks const &callbacks, Location const &ymlloc={}, bool with_brackets=true) |
| returns the length of the transformed tag, or 0 to signal that the tag is local and cannot be resolved More... | |
| csubstr | serialize_to_arena (Tree *tree, csubstr a) |
| 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... | |
| template<class T > | |
| auto | serialize_scalar (substr buf, T const &a) -> typename std::enable_if< std::is_floating_point< T >::value, size_t >::type |
| template<class T > | |
| csubstr | serialize_to_arena (Tree *tree, T const &a) |
| csubstr | serialize_to_arena (Tree *tree, substr a) |
| csubstr | serialize_to_arena (Tree *tree, const char *a) |
| csubstr | serialize_to_arena (Tree *, std::nullptr_t) |
| template<class T > | |
| auto | read (Tree const *tree, id_type id, T *v) -> typename std::enable_if<!std::is_arithmetic< T >::value, bool >::type |
| convert the val of a scalar node to a particular non-arithmetic non-float type, by forwarding its val to from_chars<T>(). More... | |
| template<class T > | |
| auto | readkey (Tree const *tree, id_type id, T *v) -> typename std::enable_if<!std::is_arithmetic< T >::value, bool >::type |
| convert the key of a node to a particular non-arithmetic non-float type, by forwarding its key to from_chars<T>(). More... | |
| template<class T > | |
| std::enable_if< std::is_floating_point< T >::value, bool >::type | read (Tree const *tree, id_type id, 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 | readkey (Tree const *tree, id_type id, T *v) |
| convert the key of a scalar node to a floating point type, by forwarding its key to from_chars_float<T>(). More... | |
| csubstr | version () |
| int | version_major () |
| int | version_minor () |
| int | version_patch () |
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 244 of file common.hpp.
| typedef enum c4::yml::Encoding_ c4::yml::Encoding_e |
| using c4::yml::ParserFlag_t = typedef int |
data type for ParserState_e
Definition at line 14 of file parser_state.hpp.
| anonymous enum : id_type |
| Enumerator | |
|---|---|
| NONE | an index to none |
Definition at line 249 of file common.hpp.
| anonymous enum : size_t |
| enum c4::yml::Encoding_ |
| Enumerator | |
|---|---|
| NOBOM | No Byte Order Mark was found. |
| UTF8 | UTF8. |
| UTF16LE | UTF16, Little-Endian. |
| UTF16BE | UTF16, Big-Endian. |
| UTF32LE | UTF32, Little-Endian. |
| UTF32BE | UTF32, Big-Endian. |
Definition at line 262 of file common.hpp.
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 |
| RFLOW | reading is inside explicit flow chars: [] or {} |
| RBLCK | reading in block mode |
| QMRK | reading an explicit key ( |
| RKEY | reading a key |
| RVAL | reading a val |
| RKCL | reading the key colon (ie the : after the key in the map) |
| RNXT | read next sibling |
| 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 17 of file parser_state.hpp.
| void c4::yml::escape_scalar_fn | ( | Fn && | fn, |
| csubstr | scalar, | ||
| bool | keep_newlines = false |
||
| ) |
Iterate through a scalar and escape special characters in it.
This function takes a callback (which accepts a single parameter of csubstr type) and, while processing, calls this callback as appropriate, passing ranges of the scalar and/or escaped characters.
| fn | a sink function receiving a csubstr |
| scalar | the scalar to be escaped |
| keep_newlines | when true, \n will be escaped as \\n\n instead of just \\n |
Example usage:
Definition at line 50 of file escape_scalar.hpp.
|
inline |
Adjust a position in a scalar, increasing it to account for any escaped characters.
Definition at line 172 of file escape_scalar.hpp.
|
inline |
Escape a scalar to an existing buffer, using escape_scalar_fn.
Definition at line 241 of file escape_scalar.hpp.
References escape_scalar_fn().
|
inline |
formatting implementation to escape a scalar with escape_scalar()
Definition at line 264 of file escape_scalar.hpp.
References escape_scalar(), c4::yml::escaped_scalar::keep_newlines, and c4::yml::escaped_scalar::scalar.
| size_t c4::yml::dump | ( | SinkPfn && | sinkfn, |
| substr | buf, | ||
| escaped_scalar const & | e | ||
| ) |
dumping implementation to escape a scalar with escape_scalar_fn()
Definition at line 270 of file escape_scalar.hpp.
References escape_scalar_fn(), c4::yml::escaped_scalar::keep_newlines, and c4::yml::escaped_scalar::scalar.
| 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 | ||
| ) |
read the node members, overwriting existing vector entries.
Definition at line 26 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 | ||
| ) |
read the node members, overwriting existing vector entries.
specialization: std::vector<bool> uses std::vector<bool>::reference as the return value of its operator[].
Definition at line 41 of file vector.hpp.
References c4::yml::detail::RoNodeMethods< Impl, ConstImpl >::num_children().
| csubstr c4::yml::serialize_to_arena | ( | Tree * | tree, |
| csubstr | a | ||
| ) |
Definition at line 19 of file tree.cpp.
References NONE, and to_chars().
|
inline |
Definition at line 64 of file tree.hpp.
References to_chars_float().
|
inline |
Definition at line 84 of file tree.hpp.
References serialize_to_arena().
|
inline |
Definition at line 88 of file tree.hpp.
References serialize_to_arena(), and c4::to_csubstr().
|
inline |
|
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 1513 of file tree.hpp.
References from_chars_float().
|
inline |
convert the key of a scalar node to a floating point type, by forwarding its key 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 1543 of file tree.hpp.
References from_chars_float(), and key().
| 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 | ( | ) |