rapidyaml  0.12.0
parse and emit YAML, and do it fast
c4::yml::ParserOptions Struct Reference

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

#include <common.hpp>

Public Member Functions

 ParserOptions ()=default
 
detection of @ref FLOW_ML container style
ParserOptionsdetect_flow_ml (bool enabled) noexcept
 enable/disable detection of FLOW_ML container style. More...
 
bool detect_flow_ml () const noexcept
 query status of detection of FLOW_ML container style. More...
 
resolution of tags
ParserOptionsresolve_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...
 
ParserOptionsresolve_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
ParserOptionslocations (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)
ParserOptionsscalar_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 parser to control its behavior.

Definition at line 346 of file common.hpp.

Constructor & Destructor Documentation

◆ ParserOptions()

c4::yml::ParserOptions::ParserOptions ( )
default

Member Function Documentation

◆ detect_flow_ml() [1/2]

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

enable/disable detection of FLOW_ML container style.

When enabled, the parser will set FLOW_ML as the style of flow containers which have the terminating bracket on a line different from that of the opening bracket.

Definition at line 383 of file common.hpp.

384  {
385  return set_flags_(enabled, DETECT_FLOW_ML);
386  }

◆ detect_flow_ml() [2/2]

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

query status of detection of FLOW_ML container style.

Definition at line 388 of file common.hpp.

388 { return (flags & DETECT_FLOW_ML); }

◆ 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 401 of file common.hpp.

402  {
403  return set_flags_(enabled, RESOLVE_TAGS);
404  }

◆ resolve_tags() [2/2]

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

query status of tag resolution setting.

Definition at line 406 of file common.hpp.

406 { return (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 411 of file common.hpp.

412  {
413  return set_flags_(enabled, RESOLVE_TAGS_ALL);
414  }

◆ 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 416 of file common.hpp.

416 { return (flags & RESOLVE_TAGS_ALL); }

◆ locations() [1/2]

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

enable/disable source location tracking

Definition at line 426 of file common.hpp.

427  {
428  return set_flags_(enabled, LOCATIONS);
429  }

◆ locations() [2/2]

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

query source location tracking status

Definition at line 431 of file common.hpp.

431 { return (flags & LOCATIONS); }

◆ scalar_filtering() [1/2]

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

enable/disable scalar filtering while parsing

Definition at line 441 of file common.hpp.

442  {
443  return set_flags_(enabled, SCALAR_FILTERING);
444  }

◆ scalar_filtering() [2/2]

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

query scalar filtering status

Definition at line 446 of file common.hpp.

446 { return (flags & SCALAR_FILTERING); }

The documentation for this struct was generated from the following file: