rapidyaml  0.13.0
parse and emit YAML, and do it fast
node_type.cpp File Reference
#include "c4/yml/node_type.hpp"
#include "c4/yml/error.hpp"

Go to the source code of this file.

Namespaces

 c4
 (Undefined by default) Use shorter error message from checks/asserts: do not show the check condition in the error message.
 
 c4::yml
 

Macros

#define _prflag(fl, txt)
 
#define rest_is(c1, c2)   ((s.str[1] == (c1)) && (s.str[2] == (c2)))
 

Functions

scalar style helpers
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_flow (csubstr s) noexcept
 query whether a scalar can be encoded using plain style while in flow mode. More...
 
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. More...
 
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. More...
 
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. More...
 
bool c4::yml::scalar_is_null (csubstr s) noexcept
 YAML-sense query of nullity. More...
 
NodeType_e c4::yml::scalar_style_choose_json (csubstr scalar) noexcept
 choose a json scalar style based on the scalar's contents More...
 

Macro Definition Documentation

◆ _prflag

#define _prflag (   fl,
  txt 
)
Value:
do { \
if((flags & (fl)) == (fl)) \
{ \
if(gotone) \
{ \
if(pos + 1 < buf.len) \
buf[pos] = '|'; \
++pos; \
} \
csubstr fltxt = txt; \
if(pos + fltxt.len <= buf.len) \
memcpy(buf.str + pos, fltxt.str, fltxt.len); \
pos += fltxt.len; \
gotone = true; \
flags = (flags & ~(fl)); /*remove the flag*/ \
} \
} while(0)

◆ rest_is

#define rest_is (   c1,
  c2 
)    ((s.str[1] == (c1)) && (s.str[2] == (c2)))

Definition at line 303 of file node_type.cpp.