rapidyaml  0.13.0
parse and emit YAML, and do it fast
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_ml () const noexcept
 
bool is_flow () 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 More...
 
size_t type_str (substr buf) const noexcept
 fill a string with the node type flags. More...
 
csubstr type_str_sub (substr buf) const noexcept
 fill a string with the node type flags. More...
 
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
 
bool is_key_anchor () const noexcept
 
bool is_val_anchor () const noexcept
 
bool is_anchor () const noexcept
 
bool is_anchor_or_ref () const noexcept
 
static const char * type_str (NodeType_e t) noexcept
 return a preset string based on the node type More...
 
static size_t type_str (substr buf, NodeType_e t) noexcept
 fill a string with the node type flags. More...
 
static csubstr type_str_sub (substr buf, NodeType_e t) noexcept
 fill a string with the node type flags. More...
 

Detailed Description

wraps a NodeType_e element with some syntactic sugar and predicates

Definition at line 120 of file node_type.hpp.

Constructor & Destructor Documentation

◆ NodeType() [1/3]

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

Definition at line 128 of file node_type.hpp.

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

◆ NodeType() [2/3]

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

Definition at line 129 of file node_type.hpp.

129 : type(t) {}

◆ NodeType() [3/3]

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

Definition at line 130 of file node_type.hpp.

130 : 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 132 of file node_type.hpp.

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

◆ has_all()

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

Definition at line 133 of file node_type.hpp.

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

◆ has_none()

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

Definition at line 134 of file node_type.hpp.

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

◆ set()

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

Definition at line 136 of file node_type.hpp.

136 { type = t; }

◆ add()

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

Definition at line 137 of file node_type.hpp.

137 { type = (type|t); }

◆ rem()

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

Definition at line 138 of file node_type.hpp.

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

◆ addrem()

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

Definition at line 139 of file node_type.hpp.

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

◆ clear()

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

Definition at line 141 of file node_type.hpp.

141 { type = NOTYPE; }

◆ operator NodeType_e &()

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

Definition at line 145 of file node_type.hpp.

145 { return type; }

◆ operator NodeType_e const &()

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

Definition at line 146 of file node_type.hpp.

146 { 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 154 of file node_type.hpp.

154 { return type_str(type); }
const char * type_str() const noexcept
return a preset string based on the node type
Definition: node_type.hpp:154

◆ 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
is member of a map
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
@ _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
@ 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 159 of file node_type.hpp.

159 { 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_ML, "FLOWML");
125  _prflag(BLOCK, "BLCK");
126  if(pos == 0)
127  _prflag(NOTYPE, "NOTYPE");
128 
129  #undef _prflag
130 
131  return pos;
132 }
@ VALANCH
the val has an &anchor
Definition: node_type.hpp:46
@ KEY_DQUO
mark key scalar as double quoted "
Definition: node_type.hpp:69
@ 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
@ VAL_FOLDED
mark val scalar as multiline, block folded >
Definition: node_type.hpp:66
@ KEYTAG
the key has a tag
Definition: node_type.hpp:47
@ FLOW_SL
mark container with single-line flow style (seqs as '[val1,val2], maps as '{key: val,...
Definition: node_type.hpp:60
@ FLOW_ML
mark container with multi-line flow style (seqs as '[ val1, val2 ], maps as '{ key: val,...
Definition: node_type.hpp:61
@ 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
@ VAL_SQUO
mark val scalar as single quoted '
Definition: node_type.hpp:68
@ VAL_PLAIN
mark val scalar as plain scalar (unquoted, even when multiline)
Definition: node_type.hpp:72
@ KEYREF
a *reference: the key references an &anchor
Definition: node_type.hpp:43
@ BLOCK
mark container with block style (seqs as '- val ', maps as 'key: val')
Definition: node_type.hpp:62
@ KEYANCH
the key has an &anchor
Definition: node_type.hpp:45
@ VAL_DQUO
mark val scalar as double quoted "
Definition: node_type.hpp:70
@ 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 '
Definition: node_type.hpp:67
@ VAL_LITERAL
mark val scalar as multiline, block literal |
Definition: node_type.hpp:64
@ KEY_LITERAL
mark key scalar as multiline, block literal |
Definition: node_type.hpp:63
@ KEY_PLAIN
mark key scalar as plain scalar (unquoted, even when multiline)
Definition: node_type.hpp:71
@ KEY_FOLDED
mark key scalar as multiline, block folded >
Definition: node_type.hpp:65
@ 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 164 of file node_type.hpp.

164 { return type_str_sub(buf, type); }
csubstr type_str_sub(substr buf) const noexcept
fill a string with the node type flags.
Definition: node_type.hpp:164

◆ type_str_sub() [2/2]

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

167  {
168  csubstr ret;
169  ret.len = type_str(buf, t);
170  ret.str = ret.len < buf.len ? buf.str : nullptr;
171  return ret;
172  }

◆ is_notype()

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

Definition at line 179 of file node_type.hpp.

179 { return type == NOTYPE; }

◆ is_stream()

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

Definition at line 180 of file node_type.hpp.

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

◆ is_doc()

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

Definition at line 181 of file node_type.hpp.

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

◆ is_container()

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

Definition at line 182 of file node_type.hpp.

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

◆ is_map()

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

Definition at line 183 of file node_type.hpp.

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

◆ is_seq()

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

Definition at line 184 of file node_type.hpp.

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

◆ has_key()

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

Definition at line 185 of file node_type.hpp.

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

◆ has_val()

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

Definition at line 186 of file node_type.hpp.

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

◆ is_val()

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

Definition at line 187 of file node_type.hpp.

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

◆ is_keyval()

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

Definition at line 188 of file node_type.hpp.

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

◆ key_is_null()

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

Definition at line 189 of file node_type.hpp.

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

◆ val_is_null()

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

Definition at line 190 of file node_type.hpp.

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

◆ has_key_tag()

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

Definition at line 191 of file node_type.hpp.

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

◆ has_val_tag()

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

Definition at line 192 of file node_type.hpp.

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

◆ has_key_anchor()

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

Definition at line 193 of file node_type.hpp.

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

◆ has_val_anchor()

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

Definition at line 194 of file node_type.hpp.

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

◆ has_anchor()

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

Definition at line 195 of file node_type.hpp.

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

◆ is_key_ref()

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

Definition at line 196 of file node_type.hpp.

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

◆ is_val_ref()

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

Definition at line 197 of file node_type.hpp.

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

◆ is_ref()

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

Definition at line 198 of file node_type.hpp.

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

◆ is_key_unfiltered()

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

Definition at line 200 of file node_type.hpp.

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

◆ is_val_unfiltered()

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

Definition at line 201 of file node_type.hpp.

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

◆ is_key_anchor()

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

Definition at line 203 of file node_type.hpp.

203 { return has_key_anchor(); }
bool has_key_anchor() const noexcept
Definition: node_type.hpp:193

◆ is_val_anchor()

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

Definition at line 204 of file node_type.hpp.

204 { return has_val_anchor(); }
bool has_val_anchor() const noexcept
Definition: node_type.hpp:194

◆ is_anchor()

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

Definition at line 205 of file node_type.hpp.

205 { return has_anchor(); }
bool has_anchor() const noexcept
Definition: node_type.hpp:195

◆ is_anchor_or_ref()

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

Definition at line 206 of file node_type.hpp.

206 { return has_anchor() || is_ref(); }
bool is_ref() const noexcept
Definition: node_type.hpp:198

◆ is_container_styled()

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

Definition at line 214 of file node_type.hpp.

214 { return (type & (CONTAINER_STYLE)) != 0; }
@ CONTAINER_STYLE
Definition: node_type.hpp:97

◆ is_block()

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

Definition at line 215 of file node_type.hpp.

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

◆ is_flow_sl()

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

Definition at line 216 of file node_type.hpp.

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

◆ is_flow_ml()

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

Definition at line 217 of file node_type.hpp.

217 { return (type & (FLOW_ML)) != 0; }

◆ is_flow()

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

Definition at line 218 of file node_type.hpp.

218 { return (type & (FLOW_ML|FLOW_SL)) != 0; }

◆ is_key_styled()

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

Definition at line 220 of file node_type.hpp.

220 { return (type & (KEY_STYLE)) != 0; }
@ KEY_STYLE
mask of all the scalar styles for key (not container styles!)
Definition: node_type.hpp:92

◆ is_val_styled()

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

Definition at line 221 of file node_type.hpp.

221 { return (type & (VAL_STYLE)) != 0; }
@ VAL_STYLE
mask of all the scalar styles for val (not container styles!)
Definition: node_type.hpp:93

◆ is_key_literal()

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

Definition at line 222 of file node_type.hpp.

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

◆ is_val_literal()

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

Definition at line 223 of file node_type.hpp.

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

◆ is_key_folded()

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

Definition at line 224 of file node_type.hpp.

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

◆ is_val_folded()

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

Definition at line 225 of file node_type.hpp.

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

◆ is_key_squo()

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

Definition at line 226 of file node_type.hpp.

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

◆ is_val_squo()

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

Definition at line 227 of file node_type.hpp.

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

◆ is_key_dquo()

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

Definition at line 228 of file node_type.hpp.

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

◆ is_val_dquo()

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

Definition at line 229 of file node_type.hpp.

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

◆ is_key_plain()

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

Definition at line 230 of file node_type.hpp.

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

◆ is_val_plain()

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

Definition at line 231 of file node_type.hpp.

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

◆ is_key_quoted()

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

Definition at line 232 of file node_type.hpp.

232 { return (type & KEYQUO) != 0; }
@ KEYQUO
key style is one of ', ", > or |
Definition: node_type.hpp:90

◆ is_val_quoted()

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

Definition at line 233 of file node_type.hpp.

233 { return (type & VALQUO) != 0; }
@ VALQUO
val style is one of ', ", > or |
Definition: node_type.hpp:91

◆ is_quoted()

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

Definition at line 234 of file node_type.hpp.

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

◆ key_style()

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

Definition at line 236 of file node_type.hpp.

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

◆ val_style()

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

Definition at line 237 of file node_type.hpp.

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

◆ set_container_style()

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

Definition at line 239 of file node_type.hpp.

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

◆ set_key_style()

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

Definition at line 240 of file node_type.hpp.

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

◆ set_val_style()

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

Definition at line 241 of file node_type.hpp.

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

◆ clear_style()

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

Definition at line 242 of file node_type.hpp.

242 { type &= ~STYLE; }

Member Data Documentation

◆ type

NodeType_e c4::yml::NodeType::type

Definition at line 124 of file node_type.hpp.


The documentation for this struct was generated from the following files: