|
rapidyaml
0.7.1
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 More... | |
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::_TYMASK = __(12)-1 , c4::yml::KEY_UNFILT = __(12) , c4::yml::VAL_UNFILT = __(13) , c4::yml::FLOW_SL = __(14) , c4::yml::FLOW_ML = __(15) , c4::yml::BLOCK = __(16) , c4::yml::KEY_LITERAL = __(17) , c4::yml::VAL_LITERAL = __(18) , c4::yml::KEY_FOLDED = __(19) , c4::yml::VAL_FOLDED = __(20) , c4::yml::KEY_SQUO = __(21) , c4::yml::VAL_SQUO = __(22) , c4::yml::KEY_DQUO = __(23) , c4::yml::VAL_DQUO = __(24) , c4::yml::KEY_PLAIN = __(25) , c4::yml::VAL_PLAIN = __(26) , 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 = KEY_LITERAL|KEY_FOLDED|KEY_SQUO|KEY_DQUO|KEY_PLAIN , c4::yml::VAL_STYLE = VAL_LITERAL|VAL_FOLDED|VAL_SQUO|VAL_DQUO|VAL_PLAIN , c4::yml::SCALAR_STYLE = KEY_STYLE|VAL_STYLE , c4::yml::CONTAINER_STYLE_FLOW = FLOW_SL|FLOW_ML , c4::yml::CONTAINER_STYLE_BLOCK = BLOCK , c4::yml::CONTAINER_STYLE = FLOW_SL|FLOW_ML|BLOCK , c4::yml::STYLE = SCALAR_STYLE | CONTAINER_STYLE , c4::yml::_KEYMASK = KEY | KEYQUO | KEYANCH | KEYREF | KEYTAG , c4::yml::_VALMASK = VAL | VALQUO | VALANCH | VALREF | VALTAG } |
| 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 (csubstr scalar) noexcept |
| choose a YAML emitting style based on the scalar's contents More... | |
| NodeType_e | c4::yml::scalar_style_json_choose (csubstr scalar) noexcept |
| choose a json style based on the scalar's contents More... | |
| bool | c4::yml::scalar_style_query_squo (csubstr s) noexcept |
| query whether a scalar can be encoded using single quotes. More... | |
| bool | c4::yml::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... | |
| bool | c4::yml::scalar_is_null (csubstr s) noexcept |
| YAML-sense query of nullity. More... | |
| using c4::yml::type_bits = typedef uint32_t |
the integral type necessary to cover all the bits for NodeType_e
Definition at line 26 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 | is member of a map, must have non-empty key |
| 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 |
| _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 (seqs as '[val1,val2], maps as '{key: val,key2: val2}') |
| FLOW_ML | (NOT IMPLEMENTED, work in progress) mark container with multi-line flow style (seqs as '[ |
| BLOCK | mark container with block style (seqs as '- val |
| 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 | |
| SCALAR_FOLDED | |
| SCALAR_SQUO | |
| SCALAR_DQUO | |
| SCALAR_PLAIN | |
| KEYQUO | key style is one of ', ", > or | |
| VALQUO | val style is one of ', ", > or | |
| KEY_STYLE | mask of all the scalar styles for key (not container styles!) |
| VAL_STYLE | mask of all the scalar styles for val (not container styles!) |
| SCALAR_STYLE | |
| CONTAINER_STYLE_FLOW | |
| CONTAINER_STYLE_BLOCK | |
| CONTAINER_STYLE | |
| STYLE | |
| _KEYMASK | |
| _VALMASK | |
Definition at line 30 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 100 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 101 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 102 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 103 of file node_type.hpp.
|
inlineconstexprnoexcept |
Definition at line 104 of file node_type.hpp.
|
inlinenoexcept |
Definition at line 105 of file node_type.hpp.
|
inlinenoexcept |
Definition at line 106 of file node_type.hpp.
|
noexcept |
choose a YAML emitting style based on the scalar's contents
Definition at line 169 of file node_type.cpp.
References c4::yml::SCALAR_DQUO, c4::yml::SCALAR_PLAIN, c4::yml::SCALAR_SQUO, c4::yml::scalar_style_query_plain(), and c4::yml::scalar_style_query_squo().
|
noexcept |
choose a json style based on the scalar's contents
Definition at line 189 of file node_type.cpp.
References c4::yml::npos, c4::yml::SCALAR_DQUO, and c4::yml::SCALAR_PLAIN.
|
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 141 of file node_type.cpp.
Referenced by c4::yml::scalar_style_choose().
|
noexcept |
query whether a scalar can be encoded using plain style (no quotes, not a literal/folded block scalar).
Definition at line 147 of file node_type.cpp.
References c4::yml::npos.
Referenced by c4::yml::scalar_style_choose().
|
inlinenoexcept |
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 251 of file node_type.hpp.
Referenced by c4::yml::Tree::key_is_null(), sample::sample_empty_null_values(), and c4::yml::Tree::val_is_null().