rapidyaml  0.16.0
parseandemitYAML,anddoitfast
c4::yml::ParserOptions Struct Reference

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

#include <parse_options.hpp>

Public Member Functions

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

Detailed Description

Options to give to the ParseEngine to control its behavior.

Definition at line 21 of file parse_options.hpp.

Constructor & Destructor Documentation

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

Member Function Documentation

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.

Referenced by sample_style_flow_formatting().

63  {
64  return set_flags_(enabled, DETECT_FLOW_ML);
65  }
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); }
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.

Referenced by sample_style_flow_formatting().

74  {
75  RYML_ASSERT_BASIC_(style & (FLOW_ML1|FLOW_MLN));
76  m_flow_ml_style = style & (FLOW_ML1|FLOW_MLN);
77  return *this;
78  }
mark container with multi-line flow style, n elements per line, < wrapped (as set by EmitOptions::max...
Definition: node_type.hpp:90
mark container with multi-line flow style, 1 element per line < - seqs as <
Definition: node_type.hpp:75
NodeType c4::yml::ParserOptions::flow_ml_style ( ) const
inlinenoexcept

Definition at line 79 of file parse_options.hpp.

79 { return m_flow_ml_style; }
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.

Referenced by sample_tag_directives().

93  {
94  return set_flags_(enabled, RESOLVE_TAGS);
95  }
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); }
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  }
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); }
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.

Referenced by sample_deserialize_error(), sample_error_visit_location(), and sample_location_tracking().

118  {
119  return set_flags_(enabled, LOCATIONS);
120  }
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); }
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  }
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: