rapidyaml  0.13.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 349 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 386 of file common.hpp.

387  {
388  return set_flags_(enabled, DETECT_FLOW_ML);
389  }

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

391 { 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 404 of file common.hpp.

405  {
406  return set_flags_(enabled, RESOLVE_TAGS);
407  }

◆ resolve_tags() [2/2]

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

query status of tag resolution setting.

Definition at line 409 of file common.hpp.

409 { 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 414 of file common.hpp.

415  {
416  return set_flags_(enabled, RESOLVE_TAGS_ALL);
417  }

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

419 { return (flags & RESOLVE_TAGS_ALL); }

◆ locations() [1/2]

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

enable/disable source location tracking

Definition at line 429 of file common.hpp.

430  {
431  return set_flags_(enabled, LOCATIONS);
432  }

◆ locations() [2/2]

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

query source location tracking status

Definition at line 434 of file common.hpp.

434 { 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 444 of file common.hpp.

445  {
446  return set_flags_(enabled, SCALAR_FILTERING);
447  }

◆ scalar_filtering() [2/2]

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

query scalar filtering status

Definition at line 449 of file common.hpp.

449 { return (flags & SCALAR_FILTERING); }

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