rapidyaml 0.14.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 <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.
bool detect_flow_ml () const noexcept
 query status of detection of FLOW_ML container style.
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 354 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 391 of file common.hpp.

392 {
393 return set_flags_(enabled, DETECT_FLOW_ML);
394 }

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

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

410 {
411 return set_flags_(enabled, RESOLVE_TAGS);
412 }

◆ resolve_tags() [2/2]

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

query status of tag resolution setting.

Definition at line 414 of file common.hpp.

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

420 {
421 return set_flags_(enabled, RESOLVE_TAGS_ALL);
422 }

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

424{ return (flags & RESOLVE_TAGS_ALL); }

◆ locations() [1/2]

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

enable/disable source location tracking

Definition at line 434 of file common.hpp.

435 {
436 return set_flags_(enabled, LOCATIONS);
437 }

◆ locations() [2/2]

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

query source location tracking status

Definition at line 439 of file common.hpp.

439{ 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 449 of file common.hpp.

450 {
451 return set_flags_(enabled, SCALAR_FILTERING);
452 }

◆ scalar_filtering() [2/2]

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

query scalar filtering status

Definition at line 454 of file common.hpp.

454{ return (flags & SCALAR_FILTERING); }

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