1#ifndef _C4_YML_PARSE_OPTIONS_HPP_
2#define _C4_YML_PARSE_OPTIONS_HPP_
6#ifndef _C4_YML_COMMON_HPP_
9#ifndef _C4_YML_NODE_TYPE_HPP_
12#ifndef _C4_YML_ERROR_HPP_
25 typedef enum : uint32_t {
26 DETECT_FLOW_ML = (1u << 0u),
27 RESOLVE_TAGS = (1u << 1u),
28 RESOLVE_TAGS_ALL = (1u << 2u),
29 SCALAR_FILTERING = (1u << 3u),
30 LOCATIONS = (1u << 4u),
31 DEFAULTS = SCALAR_FILTERING|DETECT_FLOW_ML,
34 uint32_t m_flags = DEFAULTS;
64 return set_flags_(enabled, DETECT_FLOW_ML);
67 C4_ALWAYS_INLINE
bool detect_flow_ml() const noexcept {
return (m_flags & DETECT_FLOW_ML); }
94 return set_flags_(enabled, RESOLVE_TAGS);
97 C4_ALWAYS_INLINE
bool resolve_tags() const noexcept {
return (m_flags & RESOLVE_TAGS); }
104 return set_flags_(enabled, RESOLVE_TAGS_ALL);
107 C4_ALWAYS_INLINE
bool resolve_tags_all() const noexcept {
return (m_flags & RESOLVE_TAGS_ALL); }
119 return set_flags_(enabled, LOCATIONS);
122 C4_ALWAYS_INLINE
bool locations() const noexcept {
return (m_flags & LOCATIONS); }
134 return set_flags_(enabled, SCALAR_FILTERING);
137 C4_ALWAYS_INLINE
bool scalar_filtering() const noexcept {
return (m_flags & SCALAR_FILTERING); }
Common utilities and infrastructure used by ryml.
Error utilities used by ryml.
NodeType_e
a bit mask for marking node types and styles
@ FLOW_ML1
mark container with multi-line flow style, 1 element per line
@ FLOW_MLN
mark container with multi-line flow style, n elements per line, wrapped (as set by EmitOptions::max_c...
(Undefined by default) Use shorter error message from checks/asserts: do not show the check condition...
wraps a NodeType_e element with some syntactic sugar and predicates
ParserOptions & detect_flow_ml(bool enabled) noexcept
enable/disable detection of flow multiline container style.
bool scalar_filtering() const noexcept
query scalar filtering status
ParserOptions & locations(bool enabled) noexcept
enable/disable source location tracking.
bool resolve_tags_all() const noexcept
query status of non-prefixed tag resolution setting.
ParserOptions & scalar_filtering(bool enabled) noexcept
enable/disable scalar filtering while parsing.
bool locations() const noexcept
query source location tracking status
NodeType flow_ml_style() const noexcept
bool detect_flow_ml() const noexcept
query status of detection of flow multiline container style.
ParserOptions() noexcept=default
ParserOptions & resolve_tags(bool enabled) noexcept
enable/disable resolution of YAML tags during parsing.
ParserOptions & resolve_tags_all(bool enabled) noexcept
When resolve_tags() is enabled, resolve not just prefixed tags of the form.
ParserOptions & flow_ml_style(NodeType style) noexcept
choose the default style of multiline flow containers, when a container is detected as flow multiline...
bool resolve_tags() const noexcept
query status of tag resolution setting.