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

Options to give to the parser to control its behavior. More...

#include <parse_options.hpp>

Public Member Functions

 ParserOptions () noexcept=default
detection of @ref FLOW_ML container style
ParserOptionsdetect_flow_ml (bool enabled) noexcept
 enable/disable detection of flow multiline container style.
bool detect_flow_ml () const noexcept
 query status of detection of flow multiline container style.
ParserOptionsflow_ml_style (NodeType style) noexcept
 choose the default style of multiline flow containers, when a container is detected as flow multiline.
NodeType flow_ml_style () const noexcept
resolution of tags
ParserOptionsresolve_tags (bool enabled) noexcept
 enable/disable resolution of YAML tags during parsing.
bool resolve_tags () const noexcept
 query status of tag resolution setting.
ParserOptionsresolve_tags_all (bool enabled) noexcept
 When resolve_tags() is enabled, resolve not just prefixed tags of the form.
bool resolve_tags_all () const noexcept
 query status of non-prefixed tag resolution setting.
source location tracking
ParserOptionslocations (bool enabled) noexcept
 enable/disable source location tracking.
bool locations () const noexcept
 query source location tracking status
scalar filtering status (experimental; disable at your discretion)
ParserOptionsscalar_filtering (bool enabled) noexcept
 enable/disable scalar filtering while parsing.
bool scalar_filtering () const noexcept
 query scalar filtering status

Detailed Description

Options to give to the parser to control its behavior.

Definition at line 21 of file parse_options.hpp.

Constructor & Destructor Documentation

◆ ParserOptions()

c4::yml::ParserOptions::ParserOptions ( )
defaultnoexcept

Member Function Documentation

◆ detect_flow_ml() [1/2]

ParserOptions & c4::yml::ParserOptions::detect_flow_ml ( bool enabled)
inlinenoexcept

enable/disable detection of flow multiline container style.

When enabled, the parser will set either FLOW_ML1 or FLOW_MLN flow multiline style as the style of flow containers which have the terminating bracket on a line different from that of the opening bracket. Default is to detect flow multiline. Use ParserOptions::flow_ml_style() to choose between the FLOW_ML1 or FLOW_MLN styles.

Definition at line 62 of file parse_options.hpp.

63 {
64 return set_flags_(enabled, DETECT_FLOW_ML);
65 }

◆ detect_flow_ml() [2/2]

bool c4::yml::ParserOptions::detect_flow_ml ( ) const
inlinenoexcept

query status of detection of flow multiline container style.

Definition at line 67 of file parse_options.hpp.

67{ return (m_flags & DETECT_FLOW_ML); }

◆ flow_ml_style() [1/2]

ParserOptions & c4::yml::ParserOptions::flow_ml_style ( NodeType style)
inlinenoexcept

choose the default style of multiline flow containers, when a container is detected as flow multiline.

Input should be FLOW_ML1 or FLOW_MLN . Default is FLOW_ML1 (the old behavior).

Definition at line 73 of file parse_options.hpp.

74 {
75 _RYML_ASSERT_BASIC(style & (FLOW_ML1|FLOW_MLN));
76 m_flow_ml_style = style & (FLOW_ML1|FLOW_MLN);
77 return *this;
78 }
@ FLOW_ML1
mark container with multi-line flow style, 1 element per line
Definition node_type.hpp:79
@ 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

◆ flow_ml_style() [2/2]

NodeType c4::yml::ParserOptions::flow_ml_style ( ) const
inlinenoexcept

Definition at line 79 of file parse_options.hpp.

79{ return m_flow_ml_style; }

◆ resolve_tags() [1/2]

ParserOptions & c4::yml::ParserOptions::resolve_tags ( bool enabled)
inlinenoexcept

enable/disable resolution of YAML tags during parsing.

When enabled, tags are resolved according to existing tag directives. Disabled by default. See also ParserOptions::resolve_tags_all().

Definition at line 92 of file parse_options.hpp.

93 {
94 return set_flags_(enabled, RESOLVE_TAGS);
95 }

◆ resolve_tags() [2/2]

bool c4::yml::ParserOptions::resolve_tags ( ) const
inlinenoexcept

query status of tag resolution setting.

Definition at line 97 of file parse_options.hpp.

97{ return (m_flags & RESOLVE_TAGS); }

◆ resolve_tags_all() [1/2]

ParserOptions & c4::yml::ParserOptions::resolve_tags_all ( bool enabled)
inlinenoexcept

When resolve_tags() is enabled, resolve not just prefixed tags of the form.

!handle!tag

, but also non-prefixed tags (

!!tag

and

!tag!

). Disabled by default.

Definition at line 102 of file parse_options.hpp.

103 {
104 return set_flags_(enabled, RESOLVE_TAGS_ALL);
105 }

◆ resolve_tags_all() [2/2]

bool c4::yml::ParserOptions::resolve_tags_all ( ) const
inlinenoexcept

query status of non-prefixed tag resolution setting.

Definition at line 107 of file parse_options.hpp.

107{ return (m_flags & RESOLVE_TAGS_ALL); }

◆ locations() [1/2]

ParserOptions & c4::yml::ParserOptions::locations ( bool enabled)
inlinenoexcept

enable/disable source location tracking.

Disabled by default.

Definition at line 117 of file parse_options.hpp.

118 {
119 return set_flags_(enabled, LOCATIONS);
120 }

◆ locations() [2/2]

bool c4::yml::ParserOptions::locations ( ) const
inlinenoexcept

query source location tracking status

Definition at line 122 of file parse_options.hpp.

122{ return (m_flags & LOCATIONS); }

◆ scalar_filtering() [1/2]

ParserOptions & c4::yml::ParserOptions::scalar_filtering ( bool enabled)
inlinenoexcept

enable/disable scalar filtering while parsing.

Enabled by default.

Definition at line 132 of file parse_options.hpp.

133 {
134 return set_flags_(enabled, SCALAR_FILTERING);
135 }

◆ scalar_filtering() [2/2]

bool c4::yml::ParserOptions::scalar_filtering ( ) const
inlinenoexcept

query scalar filtering status

Definition at line 137 of file parse_options.hpp.

137{ return (m_flags & SCALAR_FILTERING); }

The documentation for this struct was generated from the following file:
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/v0.15.0/src/c4/yml/parse_options.hpp