rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
Node types

Classes

struct  c4::yml::NodeType
 Wraps a type_bits mask of NodeTypeBits flags 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::NodeTypeBits : type_bits {
  c4::yml::NOTYPE = 0 , c4::yml::KEY = b_(0) , c4::yml::VAL = b_(1) , c4::yml::MAP = b_(2) ,
  c4::yml::SEQ = b_(3) , c4::yml::DOC = b_(4) , c4::yml::STREAM = b_(5)|SEQ , c4::yml::KEYREF = b_(6) ,
  c4::yml::VALREF = b_(7) , c4::yml::KEYANCH = b_(8) , c4::yml::VALANCH = b_(9) , c4::yml::KEYTAG = b_(10) ,
  c4::yml::VALTAG = b_(11) , c4::yml::KEYNIL = b_(12) , c4::yml::VALNIL = b_(13) , c4::yml::TYMASK_ = b_(14)-1 ,
  c4::yml::KEY_UNFILT = b_(14) , c4::yml::VAL_UNFILT = b_(15) , c4::yml::FLOW_SL = b_(16) , c4::yml::FLOW_ML1 = b_(17) ,
  c4::yml::FLOW_MLN = b_(18) , c4::yml::FLOW_SPC = b_(19) , c4::yml::BLOCK = b_(20) , c4::yml::KEY_LITERAL = b_(21) ,
  c4::yml::VAL_LITERAL = b_(22) , c4::yml::KEY_FOLDED = b_(23) , c4::yml::VAL_FOLDED = b_(24) , c4::yml::KEY_SQUO = b_(25) ,
  c4::yml::VAL_SQUO = b_(26) , c4::yml::KEY_DQUO = b_(27) , c4::yml::VAL_DQUO = b_(28) , c4::yml::KEY_PLAIN = b_(29) ,
  c4::yml::VAL_PLAIN = b_(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...

Detailed Description

Typedef Documentation

◆ type_bits

using c4::yml::type_bits = uint32_t

the integral type necessary to cover all the bits for NodeType_e

Definition at line 26 of file node_type.hpp.

Enumeration Type Documentation

◆ NodeTypeBits

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.

See also
ParserOptions::scalar_filtering()
VAL_UNFILT 

the val scalar was left unfiltered; the parser was set not to filter.

See also
ParserOptions::scalar_filtering()
FLOW_SL 

mark container with single-line flow style

FLOW_ML1 

mark container with multi-line flow style, 1 element per line

  • seqs as
    [
    val1,
    val2
    ]
  • maps as
    {
    key: val,
    key2: val2
    }
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

  • seqs as
    - val1
    - val2
  • maps as
    key1: val1
    key2: val2
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 

mask of KEY|VAL

KEYSEQ 

mask of KEY|SEQ

KEYMAP 

mask of KEY|MAP

DOCMAP 

mask of DOC|MAP

DOCSEQ 

mask of DOC|SEQ

DOCVAL 

mask of DOC|VAL

SCALAR_LITERAL 

mask of KEY_LITERAL|VAL_LITERAL,

SCALAR_FOLDED 

mask of KEY_FOLDED|VAL_FOLDED,

SCALAR_SQUO 

mask of KEY_SQUO|VAL_SQUO,

SCALAR_DQUO 

mask of KEY_DQUO|VAL_DQUO,

SCALAR_PLAIN 

mask of KEY_PLAIN|VAL_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 

mask of KEY_STYLE|VAL_STYLE : all the key+val scalar styles

FLOW_MLX 

mask of FLOW_ML1|FLOW_MLN : all the flow multiline styles

CONTAINER_STYLE_FLOW 

mask of FLOW_SL|FLOW_MLX|FLOW_SPC : all flow flags

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 30 of file node_type.hpp.

30 : type_bits { // NOLINT
31 #define b_(v) (type_bits(1) << v) // a convenience define, undefined below // NOLINT
32 NOTYPE = 0, ///< no node type or style is set
33 KEY = b_(0), ///< the scalar to the left of `:` in a map's member
34 VAL = b_(1), ///< a scalar: has a scalar (ie string) value, possibly empty. must be a leaf node, and cannot be MAP or SEQ
35 MAP = b_(2), ///< a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes
36 SEQ = b_(3), ///< a seq: a parent of VAL/SEQ/MAP nodes
37 DOC = b_(4), ///< a document
38 STREAM = b_(5)|SEQ, ///< a stream: a seq of docs
39 KEYREF = b_(6), ///< a *reference: the key references an &anchor
40 VALREF = b_(7), ///< a *reference: the val references an &anchor
41 KEYANCH = b_(8), ///< the key has an &anchor
42 VALANCH = b_(9), ///< the val has an &anchor
43 KEYTAG = b_(10), ///< the key has a tag
44 VALTAG = b_(11), ///< the val has a tag
45 KEYNIL = b_(12), ///< the key is null (eg `{ : b}` results in a null key)
46 VALNIL = b_(13), ///< the val is null (eg `{a : }` results in a null val)
47 TYMASK_ = b_(14)-1, ///< all the bits up to here
48 //
49 // unfiltered flags:
50 //
51 KEY_UNFILT = b_(14), ///< the key scalar was left unfiltered; the parser was set not to filter. @see @ref ParserOptions::scalar_filtering()
52 VAL_UNFILT = b_(15), ///< the val scalar was left unfiltered; the parser was set not to filter. @see @ref ParserOptions::scalar_filtering()
53 //
54 // style flags:
55 //
56 FLOW_SL = b_(16), ///< mark container with single-line flow style
57 ///< - seqs as
58 ///< @code{yaml}
59 ///< [val1,val2]
60 ///< @endcode
61 ///< when @ref FLOW_SPC is not set, or
62 ///< @code{yaml}
63 ///< [val1, val2]
64 ///< @endcode
65 ///< when @ref FLOW_SPC is set (or @ref EmitOptions::force_flow_spc() is set)
66 ///< - maps as
67 ///< @code{yaml}
68 ///< {key1: val1,key2: val2}
69 ///< @endcode
70 ///< when @ref FLOW_SPC is not set, or
71 ///< @code{yaml}
72 ///< {key1: val1, key2: val2}
73 ///< @endcode
74 ///< when @ref FLOW_SPC is set (or @ref EmitOptions::force_flow_spc() is set)
75 FLOW_ML1 = b_(17), ///< mark container with multi-line flow style, 1 element per line
76 ///< - seqs as
77 ///< @code{yaml}
78 ///< [
79 ///< val1,
80 ///< val2
81 ///< ]
82 ///< @endcode
83 ///< - maps as
84 ///< @code{yaml}
85 ///< {
86 ///< key: val,
87 ///< key2: val2
88 ///< }
89 ///< @endcode
90 FLOW_MLN = b_(18), ///< mark container with multi-line flow style, n elements per line,
91 ///< wrapped (as set by @ref EmitOptions::max_cols()):
92 ///< - seqs as
93 ///< @code{yaml}
94 ///< [
95 ///< val,val,...
96 ///< val,val,...
97 ///< val,val,...
98 ///< ...
99 ///< val
100 ///< ]
101 ///< @endcode
102 ///< when @ref FLOW_SPC is not set, or
103 ///< @code{yaml}
104 ///< [
105 ///< val, val,...
106 ///< val, val,...
107 ///< val, val,...
108 ///< ...
109 ///< val
110 ///< ]
111 ///< @endcode
112 ///< when @ref FLOW_SPC is set (or @ref EmitOptions::force_flow_spc() is set)
113 ///< - maps as
114 ///< @code{yaml}
115 ///< {
116 ///< key: val,key: val,...
117 ///< key: val,key: val,...
118 ///< ...
119 ///< key: val
120 ///< }
121 ///< @endcode
122 ///< when @ref FLOW_SPC is not set, or
123 ///< @code{yaml}
124 ///< {
125 ///< key: val, key: val,...
126 ///< key: val, key: val,...
127 ///< ...
128 ///< key: val
129 ///< }
130 ///< @endcode
131 ///< when @ref FLOW_SPC is set (or @ref EmitOptions::force_flow_spc() is set)
132 FLOW_SPC = b_(19), ///< mark container with spaces after comma when in flow mode.
133 ///< Applies to both @ref FLOW_SL and @ref FLOW_MLN (but not
134 ///< to @ref FLOW_ML1), and can be overriden globally by
135 ///< @ref EmitOptions::force_flow_spc().
136 BLOCK = b_(20), ///< mark container with block style
137 ///< - seqs as
138 ///< @code{yaml}
139 ///< - val1
140 ///< - val2
141 ///< @endcode
142 ///< - maps as
143 ///< @code{yaml}
144 ///< key1: val1
145 ///< key2: val2
146 ///< @endcode
147 KEY_LITERAL = b_(21), ///< mark key scalar as multiline, block literal |
148 VAL_LITERAL = b_(22), ///< mark val scalar as multiline, block literal |
149 KEY_FOLDED = b_(23), ///< mark key scalar as multiline, block folded >
150 VAL_FOLDED = b_(24), ///< mark val scalar as multiline, block folded >
151 KEY_SQUO = b_(25), ///< mark key scalar as single quoted '
152 VAL_SQUO = b_(26), ///< mark val scalar as single quoted '
153 KEY_DQUO = b_(27), ///< mark key scalar as double quoted "
154 VAL_DQUO = b_(28), ///< mark val scalar as double quoted "
155 KEY_PLAIN = b_(29), ///< mark key scalar as plain scalar (unquoted, even when multiline)
156 VAL_PLAIN = b_(30), ///< mark val scalar as plain scalar (unquoted, even when multiline)
157 //
158 // type combination masks:
159 //
160 KEYVAL = KEY|VAL, ///< mask of @ref KEY|@ref VAL
161 KEYSEQ = KEY|SEQ, ///< mask of @ref KEY|@ref SEQ
162 KEYMAP = KEY|MAP, ///< mask of @ref KEY|@ref MAP
163 DOCMAP = DOC|MAP, ///< mask of @ref DOC|@ref MAP
164 DOCSEQ = DOC|SEQ, ///< mask of @ref DOC|@ref SEQ
165 DOCVAL = DOC|VAL, ///< mask of @ref DOC|@ref VAL
166 //
167 // style combination masks:
168 //
169 SCALAR_LITERAL = KEY_LITERAL|VAL_LITERAL, ///< mask of @ref KEY_LITERAL|@ref VAL_LITERAL,
170 SCALAR_FOLDED = KEY_FOLDED|VAL_FOLDED, ///< mask of @ref KEY_FOLDED|@ref VAL_FOLDED,
171 SCALAR_SQUO = KEY_SQUO|VAL_SQUO, ///< mask of @ref KEY_SQUO|@ref VAL_SQUO,
172 SCALAR_DQUO = KEY_DQUO|VAL_DQUO, ///< mask of @ref KEY_DQUO|@ref VAL_DQUO,
173 SCALAR_PLAIN = KEY_PLAIN|VAL_PLAIN, ///< mask of @ref KEY_PLAIN|@ref VAL_PLAIN,
174 KEYQUO = KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL, ///< key style is one of `'">|`. mask of @ref KEY_SQUO|@ref KEY_DQUO|@ref KEY_FOLDED|@ref KEY_LITERAL
175 VALQUO = VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL, ///< val style is one of `'">|`. mask of @ref VAL_SQUO|@ref VAL_DQUO|@ref VAL_FOLDED|@ref VAL_LITERAL
176 KEY_STYLE = KEYQUO|KEY_PLAIN, ///< mask of @ref KEYQUO|@ref KEY_PLAIN : all the key scalar styles for key (not container styles!)
177 VAL_STYLE = VALQUO|VAL_PLAIN, ///< mask of @ref VALQUO|@ref VAL_PLAIN : all the val scalar styles for val (not container styles!)
178 SCALAR_STYLE = KEY_STYLE|VAL_STYLE, ///< mask of @ref KEY_STYLE|@ref VAL_STYLE : all the key+val scalar styles
179 FLOW_MLX = FLOW_ML1|FLOW_MLN, ///< mask of @ref FLOW_ML1|@ref FLOW_MLN : all the flow multiline styles
180 CONTAINER_STYLE_FLOW = FLOW_SL|FLOW_MLX|FLOW_SPC, ///< mask of @ref FLOW_SL|@ref FLOW_MLX|@ref FLOW_SPC : all flow flags
181 CONTAINER_STYLE_BLOCK = BLOCK, ///< alias to @ref BLOCK
182 CONTAINER_STYLE = CONTAINER_STYLE_FLOW|CONTAINER_STYLE_BLOCK, ///< mask of @ref CONTAINER_STYLE_FLOW|@ref CONTAINER_STYLE_BLOCK : all container style flags
183 STYLE = SCALAR_STYLE | CONTAINER_STYLE, ///< mask of @ref SCALAR_STYLE | @ref CONTAINER_STYLE : all style flags
184 //
185 // mixed masks
186 /** @cond dev */
187 KEYMASK_ = KEY | KEYQUO | KEYANCH | KEYREF | KEYTAG,
188 VALMASK_ = VAL | VALQUO | VALANCH | VALREF | VALTAG,
189 #undef b_
190 #ifdef RYML_HAS_DEPRECATED_ENUMS_
191 FLOW_ML RYML_DEPRECATED("use one of FLOW_ML{1,N,X}") = FLOW_ML1,
192 #endif
193 /** @endcond */
NodeTypeBits
a bit mask for marking node types and styles
Definition node_type.hpp:30
uint32_t type_bits
the integral type necessary to cover all the bits for NodeType_e
Definition node_type.hpp:26
@ VALANCH
the val has an &anchor
Definition node_type.hpp:42
@ NOTYPE
no node type or style is set
Definition node_type.hpp:32
@ SCALAR_FOLDED
mask of KEY_FOLDED|VAL_FOLDED,
@ TYMASK_
all the bits up to here
Definition node_type.hpp:47
@ KEY_DQUO
mark key scalar as double quoted "
@ VALREF
a *reference: the val references an &anchor
Definition node_type.hpp:40
@ VALNIL
the val is null (eg {a : } results in a null val)
Definition node_type.hpp:46
@ MAP
a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes
Definition node_type.hpp:35
@ FLOW_MLX
mask of FLOW_ML1|FLOW_MLN : all the flow multiline styles
@ STREAM
a stream: a seq of docs
Definition node_type.hpp:38
@ KEY
the scalar to the left of : in a map's member
Definition node_type.hpp:33
@ KEYQUO
key style is one of '">|. mask of KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL
@ FLOW_ML1
mark container with multi-line flow style, 1 element per line
Definition node_type.hpp:75
@ VAL_FOLDED
mark val scalar as multiline, block folded >
@ CONTAINER_STYLE_BLOCK
alias to BLOCK
@ VAL_STYLE
mask of VALQUO|VAL_PLAIN : all the val scalar styles for val (not container styles!...
@ KEYTAG
the key has a tag
Definition node_type.hpp:43
@ CONTAINER_STYLE_FLOW
mask of FLOW_SL|FLOW_MLX|FLOW_SPC : all flow flags
@ SCALAR_SQUO
mask of KEY_SQUO|VAL_SQUO,
@ FLOW_SL
mark container with single-line flow style
Definition node_type.hpp:56
@ VAL_UNFILT
the val scalar was left unfiltered; the parser was set not to filter.
Definition node_type.hpp:52
@ VAL
a scalar: has a scalar (ie string) value, possibly empty. must be a leaf node, and cannot be MAP or S...
Definition node_type.hpp:34
@ KEYMAP
mask of KEY|MAP
@ VALTAG
the val has a tag
Definition node_type.hpp:44
@ SCALAR_STYLE
mask of KEY_STYLE|VAL_STYLE : all the key+val scalar styles
@ KEYSEQ
mask of KEY|SEQ
@ FLOW_MLN
mark container with multi-line flow style, n elements per line, wrapped (as set by EmitOptions::max_c...
Definition node_type.hpp:90
@ SCALAR_LITERAL
mask of KEY_LITERAL|VAL_LITERAL,
@ SEQ
a seq: a parent of VAL/SEQ/MAP nodes
Definition node_type.hpp:36
@ SCALAR_DQUO
mask of KEY_DQUO|VAL_DQUO,
@ VAL_SQUO
mark val scalar as single quoted '
@ DOCSEQ
mask of DOC|SEQ
@ KEY_STYLE
mask of KEYQUO|KEY_PLAIN : all the key scalar styles for key (not container styles!...
@ VAL_PLAIN
mark val scalar as plain scalar (unquoted, even when multiline)
@ KEYREF
a *reference: the key references an &anchor
Definition node_type.hpp:39
@ DOCMAP
mask of DOC|MAP
@ BLOCK
mark container with block style
@ FLOW_SPC
mark container with spaces after comma when in flow mode. Applies to both FLOW_SL and FLOW_MLN (but n...
@ DOCVAL
mask of DOC|VAL
@ STYLE
mask of SCALAR_STYLE | CONTAINER_STYLE : all style flags
@ KEYVAL
mask of KEY|VAL
@ KEYANCH
the key has an &anchor
Definition node_type.hpp:41
@ VALQUO
val style is one of '">|. mask of VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL
@ VAL_DQUO
mark val scalar as double quoted "
@ CONTAINER_STYLE
mask of CONTAINER_STYLE_FLOW|CONTAINER_STYLE_BLOCK : all container style flags
@ KEY_UNFILT
the key scalar was left unfiltered; the parser was set not to filter.
Definition node_type.hpp:51
@ KEY_SQUO
mark key scalar as single quoted '
@ VAL_LITERAL
mark val scalar as multiline, block literal |
@ KEY_LITERAL
mark key scalar as multiline, block literal |
@ KEY_PLAIN
mark key scalar as plain scalar (unquoted, even when multiline)
@ SCALAR_PLAIN
mask of KEY_PLAIN|VAL_PLAIN,
@ KEY_FOLDED
mark key scalar as multiline, block folded >
@ KEYNIL
the key is null (eg { : b} results in a null key)
Definition node_type.hpp:45
@ DOC
a document
Definition node_type.hpp:37
#define b_(v)
Definition node_type.hpp:31