rapidyaml  0.11.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
 
source location tracking
ParserOptionslocations (bool enabled) noexcept
 enable/disable source location tracking More...
 
bool locations () const noexcept
 query source location tracking status More...
 
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...
 
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

◆ locations() [1/2]

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

enable/disable source location tracking

Definition at line 369 of file common.hpp.

370  {
371  if(enabled)
372  flags |= LOCATIONS;
373  else
374  flags &= ~LOCATIONS;
375  return *this;
376  }

◆ locations() [2/2]

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

query source location tracking status

Definition at line 378 of file common.hpp.

378 { return (flags & LOCATIONS); }

◆ 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  if(enabled)
394  flags |= DETECT_FLOW_ML;
395  else
396  flags &= ~DETECT_FLOW_ML;
397  return *this;
398  }

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

400 { return (flags & DETECT_FLOW_ML); }

◆ scalar_filtering() [1/2]

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

enable/disable scalar filtering while parsing

Definition at line 410 of file common.hpp.

411  {
412  if(enabled)
413  flags |= SCALAR_FILTERING;
414  else
415  flags &= ~SCALAR_FILTERING;
416  return *this;
417  }

◆ scalar_filtering() [2/2]

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

query scalar filtering status

Definition at line 419 of file common.hpp.

419 { return (flags & SCALAR_FILTERING); }

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