rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
c4::yml::NodeType Struct Reference

wraps a NodeType_e element with some syntactic sugar and predicates More...

#include <node_type.hpp>

Public Member Functions

 NodeType () noexcept
 NodeType (NodeType_e t) noexcept
 NodeType (type_bits t) noexcept
bool has_any (NodeType_e t) const noexcept
bool has_all (NodeType_e t) const noexcept
bool has_none (NodeType_e t) const noexcept
void set (NodeType_e t) noexcept
void add (NodeType_e t) noexcept
void rem (NodeType_e t) noexcept
void addrem (NodeType_e bits_to_add, NodeType_e bits_to_remove) noexcept
void clear () noexcept
 operator NodeType_e & () noexcept
 operator NodeType_e const & () const noexcept
style functions
bool is_container_styled () const noexcept
bool is_block () const noexcept
bool is_flow_sl () const noexcept
bool is_flow_ml1 () const noexcept
bool is_flow_mln () const noexcept
bool is_flow_mlx () const noexcept
bool is_flow () const noexcept
bool has_flow_space () const noexcept
bool is_key_styled () const noexcept
bool is_val_styled () const noexcept
bool is_key_literal () const noexcept
bool is_val_literal () const noexcept
bool is_key_folded () const noexcept
bool is_val_folded () const noexcept
bool is_key_squo () const noexcept
bool is_val_squo () const noexcept
bool is_key_dquo () const noexcept
bool is_val_dquo () const noexcept
bool is_key_plain () const noexcept
bool is_val_plain () const noexcept
bool is_key_quoted () const noexcept
bool is_val_quoted () const noexcept
bool is_quoted () const noexcept
NodeType key_style () const noexcept
NodeType val_style () const noexcept
void set_container_style (NodeType_e style) noexcept
void set_key_style (NodeType_e style) noexcept
void set_val_style (NodeType_e style) noexcept
void clear_style () noexcept

Public Attributes

NodeType_e type

node type queries

const char * type_str () const noexcept
 return a preset string based on the node type
size_t type_str (substr buf) const noexcept
 fill a string with the node type flags.
csubstr type_str_sub (substr buf) const noexcept
 fill a string with the node type flags.
bool is_notype () const noexcept
bool is_stream () const noexcept
bool is_doc () const noexcept
bool is_container () const noexcept
bool is_map () const noexcept
bool is_seq () const noexcept
bool has_key () const noexcept
bool has_val () const noexcept
bool is_val () const noexcept
bool is_keyval () const noexcept
bool key_is_null () const noexcept
bool val_is_null () const noexcept
bool has_key_tag () const noexcept
bool has_val_tag () const noexcept
bool has_key_anchor () const noexcept
bool has_val_anchor () const noexcept
bool has_anchor () const noexcept
bool is_key_ref () const noexcept
bool is_val_ref () const noexcept
bool is_ref () const noexcept
bool is_key_unfiltered () const noexcept
bool is_val_unfiltered () const noexcept
static const char * type_str (NodeType_e t) noexcept
 return a preset string based on the node type
static size_t type_str (substr buf, NodeType_e t) noexcept
 fill a string with the node type flags.
static csubstr type_str_sub (substr buf, NodeType_e t) noexcept
 fill a string with the node type flags.

Detailed Description

wraps a NodeType_e element with some syntactic sugar and predicates

Definition at line 225 of file node_type.hpp.

Constructor & Destructor Documentation

◆ NodeType() [1/3]

c4::yml::NodeType::NodeType ( )
inlinenoexcept

Definition at line 233 of file node_type.hpp.

233: type(NOTYPE) {}
@ NOTYPE
no node type or style is set
Definition node_type.hpp:36

◆ NodeType() [2/3]

c4::yml::NodeType::NodeType ( NodeType_e t)
inlinenoexcept

Definition at line 234 of file node_type.hpp.

234: type(t) {}

◆ NodeType() [3/3]

c4::yml::NodeType::NodeType ( type_bits t)
inlinenoexcept

Definition at line 235 of file node_type.hpp.

235: type((NodeType_e)t) {}
NodeType_e
a bit mask for marking node types and styles
Definition node_type.hpp:34

Member Function Documentation

◆ has_any()

bool c4::yml::NodeType::has_any ( NodeType_e t) const
inlinenoexcept

Definition at line 237 of file node_type.hpp.

237{ return (type & t) != 0u; }

◆ has_all()

bool c4::yml::NodeType::has_all ( NodeType_e t) const
inlinenoexcept

Definition at line 238 of file node_type.hpp.

238{ return (type & t) == t; }

◆ has_none()

bool c4::yml::NodeType::has_none ( NodeType_e t) const
inlinenoexcept

Definition at line 239 of file node_type.hpp.

239{ return (type & t) == 0; }

◆ set()

void c4::yml::NodeType::set ( NodeType_e t)
inlinenoexcept

Definition at line 241 of file node_type.hpp.

241{ type = t; }

◆ add()

void c4::yml::NodeType::add ( NodeType_e t)
inlinenoexcept

Definition at line 242 of file node_type.hpp.

242{ type = (type|t); }

◆ rem()

void c4::yml::NodeType::rem ( NodeType_e t)
inlinenoexcept

Definition at line 243 of file node_type.hpp.

243{ type = (type & ~t); }

◆ addrem()

void c4::yml::NodeType::addrem ( NodeType_e bits_to_add,
NodeType_e bits_to_remove )
inlinenoexcept

Definition at line 244 of file node_type.hpp.

244{ type |= bits_to_add; type &= ~bits_to_remove; }

◆ clear()

void c4::yml::NodeType::clear ( )
inlinenoexcept

Definition at line 246 of file node_type.hpp.

246{ type = NOTYPE; }

◆ operator NodeType_e &()

c4::yml::NodeType::operator NodeType_e & ( )
inlinenoexcept

Definition at line 250 of file node_type.hpp.

250{ return type; }

◆ operator NodeType_e const &()

c4::yml::NodeType::operator NodeType_e const & ( ) const
inlinenoexcept

Definition at line 251 of file node_type.hpp.

251{ return type; }

◆ type_str() [1/4]

const char * c4::yml::NodeType::type_str ( ) const
inlinenoexcept

return a preset string based on the node type

Definition at line 259 of file node_type.hpp.

259{ return type_str(type); }
const char * type_str() const noexcept
return a preset string based on the node type

◆ type_str() [2/4]

const char * c4::yml::NodeType::type_str ( NodeType_e t)
staticnoexcept

return a preset string based on the node type

Definition at line 12 of file node_type.cpp.

13{
14 switch(ty & _TYMASK)
15 {
16 case KEYVAL:
17 return "KEYVAL";
18 case KEY:
19 return "KEY";
20 case VAL:
21 return "VAL";
22 case MAP:
23 return "MAP";
24 case SEQ:
25 return "SEQ";
26 case KEYMAP:
27 return "KEYMAP";
28 case KEYSEQ:
29 return "KEYSEQ";
30 case DOCSEQ:
31 return "DOCSEQ";
32 case DOCMAP:
33 return "DOCMAP";
34 case DOCVAL:
35 return "DOCVAL";
36 case DOC:
37 return "DOC";
38 case STREAM:
39 return "STREAM";
40 case NOTYPE:
41 return "NOTYPE";
42 default:
43 if((ty & KEYVAL) == KEYVAL)
44 return "KEYVAL***";
45 if((ty & KEYMAP) == KEYMAP)
46 return "KEYMAP***";
47 if((ty & KEYSEQ) == KEYSEQ)
48 return "KEYSEQ***";
49 if((ty & DOCSEQ) == DOCSEQ)
50 return "DOCSEQ***";
51 if((ty & DOCMAP) == DOCMAP)
52 return "DOCMAP***";
53 if((ty & DOCVAL) == DOCVAL)
54 return "DOCVAL***";
55 if(ty & KEY)
56 return "KEY***";
57 if(ty & VAL)
58 return "VAL***";
59 if(ty & MAP)
60 return "MAP***";
61 if(ty & SEQ)
62 return "SEQ***";
63 if(ty & DOC)
64 return "DOC***";
65 return "(unk)";
66 }
67}
@ MAP
a map: a parent of KEYVAL/KEYSEQ/KEYMAP nodes
Definition node_type.hpp:39
@ STREAM
a stream: a seq of docs
Definition node_type.hpp:42
@ KEY
the scalar to the left of : in a map's member
Definition node_type.hpp:37
@ 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:38
@ KEYMAP
mask of KEY|MAP
@ KEYSEQ
mask of KEY|SEQ
@ _TYMASK
all the bits up to here
Definition node_type.hpp:51
@ SEQ
a seq: a parent of VAL/SEQ/MAP nodes
Definition node_type.hpp:40
@ DOCSEQ
mask of DOC|SEQ
@ DOCMAP
mask of DOC|MAP
@ DOCVAL
mask of DOC|VAL
@ KEYVAL
mask of KEY|VAL
@ DOC
a document
Definition node_type.hpp:41

◆ type_str() [3/4]

size_t c4::yml::NodeType::type_str ( substr buf) const
inlinenoexcept

fill a string with the node type flags.

Definition at line 264 of file node_type.hpp.

264{ return type_str(buf, type); }

◆ type_str() [4/4]

size_t c4::yml::NodeType::type_str ( substr buf,
NodeType_e t )
staticnoexcept

fill a string with the node type flags.

Definition at line 69 of file node_type.cpp.

70{
71 size_t pos = 0;
72 bool gotone = false;
73
74 #define _prflag(fl, txt) \
75 do { \
76 if((flags & (fl)) == (fl)) \
77 { \
78 if(gotone) \
79 { \
80 if(pos + 1 < buf.len) \
81 buf[pos] = '|'; \
82 ++pos; \
83 } \
84 csubstr fltxt = txt; \
85 if(pos + fltxt.len <= buf.len) \
86 memcpy(buf.str + pos, fltxt.str, fltxt.len); \
87 pos += fltxt.len; \
88 gotone = true; \
89 flags = (flags & ~(fl)); /*remove the flag*/ \
90 } \
91 } while(0)
92
93 _prflag(STREAM, "STREAM");
94 _prflag(DOC, "DOC");
95 // key properties
96 _prflag(KEY, "KEY");
97 _prflag(KEYNIL, "KNIL");
98 _prflag(KEYTAG, "KTAG");
99 _prflag(KEYANCH, "KANCH");
100 _prflag(KEYREF, "KREF");
101 _prflag(KEY_LITERAL, "KLITERAL");
102 _prflag(KEY_FOLDED, "KFOLDED");
103 _prflag(KEY_SQUO, "KSQUO");
104 _prflag(KEY_DQUO, "KDQUO");
105 _prflag(KEY_PLAIN, "KPLAIN");
106 _prflag(KEY_UNFILT, "KUNFILT");
107 // val properties
108 _prflag(VAL, "VAL");
109 _prflag(VALNIL, "VNIL");
110 _prflag(VALTAG, "VTAG");
111 _prflag(VALANCH, "VANCH");
112 _prflag(VALREF, "VREF");
113 _prflag(VAL_UNFILT, "VUNFILT");
114 _prflag(VAL_LITERAL, "VLITERAL");
115 _prflag(VAL_FOLDED, "VFOLDED");
116 _prflag(VAL_SQUO, "VSQUO");
117 _prflag(VAL_DQUO, "VDQUO");
118 _prflag(VAL_PLAIN, "VPLAIN");
119 _prflag(VAL_UNFILT, "VUNFILT");
120 // container properties
121 _prflag(MAP, "MAP");
122 _prflag(SEQ, "SEQ");
123 _prflag(FLOW_SL, "FLOWSL");
124 _prflag(FLOW_ML1, "FLOWML1");
125 _prflag(FLOW_MLN, "FLOWMLN");
126 _prflag(FLOW_SPC, "FLOWSPC");
127 _prflag(BLOCK, "BLCK");
128 if(pos == 0)
129 _prflag(NOTYPE, "NOTYPE");
130
131 #undef _prflag
132
133 return pos;
134}
@ VALANCH
the val has an &anchor
Definition node_type.hpp:46
@ KEY_DQUO
mark key scalar as double quoted "
@ VALREF
a *reference: the val references an &anchor
Definition node_type.hpp:44
@ VALNIL
the val is null (eg {a : } results in a null val)
Definition node_type.hpp:50
@ FLOW_ML1
mark container with multi-line flow style, 1 element per line
Definition node_type.hpp:79
@ VAL_FOLDED
mark val scalar as multiline, block folded >
@ KEYTAG
the key has a tag
Definition node_type.hpp:47
@ FLOW_SL
mark container with single-line flow style
Definition node_type.hpp:60
@ VAL_UNFILT
the val scalar was left unfiltered; the parser was set not to filter.
Definition node_type.hpp:56
@ VALTAG
the val has a tag
Definition node_type.hpp:48
@ FLOW_MLN
mark container with multi-line flow style, n elements per line, wrapped (as set by EmitOptions::max_c...
Definition node_type.hpp:94
@ VAL_SQUO
mark val scalar as single quoted '
@ VAL_PLAIN
mark val scalar as plain scalar (unquoted, even when multiline)
@ KEYREF
a *reference: the key references an &anchor
Definition node_type.hpp:43
@ 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...
@ KEYANCH
the key has an &anchor
Definition node_type.hpp:45
@ VAL_DQUO
mark val scalar as double quoted "
@ KEY_UNFILT
the key scalar was left unfiltered; the parser was set not to filter.
Definition node_type.hpp:55
@ 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)
@ 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:49
#define _prflag(fl, txt)

◆ type_str_sub() [1/2]

csubstr c4::yml::NodeType::type_str_sub ( substr buf) const
inlinenoexcept

fill a string with the node type flags.

If the string is small, returns {null, len}

Definition at line 269 of file node_type.hpp.

269{ return type_str_sub(buf, type); }
csubstr type_str_sub(substr buf) const noexcept
fill a string with the node type flags.

◆ type_str_sub() [2/2]

csubstr c4::yml::NodeType::type_str_sub ( substr buf,
NodeType_e t )
inlinestaticnoexcept

fill a string with the node type flags.

If the string is small, returns {null, len}

Definition at line 271 of file node_type.hpp.

272 {
273 csubstr ret;
274 ret.len = type_str(buf, t);
275 ret.str = ret.len < buf.len ? buf.str : nullptr;
276 return ret;
277 }
basic_substring< const char > csubstr
an immutable string view
Definition substr.hpp:2357
size_t len
the length of the substring
Definition substr.hpp:218

◆ is_notype()

bool c4::yml::NodeType::is_notype ( ) const
inlinenoexcept

Definition at line 284 of file node_type.hpp.

284{ return type == NOTYPE; }

◆ is_stream()

bool c4::yml::NodeType::is_stream ( ) const
inlinenoexcept

Definition at line 285 of file node_type.hpp.

285{ return ((type & STREAM) == STREAM) != 0; }

◆ is_doc()

bool c4::yml::NodeType::is_doc ( ) const
inlinenoexcept

Definition at line 286 of file node_type.hpp.

286{ return (type & DOC) != 0; }

◆ is_container()

bool c4::yml::NodeType::is_container ( ) const
inlinenoexcept

Definition at line 287 of file node_type.hpp.

287{ return (type & (MAP|SEQ|STREAM)) != 0; }

◆ is_map()

bool c4::yml::NodeType::is_map ( ) const
inlinenoexcept

Definition at line 288 of file node_type.hpp.

288{ return (type & MAP) != 0; }

◆ is_seq()

bool c4::yml::NodeType::is_seq ( ) const
inlinenoexcept

Definition at line 289 of file node_type.hpp.

289{ return (type & SEQ) != 0; }

◆ has_key()

bool c4::yml::NodeType::has_key ( ) const
inlinenoexcept

Definition at line 290 of file node_type.hpp.

290{ return (type & KEY) != 0; }

◆ has_val()

bool c4::yml::NodeType::has_val ( ) const
inlinenoexcept

Definition at line 291 of file node_type.hpp.

291{ return (type & VAL) != 0; }

◆ is_val()

bool c4::yml::NodeType::is_val ( ) const
inlinenoexcept

Definition at line 292 of file node_type.hpp.

292{ return (type & KEYVAL) == VAL; }

◆ is_keyval()

bool c4::yml::NodeType::is_keyval ( ) const
inlinenoexcept

Definition at line 293 of file node_type.hpp.

293{ return (type & KEYVAL) == KEYVAL; }

◆ key_is_null()

bool c4::yml::NodeType::key_is_null ( ) const
inlinenoexcept

Definition at line 294 of file node_type.hpp.

294{ return (type & KEYNIL) != 0; }

◆ val_is_null()

bool c4::yml::NodeType::val_is_null ( ) const
inlinenoexcept

Definition at line 295 of file node_type.hpp.

295{ return (type & VALNIL) != 0; }

◆ has_key_tag()

bool c4::yml::NodeType::has_key_tag ( ) const
inlinenoexcept

Definition at line 296 of file node_type.hpp.

296{ return (type & KEYTAG) != 0; }

◆ has_val_tag()

bool c4::yml::NodeType::has_val_tag ( ) const
inlinenoexcept

Definition at line 297 of file node_type.hpp.

297{ return (type & VALTAG) != 0; }

◆ has_key_anchor()

bool c4::yml::NodeType::has_key_anchor ( ) const
inlinenoexcept

Definition at line 298 of file node_type.hpp.

298{ return (type & KEYANCH) != 0; }

◆ has_val_anchor()

bool c4::yml::NodeType::has_val_anchor ( ) const
inlinenoexcept

Definition at line 299 of file node_type.hpp.

299{ return (type & VALANCH) != 0; }

◆ has_anchor()

bool c4::yml::NodeType::has_anchor ( ) const
inlinenoexcept

Definition at line 300 of file node_type.hpp.

300{ return (type & (KEYANCH|VALANCH)) != 0; }

◆ is_key_ref()

bool c4::yml::NodeType::is_key_ref ( ) const
inlinenoexcept

Definition at line 301 of file node_type.hpp.

301{ return (type & KEYREF) != 0; }

◆ is_val_ref()

bool c4::yml::NodeType::is_val_ref ( ) const
inlinenoexcept

Definition at line 302 of file node_type.hpp.

302{ return (type & VALREF) != 0; }

◆ is_ref()

bool c4::yml::NodeType::is_ref ( ) const
inlinenoexcept

Definition at line 303 of file node_type.hpp.

303{ return (type & (KEYREF|VALREF)) != 0; }

◆ is_key_unfiltered()

bool c4::yml::NodeType::is_key_unfiltered ( ) const
inlinenoexcept

Definition at line 305 of file node_type.hpp.

305{ return (type & (KEY_UNFILT)) != 0; }

◆ is_val_unfiltered()

bool c4::yml::NodeType::is_val_unfiltered ( ) const
inlinenoexcept

Definition at line 306 of file node_type.hpp.

306{ return (type & (VAL_UNFILT)) != 0; }

◆ is_container_styled()

bool c4::yml::NodeType::is_container_styled ( ) const
inlinenoexcept

Definition at line 315 of file node_type.hpp.

315{ return (type & (CONTAINER_STYLE)) != 0; }
@ CONTAINER_STYLE
mask of CONTAINER_STYLE_FLOW|CONTAINER_STYLE_BLOCK : all container style flags

◆ is_block()

bool c4::yml::NodeType::is_block ( ) const
inlinenoexcept

Definition at line 316 of file node_type.hpp.

316{ return (type & (BLOCK)) != 0; }

◆ is_flow_sl()

bool c4::yml::NodeType::is_flow_sl ( ) const
inlinenoexcept

Definition at line 317 of file node_type.hpp.

317{ return (type & (FLOW_SL)) != 0; }

◆ is_flow_ml1()

bool c4::yml::NodeType::is_flow_ml1 ( ) const
inlinenoexcept

Definition at line 318 of file node_type.hpp.

318{ return (type & (FLOW_ML1)) != 0; }

◆ is_flow_mln()

bool c4::yml::NodeType::is_flow_mln ( ) const
inlinenoexcept

Definition at line 319 of file node_type.hpp.

319{ return (type & (FLOW_MLN)) != 0; }

◆ is_flow_mlx()

bool c4::yml::NodeType::is_flow_mlx ( ) const
inlinenoexcept

Definition at line 320 of file node_type.hpp.

320{ return (type & (FLOW_ML1|FLOW_MLN)) != 0; }

◆ is_flow()

bool c4::yml::NodeType::is_flow ( ) const
inlinenoexcept

Definition at line 321 of file node_type.hpp.

321{ return (type & (FLOW_ML1|FLOW_MLN|FLOW_SL)) != 0; }

◆ has_flow_space()

bool c4::yml::NodeType::has_flow_space ( ) const
inlinenoexcept

Definition at line 322 of file node_type.hpp.

322{ return (type & (FLOW_SPC)) != 0; }

◆ is_key_styled()

bool c4::yml::NodeType::is_key_styled ( ) const
inlinenoexcept

Definition at line 324 of file node_type.hpp.

324{ return (type & (KEY_STYLE)) != 0; }
@ KEY_STYLE
mask of KEYQUO|KEY_PLAIN : all the key scalar styles for key (not container styles!...

◆ is_val_styled()

bool c4::yml::NodeType::is_val_styled ( ) const
inlinenoexcept

Definition at line 325 of file node_type.hpp.

325{ return (type & (VAL_STYLE)) != 0; }
@ VAL_STYLE
mask of VALQUO|VAL_PLAIN : all the val scalar styles for val (not container styles!...

◆ is_key_literal()

bool c4::yml::NodeType::is_key_literal ( ) const
inlinenoexcept

Definition at line 326 of file node_type.hpp.

326{ return (type & (KEY_LITERAL)) != 0; }

◆ is_val_literal()

bool c4::yml::NodeType::is_val_literal ( ) const
inlinenoexcept

Definition at line 327 of file node_type.hpp.

327{ return (type & (VAL_LITERAL)) != 0; }

◆ is_key_folded()

bool c4::yml::NodeType::is_key_folded ( ) const
inlinenoexcept

Definition at line 328 of file node_type.hpp.

328{ return (type & (KEY_FOLDED)) != 0; }

◆ is_val_folded()

bool c4::yml::NodeType::is_val_folded ( ) const
inlinenoexcept

Definition at line 329 of file node_type.hpp.

329{ return (type & (VAL_FOLDED)) != 0; }

◆ is_key_squo()

bool c4::yml::NodeType::is_key_squo ( ) const
inlinenoexcept

Definition at line 330 of file node_type.hpp.

330{ return (type & (KEY_SQUO)) != 0; }

◆ is_val_squo()

bool c4::yml::NodeType::is_val_squo ( ) const
inlinenoexcept

Definition at line 331 of file node_type.hpp.

331{ return (type & (VAL_SQUO)) != 0; }

◆ is_key_dquo()

bool c4::yml::NodeType::is_key_dquo ( ) const
inlinenoexcept

Definition at line 332 of file node_type.hpp.

332{ return (type & (KEY_DQUO)) != 0; }

◆ is_val_dquo()

bool c4::yml::NodeType::is_val_dquo ( ) const
inlinenoexcept

Definition at line 333 of file node_type.hpp.

333{ return (type & (VAL_DQUO)) != 0; }

◆ is_key_plain()

bool c4::yml::NodeType::is_key_plain ( ) const
inlinenoexcept

Definition at line 334 of file node_type.hpp.

334{ return (type & (KEY_PLAIN)) != 0; }

◆ is_val_plain()

bool c4::yml::NodeType::is_val_plain ( ) const
inlinenoexcept

Definition at line 335 of file node_type.hpp.

335{ return (type & (VAL_PLAIN)) != 0; }

◆ is_key_quoted()

bool c4::yml::NodeType::is_key_quoted ( ) const
inlinenoexcept

Definition at line 336 of file node_type.hpp.

336{ return (type & KEYQUO) != 0; }
@ KEYQUO
key style is one of '">|. mask of KEY_SQUO|KEY_DQUO|KEY_FOLDED|KEY_LITERAL

◆ is_val_quoted()

bool c4::yml::NodeType::is_val_quoted ( ) const
inlinenoexcept

Definition at line 337 of file node_type.hpp.

337{ return (type & VALQUO) != 0; }
@ VALQUO
val style is one of '">|. mask of VAL_SQUO|VAL_DQUO|VAL_FOLDED|VAL_LITERAL

◆ is_quoted()

bool c4::yml::NodeType::is_quoted ( ) const
inlinenoexcept

Definition at line 338 of file node_type.hpp.

338{ return (type & (KEYQUO|VALQUO)) != 0; }

◆ key_style()

NodeType c4::yml::NodeType::key_style ( ) const
inlinenoexcept

Definition at line 340 of file node_type.hpp.

340{ return (type & (KEY_STYLE)); }

◆ val_style()

NodeType c4::yml::NodeType::val_style ( ) const
inlinenoexcept

Definition at line 341 of file node_type.hpp.

341{ return (type & (VAL_STYLE)); }

◆ set_container_style()

void c4::yml::NodeType::set_container_style ( NodeType_e style)
inlinenoexcept

Definition at line 343 of file node_type.hpp.

343{ type = ((style & CONTAINER_STYLE) | (type & ~CONTAINER_STYLE)); }

◆ set_key_style()

void c4::yml::NodeType::set_key_style ( NodeType_e style)
inlinenoexcept

Definition at line 344 of file node_type.hpp.

344{ type = ((style & KEY_STYLE) | (type & ~KEY_STYLE)); }

◆ set_val_style()

void c4::yml::NodeType::set_val_style ( NodeType_e style)
inlinenoexcept

Definition at line 345 of file node_type.hpp.

345{ type = ((style & VAL_STYLE) | (type & ~VAL_STYLE)); }

◆ clear_style()

void c4::yml::NodeType::clear_style ( )
inlinenoexcept

Definition at line 346 of file node_type.hpp.

346{ type &= ~STYLE; }

Member Data Documentation

◆ type

NodeType_e c4::yml::NodeType::type

Definition at line 229 of file node_type.hpp.


The documentation for this struct was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/v0.15.2/src/c4/yml/node_type.hpp
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/v0.15.2/src/c4/yml/node_type.cpp