|
rapidyaml 0.15.2
parse and emit YAML, and do it fast
|
Classes | |
| struct | c4::yml::NodeType |
| wraps a NodeType_e element with some syntactic sugar and predicates More... | |
Typedefs | |
| using | c4::yml::type_bits = uint32_t |
| the integral type necessary to cover all the bits for NodeType_e | |
Enumerations | |
| enum | c4::yml::NodeType_e : type_bits { c4::yml::NOTYPE = 0 , c4::yml::KEY = __(0) , c4::yml::VAL = __(1) , c4::yml::MAP = __(2) , c4::yml::SEQ = __(3) , c4::yml::DOC = __(4) , c4::yml::STREAM = __(5)|SEQ , c4::yml::KEYREF = __(6) , c4::yml::VALREF = __(7) , c4::yml::KEYANCH = __(8) , c4::yml::VALANCH = __(9) , c4::yml::KEYTAG = __(10) , c4::yml::VALTAG = __(11) , c4::yml::KEYNIL = __(12) , c4::yml::VALNIL = __(13) , c4::yml::_TYMASK = __(14)-1 , c4::yml::KEY_UNFILT = __(14) , c4::yml::VAL_UNFILT = __(15) , c4::yml::FLOW_SL = __(16) , c4::yml::FLOW_ML1 = __(17) , c4::yml::FLOW_MLN = __(18) , c4::yml::FLOW_SPC = __(19) , c4::yml::BLOCK = __(20) , c4::yml::KEY_LITERAL = __(21) , c4::yml::VAL_LITERAL = __(22) , c4::yml::KEY_FOLDED = __(23) , c4::yml::VAL_FOLDED = __(24) , c4::yml::KEY_SQUO = __(25) , c4::yml::VAL_SQUO = __(26) , c4::yml::KEY_DQUO = __(27) , c4::yml::VAL_DQUO = __(28) , c4::yml::KEY_PLAIN = __(29) , c4::yml::VAL_PLAIN = __(30) , c4::yml::KEYVAL = KEY|VAL , c4::yml::KEYSEQ = KEY|SEQ , c4::yml::KEYMAP = KEY|MAP , c4::yml::DOCMAP = DOC|MAP , c4::yml::DOCSEQ = DOC|SEQ , c4::yml::DOCVAL = DOC|VAL , c4::yml::SCALAR_LITERAL = KEY_LITERAL|VAL_LITERAL , c4::yml::SCALAR_FOLDED = KEY_FOLDED|VAL_FOLDED , c4::yml::SCALAR_SQUO = KEY_SQUO|VAL_SQUO , c4::yml::SCALAR_DQUO = KEY_DQUO|VAL_DQUO , c4::yml::SCALAR_PLAIN = KEY_PLAIN|VAL_PLAIN , c4::yml::KEYQUO = KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL , c4::yml::VALQUO = VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL , c4::yml::KEY_STYLE = KEYQUO|KEY_PLAIN , c4::yml::VAL_STYLE = VALQUO|VAL_PLAIN , c4::yml::SCALAR_STYLE = KEY_STYLE|VAL_STYLE , c4::yml::FLOW_MLX = FLOW_ML1|FLOW_MLN , c4::yml::CONTAINER_STYLE_FLOW = FLOW_SL|FLOW_MLX|FLOW_SPC , c4::yml::CONTAINER_STYLE_BLOCK = BLOCK , c4::yml::CONTAINER_STYLE = CONTAINER_STYLE_FLOW|CONTAINER_STYLE_BLOCK , c4::yml::STYLE = SCALAR_STYLE | CONTAINER_STYLE } |
| a bit mask for marking node types and styles More... | |
Functions | |
| constexpr C4_CONST NodeType_e | c4::yml::operator| (NodeType_e lhs, NodeType_e rhs) noexcept |
| constexpr C4_CONST NodeType_e | c4::yml::operator& (NodeType_e lhs, NodeType_e rhs) noexcept |
| constexpr C4_CONST NodeType_e | c4::yml::operator>> (NodeType_e bits, uint32_t n) noexcept |
| constexpr C4_CONST NodeType_e | c4::yml::operator<< (NodeType_e bits, uint32_t n) noexcept |
| constexpr C4_CONST NodeType_e | c4::yml::operator~ (NodeType_e bits) noexcept |
| NodeType_e & | c4::yml::operator&= (NodeType_e &subject, NodeType_e bits) noexcept |
| NodeType_e & | c4::yml::operator|= (NodeType_e &subject, NodeType_e bits) noexcept |
scalar style helpers | |
| NodeType_e | c4::yml::scalar_style_choose_flow (csubstr scalar) noexcept |
| choose a YAML scalar style based on the scalar's contents, while in flow mode. | |
| NodeType_e | c4::yml::scalar_style_choose_block (csubstr scalar) noexcept |
| choose a YAML scalar style based on the scalar's contents, while in block mode. | |
| NodeType_e | c4::yml::scalar_style_choose (csubstr s, bool flow=true) noexcept |
| choose a YAML emitting style based on the scalar's contents. | |
| NodeType_e | c4::yml::scalar_style_choose_json (csubstr scalar) noexcept |
| choose a json scalar style based on the scalar's contents | |
| bool | c4::yml::scalar_style_query_squo (csubstr s) noexcept |
| query whether a scalar can be encoded using single quotes. | |
| bool | c4::yml::scalar_style_query_plain_flow (csubstr s) noexcept |
| query whether a scalar can be encoded using plain style while in flow mode. | |
| bool | c4::yml::scalar_style_query_plain_block (csubstr s) noexcept |
| query whether a scalar can be encoded using plain style while in block mode. | |
| bool | c4::yml::scalar_style_query_plain (csubstr s, bool flow=true) noexcept |
| query whether a scalar can be encoded using plain style. | |
| bool | c4::yml::scalar_is_null (csubstr s) noexcept |
| YAML-sense query of nullity. | |
| using c4::yml::type_bits = uint32_t |
the integral type necessary to cover all the bits for NodeType_e
Definition at line 30 of file node_type.hpp.
| enum c4::yml::NodeType_e : type_bits |
a bit mask for marking node types and styles
| Enumerator | |
|---|---|
| NOTYPE | no node type or style is set |
| KEY | the scalar to the left of : in a map's member |
| VAL | a scalar: has a scalar (ie string) value, possibly empty. must be a leaf node, and cannot be MAP or SEQ |
| MAP | a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes |
| SEQ | a seq: a parent of VAL/SEQ/MAP nodes |
| DOC | a document |
| STREAM | a stream: a seq of docs |
| KEYREF | a *reference: the key references an &anchor |
| VALREF | a *reference: the val references an &anchor |
| KEYANCH | the key has an &anchor |
| VALANCH | the val has an &anchor |
| KEYTAG | the key has a tag |
| VALTAG | the val has a tag |
| KEYNIL | the key is null (eg { : b} results in a null key) |
| VALNIL | the val is null (eg {a : } results in a null val) |
| _TYMASK | all the bits up to here |
| KEY_UNFILT | the key scalar was left unfiltered; the parser was set not to filter. |
| VAL_UNFILT | the val scalar was left unfiltered; the parser was set not to filter. |
| FLOW_SL | mark container with single-line flow style
|
| FLOW_ML1 | mark container with multi-line flow style, 1 element per line
|
| FLOW_MLN | mark container with multi-line flow style, n elements per line, wrapped (as set by EmitOptions::max_cols()):
|
| FLOW_SPC | mark container with spaces after comma when in flow mode. Applies to both FLOW_SL and FLOW_MLN (but not to FLOW_ML1), and can be overriden globally by EmitOptions::force_flow_spc(). |
| BLOCK | mark container with block style
|
| KEY_LITERAL | mark key scalar as multiline, block literal | |
| VAL_LITERAL | mark val scalar as multiline, block literal | |
| KEY_FOLDED | mark key scalar as multiline, block folded > |
| VAL_FOLDED | mark val scalar as multiline, block folded > |
| KEY_SQUO | mark key scalar as single quoted ' |
| VAL_SQUO | mark val scalar as single quoted ' |
| KEY_DQUO | mark key scalar as double quoted " |
| VAL_DQUO | mark val scalar as double quoted " |
| KEY_PLAIN | mark key scalar as plain scalar (unquoted, even when multiline) |
| VAL_PLAIN | mark val scalar as plain scalar (unquoted, even when multiline) |
| KEYVAL | |
| KEYSEQ | |
| KEYMAP | |
| DOCMAP | |
| DOCSEQ | |
| DOCVAL | |
| SCALAR_LITERAL | mask of KEY_LITERAL|VAL_LITERAL, |
| SCALAR_FOLDED | mask of KEY_FOLDED|VAL_FOLDED, |
| SCALAR_SQUO | |
| SCALAR_DQUO | |
| SCALAR_PLAIN | |
| KEYQUO | key style is one of '">|. mask of KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL |
| VALQUO | val style is one of '">|. mask of VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL |
| KEY_STYLE | mask of KEYQUO|KEY_PLAIN : all the key scalar styles for key (not container styles!) |
| VAL_STYLE | mask of VALQUO|VAL_PLAIN : all the val scalar styles for val (not container styles!) |
| SCALAR_STYLE | |
| FLOW_MLX | |
| CONTAINER_STYLE_FLOW | |
| CONTAINER_STYLE_BLOCK | alias to BLOCK |
| CONTAINER_STYLE | mask of CONTAINER_STYLE_FLOW|CONTAINER_STYLE_BLOCK : all container style flags |
| STYLE | mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags |
Definition at line 34 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 211 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 212 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 213 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 214 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 215 of file node_type.hpp.
|
inlinenoexcept |
Definition at line 216 of file node_type.hpp.
|
inlinenoexcept |
Definition at line 217 of file node_type.hpp.
|
noexcept |
choose a YAML scalar style based on the scalar's contents, while in flow mode.
Plain scalars [have more constraints in flow mode than in block mode](https://www.yaml.info/learn/quote.html#noplain). scalar_style_choose_block() is the block mode analogous function.
Definition at line 264 of file node_type.cpp.
|
noexcept |
choose a YAML scalar style based on the scalar's contents, while in block mode.
Plain scalars [have more constraints in flow mode than in block mode](https://www.yaml.info/learn/quote.html#noplain). scalar_style_choose_block() is the flow mode analogous function.
Definition at line 277 of file node_type.cpp.
|
inlinenoexcept |
choose a YAML emitting style based on the scalar's contents.
Legacy compatibility function: assumes flow mode which is more constraining, and delegates to either scalar_style_choose_flow() or scalar_style_choose_block().
Definition at line 388 of file node_type.hpp.
|
noexcept |
choose a json scalar style based on the scalar's contents
Definition at line 361 of file node_type.cpp.
|
noexcept |
query whether a scalar can be encoded using single quotes.
It may not be possible, notably when there is leading whitespace after a newline.
Definition at line 140 of file node_type.cpp.
|
noexcept |
query whether a scalar can be encoded using plain style while in flow mode.
Plain scalars [have more constraints in flow mode than in block mode](https://www.yaml.info/learn/quote.html#noplain). scalar_style_query_plain_block() is the block mode analogous function.
Definition at line 173 of file node_type.cpp.
|
noexcept |
query whether a scalar can be encoded using plain style while in block mode.
Plain scalars [have more constraints in flow mode than in block mode](https://www.yaml.info/learn/quote.html#noplain). scalar_style_query_plain_flow() is the flow mode analogous function.
Definition at line 221 of file node_type.cpp.
|
inlinenoexcept |
query whether a scalar can be encoded using plain style.
Legacy compatibility function: assumes flow mode which is more constraining, and delegates to either scalar_style_query_plain_flow() or scalar_style_query_plain_block().
Definition at line 427 of file node_type.hpp.
|
noexcept |
YAML-sense query of nullity.
returns true if the scalar points to nullptr or is otherwise equal to one of the strings "~","null","Null","NULL"
Definition at line 291 of file node_type.cpp.