rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
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

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

Macros

#define _prflag(fl, txt)
#define rest_is(c1, 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.
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.
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.
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.
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.
bool c4::yml::scalar_is_null (csubstr s) noexcept
 YAML-sense query of nullity.
NodeType_e c4::yml::scalar_style_choose_json (csubstr scalar) noexcept
 choose a json scalar style based on the scalar's contents

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 )
Value:
((s.str[1] == (c1)) && (s.str[2] == (c2)))

Definition at line 303 of file node_type.cpp.