rapidyaml  0.7.0
parse and emit YAML, and do it fast
c4::yml::ParseEngine< EventHandler > Class Template Reference

This is the main driver of parsing logic: it scans the YAML or JSON source for tokens, and emits the appropriate sequence of parsing events to its event handler. More...

#include <parse_engine.hpp>

Public Types

using handler_type = EventHandler
 

Public Member Functions

construction and assignment
 ParseEngine (EventHandler *evt_handler, ParserOptions opts={})
 
 ~ParseEngine ()
 
 ParseEngine (ParseEngine &&)
 
 ParseEngine (ParseEngine const &)
 
ParseEngineoperator= (ParseEngine &&)
 
ParseEngineoperator= (ParseEngine const &)
 
modifiers
void reserve_stack (id_type capacity)
 Reserve a certain capacity for the parsing stack. More...
 
void reserve_locations (size_t num_source_lines)
 Reserve a certain capacity for the array used to track node locations in the source buffer. More...
 
void reserve_filter_arena (size_t)
 
getters
ParserOptions const & options () const
 Get the options used to build this parser object. More...
 
Callbacks const & callbacks () const
 Get the current callbacks in the parser. More...
 
csubstr filename () const
 Get the name of the latest file parsed by this object. More...
 
csubstr source () const
 Get the latest YAML buffer parsed by this object. More...
 
id_type stack_capacity () const
 
size_t locations_capacity () const
 
size_t filter_arena_capacity () const
 
parse methods
void parse_in_place_ev (csubstr filename, substr src)
 parse YAML in place, emitting events to the current handler More...
 
void parse_json_in_place_ev (csubstr filename, substr src)
 parse JSON in place, emitting events to the current handler More...
 
locations
Location location (Tree const &tree, id_type node_id) const
 Get the location of a node of the last tree to be parsed by this parser. More...
 
Location location (ConstNodeRef node) const
 Get the location of a node of the last tree to be parsed by this parser. More...
 
csubstr location_contents (Location const &loc) const
 Get the string starting at a particular location, to the end of the parsed source buffer. More...
 
Location val_location (const char *val) const
 Given a pointer to a buffer position, get the location. More...
 
scalar filtering
FilterResult filter_scalar_plain (csubstr scalar, substr dst, size_t indentation)
 filter a plain scalar More...
 
FilterResult filter_scalar_plain_in_place (substr scalar, size_t cap, size_t indentation)
 filter a plain scalar in place More...
 
FilterResult filter_scalar_squoted (csubstr scalar, substr dst)
 filter a single-quoted scalar More...
 
FilterResult filter_scalar_squoted_in_place (substr scalar, size_t cap)
 filter a single-quoted scalar in place More...
 
FilterResult filter_scalar_dquoted (csubstr scalar, substr dst)
 filter a double-quoted scalar More...
 
FilterResultExtending filter_scalar_dquoted_in_place (substr scalar, size_t cap)
 filter a double-quoted scalar in place More...
 
FilterResult filter_scalar_block_literal (csubstr scalar, substr dst, size_t indentation, BlockChomp_e chomp)
 filter a block-literal scalar More...
 
FilterResult filter_scalar_block_literal_in_place (substr scalar, size_t cap, size_t indentation, BlockChomp_e chomp)
 filter a block-literal scalar in place More...
 
FilterResult filter_scalar_block_folded (csubstr scalar, substr dst, size_t indentation, BlockChomp_e chomp)
 filter a block-folded scalar More...
 
FilterResult filter_scalar_block_folded_in_place (substr scalar, size_t cap, size_t indentation, BlockChomp_e chomp)
 filter a block-folded scalar in place More...
 

Detailed Description

template<class EventHandler>
class c4::yml::ParseEngine< EventHandler >

This is the main driver of parsing logic: it scans the YAML or JSON source for tokens, and emits the appropriate sequence of parsing events to its event handler.

The parse engine itself has no special limitations, and can accomodate containers as keys; it is the event handler may introduce additional constraints.

There are two implemented handlers (see Event Handlers, which has important notes about the event model):

Definition at line 291 of file parse_engine.hpp.

Member Typedef Documentation

◆ handler_type

template<class EventHandler >
using c4::yml::ParseEngine< EventHandler >::handler_type = EventHandler

Definition at line 295 of file parse_engine.hpp.

Constructor & Destructor Documentation

◆ ParseEngine() [1/3]

template<class EventHandler >
c4::yml::ParseEngine< EventHandler >::ParseEngine ( EventHandler *  evt_handler,
ParserOptions  opts = {} 
)

Definition at line 233 of file parse_engine.def.hpp.

234  : m_options(opts)
235  , m_file()
236  , m_buf()
237  , m_evt_handler(evt_handler)
238  , m_pending_anchors()
239  , m_pending_tags()
240  , m_newline_offsets()
241  , m_newline_offsets_size(0)
242  , m_newline_offsets_capacity(0)
243  , m_newline_offsets_buf()
244 {
245  RYML_CHECK(evt_handler);
246 }

◆ ~ParseEngine()

template<class EventHandler >
c4::yml::ParseEngine< EventHandler >::~ParseEngine

Definition at line 226 of file parse_engine.def.hpp.

227 {
228  _free();
229  _clr();
230 }

◆ ParseEngine() [2/3]

template<class EventHandler >
c4::yml::ParseEngine< EventHandler >::ParseEngine ( ParseEngine< EventHandler > &&  that)

Definition at line 249 of file parse_engine.def.hpp.

250  : m_options(that.m_options)
251  , m_file(that.m_file)
252  , m_buf(that.m_buf)
253  , m_evt_handler(that.m_evt_handler)
254  , m_pending_anchors(that.m_pending_anchors)
255  , m_pending_tags(that.m_pending_tags)
256  , m_newline_offsets(that.m_newline_offsets)
257  , m_newline_offsets_size(that.m_newline_offsets_size)
258  , m_newline_offsets_capacity(that.m_newline_offsets_capacity)
259  , m_newline_offsets_buf(that.m_newline_offsets_buf)
260 {
261  that._clr();
262 }

◆ ParseEngine() [3/3]

template<class EventHandler >
c4::yml::ParseEngine< EventHandler >::ParseEngine ( ParseEngine< EventHandler > const &  that)

Definition at line 265 of file parse_engine.def.hpp.

266  : m_options(that.m_options)
267  , m_file(that.m_file)
268  , m_buf(that.m_buf)
269  , m_evt_handler(that.m_evt_handler)
270  , m_pending_anchors(that.m_pending_anchors)
271  , m_pending_tags(that.m_pending_tags)
272  , m_newline_offsets()
273  , m_newline_offsets_size()
274  , m_newline_offsets_capacity()
275  , m_newline_offsets_buf()
276 {
277  if(that.m_newline_offsets_capacity)
278  {
279  _resize_locations(that.m_newline_offsets_capacity);
280  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity == that.m_newline_offsets_capacity);
281  memcpy(m_newline_offsets, that.m_newline_offsets, that.m_newline_offsets_size * sizeof(size_t));
282  m_newline_offsets_size = that.m_newline_offsets_size;
283  }
284 }

Member Function Documentation

◆ operator=() [1/2]

template<class EventHandler >
ParseEngine< EventHandler > & c4::yml::ParseEngine< EventHandler >::operator= ( ParseEngine< EventHandler > &&  that)

Definition at line 287 of file parse_engine.def.hpp.

288 {
289  _free();
290  m_options = (that.m_options);
291  m_file = (that.m_file);
292  m_buf = (that.m_buf);
293  m_evt_handler = that.m_evt_handler;
294  m_pending_anchors = that.m_pending_anchors;
295  m_pending_tags = that.m_pending_tags;
296  m_newline_offsets = (that.m_newline_offsets);
297  m_newline_offsets_size = (that.m_newline_offsets_size);
298  m_newline_offsets_capacity = (that.m_newline_offsets_capacity);
299  m_newline_offsets_buf = (that.m_newline_offsets_buf);
300  that._clr();
301  return *this;
302 }

◆ operator=() [2/2]

template<class EventHandler >
ParseEngine< EventHandler > & c4::yml::ParseEngine< EventHandler >::operator= ( ParseEngine< EventHandler > const &  that)

Definition at line 305 of file parse_engine.def.hpp.

306 {
307  _free();
308  m_options = (that.m_options);
309  m_file = (that.m_file);
310  m_buf = (that.m_buf);
311  m_evt_handler = that.m_evt_handler;
312  m_pending_anchors = that.m_pending_anchors;
313  m_pending_tags = that.m_pending_tags;
314  if(that.m_newline_offsets_capacity > m_newline_offsets_capacity)
315  _resize_locations(that.m_newline_offsets_capacity);
316  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity >= that.m_newline_offsets_capacity);
317  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity >= that.m_newline_offsets_size);
318  memcpy(m_newline_offsets, that.m_newline_offsets, that.m_newline_offsets_size * sizeof(size_t));
319  m_newline_offsets_size = that.m_newline_offsets_size;
320  m_newline_offsets_buf = that.m_newline_offsets_buf;
321  return *this;
322 }

◆ reserve_stack()

template<class EventHandler >
void c4::yml::ParseEngine< EventHandler >::reserve_stack ( id_type  capacity)
inline

Reserve a certain capacity for the parsing stack.

This should be larger than the expected depth of the parsed YAML tree.

The parsing stack is the only (potential) heap memory used directly by the parser.

If the requested capacity is below the default stack size of 16, the memory is used directly in the parser object; otherwise it will be allocated from the heap.

Note
this reserves memory only for the parser itself; all the allocations for the parsed tree will go through the tree's allocator (when different).
for maximum efficiency, the tree and the arena can (and should) also be reserved.

Definition at line 334 of file parse_engine.hpp.

335  {
336  m_evt_handler->m_stack.reserve(capacity);
337  }

Referenced by sample::sample_global_allocator(), sample::sample_parse_reuse_parser(), and sample::sample_parse_reuse_tree_and_parser().

◆ reserve_locations()

template<class EventHandler >
void c4::yml::ParseEngine< EventHandler >::reserve_locations ( size_t  num_source_lines)
inline

Reserve a certain capacity for the array used to track node locations in the source buffer.

Definition at line 341 of file parse_engine.hpp.

342  {
343  _resize_locations(num_source_lines);
344  }

Referenced by sample::sample_location_tracking().

◆ reserve_filter_arena()

template<class EventHandler >
void c4::yml::ParseEngine< EventHandler >::reserve_filter_arena ( size_t  )
inline

Definition at line 347 of file parse_engine.hpp.

347 {}

◆ options()

template<class EventHandler >
ParserOptions const& c4::yml::ParseEngine< EventHandler >::options ( ) const
inline

Get the options used to build this parser object.

Definition at line 357 of file parse_engine.hpp.

357 { return m_options; }

Referenced by sample::sample_location_tracking().

◆ callbacks()

template<class EventHandler >
Callbacks const& c4::yml::ParseEngine< EventHandler >::callbacks ( ) const
inline

Get the current callbacks in the parser.

Definition at line 360 of file parse_engine.hpp.

360 { RYML_ASSERT(m_evt_handler); return m_evt_handler->m_stack.m_callbacks; }

Referenced by c4::yml::parse_in_arena(), c4::yml::parse_in_place(), c4::yml::parse_json_in_arena(), and c4::yml::parse_json_in_place().

◆ filename()

template<class EventHandler >
csubstr c4::yml::ParseEngine< EventHandler >::filename ( ) const
inline

Get the name of the latest file parsed by this object.

Definition at line 363 of file parse_engine.hpp.

363 { return m_file; }

◆ source()

template<class EventHandler >
csubstr c4::yml::ParseEngine< EventHandler >::source ( ) const
inline

Get the latest YAML buffer parsed by this object.

Definition at line 366 of file parse_engine.hpp.

366 { return m_buf; }

◆ stack_capacity()

template<class EventHandler >
id_type c4::yml::ParseEngine< EventHandler >::stack_capacity ( ) const
inline

Definition at line 368 of file parse_engine.hpp.

368 { RYML_ASSERT(m_evt_handler); return m_evt_handler->m_stack.capacity(); }

◆ locations_capacity()

template<class EventHandler >
size_t c4::yml::ParseEngine< EventHandler >::locations_capacity ( ) const
inline

Definition at line 369 of file parse_engine.hpp.

369 { return m_newline_offsets_capacity; }

◆ filter_arena_capacity()

template<class EventHandler >
size_t c4::yml::ParseEngine< EventHandler >::filter_arena_capacity ( ) const
inline

Definition at line 372 of file parse_engine.hpp.

372 { return 0u; }

◆ parse_in_place_ev()

template<class EventHandler >
void c4::yml::ParseEngine< EventHandler >::parse_in_place_ev ( csubstr  filename,
substr  src 
)

parse YAML in place, emitting events to the current handler

Definition at line 8046 of file parse_engine.def.hpp.

8047 {
8048  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_evt_handler->m_stack.size() >= 1);
8049  m_file = filename;
8050  m_buf = src;
8051  _reset();
8052  m_evt_handler->start_parse(filename.str, &_s_relocate_arena, this);
8053  m_evt_handler->begin_stream();
8054  while( ! _finished_file())
8055  {
8056  _scan_line();
8057  while( ! _finished_line())
8058  {
8059  _c4dbgnextline();
8060  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, ! m_evt_handler->m_curr->line_contents.rem.empty());
8061  if(has_any(FLOW))
8062  {
8063  if(has_none(RSEQIMAP))
8064  {
8065  if(has_any(RSEQ))
8066  {
8067  _handle_seq_flow();
8068  }
8069  else
8070  {
8071  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, has_all(RMAP));
8072  _handle_map_flow();
8073  }
8074  }
8075  else
8076  {
8077  _handle_seq_imap();
8078  }
8079  }
8080  else if(has_any(BLCK))
8081  {
8082  if(has_any(RSEQ))
8083  {
8084  _handle_seq_block();
8085  }
8086  else
8087  {
8088  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, has_all(RMAP));
8089  _handle_map_block();
8090  }
8091  }
8092  else if(has_any(RUNK))
8093  {
8094  _handle_unk();
8095  }
8096  else if(has_any(USTY))
8097  {
8098  _handle_usty();
8099  }
8100  else
8101  {
8102  _c4err("internal error");
8103  }
8104  }
8105  if(_finished_file())
8106  break; // it may have finished because of multiline blocks
8107  _line_ended();
8108  }
8109  _end_stream();
8110  m_evt_handler->finish_parse();
8111 }
csubstr filename() const
Get the name of the latest file parsed by this object.
@ BLCK
reading in block mode
@ RSEQ
reading a seq
@ FLOW
reading is inside explicit flow chars: [] or {}
@ RUNK
reading unknown state (when starting): must determine whether scalar, map or seq
@ RMAP
reading a map
@ USTY
reading in unknown style mode - must determine FLOW or BLCK reading an implicit map nested in an expl...
#define _c4dbgnextline()

References _c4dbgnextline, c4::yml::BLCK, c4::yml::FLOW, c4::yml::RMAP, c4::yml::RSEQ, c4::yml::RSEQIMAP, c4::yml::RUNK, and c4::yml::USTY.

Referenced by c4::yml::parse_in_place().

◆ parse_json_in_place_ev()

template<class EventHandler >
void c4::yml::ParseEngine< EventHandler >::parse_json_in_place_ev ( csubstr  filename,
substr  src 
)

parse JSON in place, emitting events to the current handler

Definition at line 8002 of file parse_engine.def.hpp.

8003 {
8004  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_evt_handler->m_stack.size() >= 1);
8005  m_file = filename;
8006  m_buf = src;
8007  _reset();
8008  m_evt_handler->start_parse(filename.str, &_s_relocate_arena, this);
8009  m_evt_handler->begin_stream();
8010  while( ! _finished_file())
8011  {
8012  _scan_line();
8013  while( ! _finished_line())
8014  {
8015  _c4dbgnextline();
8016  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, ! m_evt_handler->m_curr->line_contents.rem.empty());
8017  if(has_any(RSEQ))
8018  {
8019  _handle_seq_json();
8020  }
8021  else if(has_any(RMAP))
8022  {
8023  _handle_map_json();
8024  }
8025  else if(has_any(RUNK))
8026  {
8027  _handle_unk_json();
8028  }
8029  else
8030  {
8031  _c4err("internal error");
8032  }
8033  }
8034  if(_finished_file())
8035  break; // it may have finished because of multiline blocks
8036  _line_ended();
8037  }
8038  _end_stream();
8039  m_evt_handler->finish_parse();
8040 }

References _c4dbgnextline, c4::yml::RMAP, c4::yml::RSEQ, and c4::yml::RUNK.

Referenced by c4::yml::parse_json_in_place().

◆ location() [1/2]

template<class EventHandler >
Location c4::yml::ParseEngine< EventHandler >::location ( Tree const &  tree,
id_type  node_id 
) const

Get the location of a node of the last tree to be parsed by this parser.

Definition at line 3824 of file parse_engine.def.hpp.

3825 {
3826  // try hard to avoid getting the location from a null string.
3827  Location loc;
3828  if(_location_from_node(tree, node, &loc, 0))
3829  return loc;
3830  return val_location(m_buf.str);
3831 }
Location val_location(const char *val) const
Given a pointer to a buffer position, get the location.

Referenced by sample::sample_location_tracking(), and sample::sample_quick_overview().

◆ location() [2/2]

template<class EventHandler >
Location c4::yml::ParseEngine< EventHandler >::location ( ConstNodeRef  node) const

Get the location of a node of the last tree to be parsed by this parser.

Definition at line 3817 of file parse_engine.def.hpp.

3818 {
3819  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, node.readable());
3820  return location(*node.tree(), node.id());
3821 }
Location location(Tree const &tree, id_type node_id) const
Get the location of a node of the last tree to be parsed by this parser.

References c4::yml::ConstNodeRef::id(), c4::yml::ConstNodeRef::readable(), and c4::yml::ConstNodeRef::tree().

◆ location_contents()

template<class EventHandler >
csubstr c4::yml::ParseEngine< EventHandler >::location_contents ( Location const &  loc) const

Get the string starting at a particular location, to the end of the parsed source buffer.

Definition at line 3810 of file parse_engine.def.hpp.

3811 {
3812  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, loc.offset < m_buf.len);
3813  return m_buf.sub(loc.offset);
3814 }

References c4::yml::Location::offset.

Referenced by sample::sample_location_tracking(), and sample::sample_quick_overview().

◆ val_location()

template<class EventHandler >
Location c4::yml::ParseEngine< EventHandler >::val_location ( const char *  val) const

Given a pointer to a buffer position, get the location.

Parameters
[in]valmust be pointing to somewhere in the source buffer that was last parsed by this object.

Definition at line 3930 of file parse_engine.def.hpp.

3931 {
3932  if(C4_UNLIKELY(val == nullptr))
3933  return {m_file, 0, 0, 0};
3934  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_options.locations());
3935  // NOTE: if any of these checks fails, the parser needs to be
3936  // instantiated with locations enabled.
3937  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_buf.str == m_newline_offsets_buf.str);
3938  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_buf.len == m_newline_offsets_buf.len);
3939  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_options.locations());
3940  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, !_locations_dirty());
3941  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_newline_offsets != nullptr);
3942  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_size > 0);
3943  // NOTE: the pointer needs to belong to the buffer that was used to parse.
3944  csubstr src = m_buf;
3945  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, val != nullptr || src.str == nullptr);
3946  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, (val >= src.begin() && val <= src.end()) || (src.str == nullptr && val == nullptr));
3947  // ok. search the first stored newline after the given ptr
3948  using lineptr_type = size_t const* C4_RESTRICT;
3949  lineptr_type lineptr = nullptr;
3950  size_t offset = (size_t)(val - src.begin());
3951  if(m_newline_offsets_size < RYML_LOCATIONS_SMALL_THRESHOLD)
3952  {
3953  // just do a linear search if the size is small.
3954  for(lineptr_type curr = m_newline_offsets, last = m_newline_offsets + m_newline_offsets_size; curr < last; ++curr)
3955  {
3956  if(*curr > offset)
3957  {
3958  lineptr = curr;
3959  break;
3960  }
3961  }
3962  }
3963  else
3964  {
3965  // do a bisection search if the size is not small.
3966  //
3967  // We could use std::lower_bound but this is simple enough and
3968  // spares the costly include of <algorithm>.
3969  size_t count = m_newline_offsets_size;
3970  size_t step;
3971  lineptr_type it;
3972  lineptr = m_newline_offsets;
3973  while(count)
3974  {
3975  step = count >> 1;
3976  it = lineptr + step;
3977  if(*it < offset)
3978  {
3979  lineptr = ++it;
3980  count -= step + 1;
3981  }
3982  else
3983  {
3984  count = step;
3985  }
3986  }
3987  }
3988  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, lineptr >= m_newline_offsets);
3989  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, lineptr <= m_newline_offsets + m_newline_offsets_size);
3990  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, *lineptr > offset);
3991  Location loc;
3992  loc.name = m_file;
3993  loc.offset = offset;
3994  loc.line = (size_t)(lineptr - m_newline_offsets);
3995  if(lineptr > m_newline_offsets)
3996  loc.col = (offset - *(lineptr-1) - 1u);
3997  else
3998  loc.col = offset;
3999  return loc;
4000 }
#define RYML_LOCATIONS_SMALL_THRESHOLD
threshold at which a location search will revert from linear to binary search.
Definition: common.hpp:48
ParserOptions & locations(bool enabled) noexcept
enable/disable source location tracking

References c4::yml::Location::col, c4::yml::Location::line, c4::yml::Location::name, c4::yml::Location::offset, and RYML_LOCATIONS_SMALL_THRESHOLD.

◆ filter_scalar_plain()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_plain ( csubstr  scalar,
substr  dst,
size_t  indentation 
)

filter a plain scalar

Definition at line 2358 of file parse_engine.def.hpp.

2359 {
2360  FilterProcessorSrcDst proc(scalar, dst);
2361  return _filter_plain(proc, indentation);
2362 }

◆ filter_scalar_plain_in_place()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_plain_in_place ( substr  scalar,
size_t  cap,
size_t  indentation 
)

filter a plain scalar in place

Definition at line 2365 of file parse_engine.def.hpp.

2366 {
2367  FilterProcessorInplaceEndExtending proc(dst, cap);
2368  return _filter_plain(proc, indentation);
2369 }

◆ filter_scalar_squoted()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_squoted ( csubstr  scalar,
substr  dst 
)

filter a single-quoted scalar

Definition at line 2469 of file parse_engine.def.hpp.

2470 {
2471  FilterProcessorSrcDst proc(scalar, dst);
2472  return _filter_squoted(proc);
2473 }

◆ filter_scalar_squoted_in_place()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_squoted_in_place ( substr  scalar,
size_t  cap 
)

filter a single-quoted scalar in place

Definition at line 2476 of file parse_engine.def.hpp.

2477 {
2478  FilterProcessorInplaceEndExtending proc(dst, cap);
2479  return _filter_squoted(proc);
2480 }

◆ filter_scalar_dquoted()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_dquoted ( csubstr  scalar,
substr  dst 
)

filter a double-quoted scalar

Definition at line 2760 of file parse_engine.def.hpp.

2761 {
2762  FilterProcessorSrcDst proc(scalar, dst);
2763  return _filter_dquoted(proc);
2764 }

◆ filter_scalar_dquoted_in_place()

template<class EventHandler >
FilterResultExtending c4::yml::ParseEngine< EventHandler >::filter_scalar_dquoted_in_place ( substr  scalar,
size_t  cap 
)

filter a double-quoted scalar in place

Definition at line 2767 of file parse_engine.def.hpp.

2768 {
2769  FilterProcessorInplaceMidExtending proc(dst, cap);
2770  return _filter_dquoted(proc);
2771 }

◆ filter_scalar_block_literal()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_block_literal ( csubstr  scalar,
substr  dst,
size_t  indentation,
BlockChomp_e  chomp 
)

filter a block-literal scalar

Definition at line 3091 of file parse_engine.def.hpp.

3092 {
3093  FilterProcessorSrcDst proc(scalar, dst);
3094  return _filter_block_literal(proc, indentation, chomp);
3095 }

◆ filter_scalar_block_literal_in_place()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_block_literal_in_place ( substr  scalar,
size_t  cap,
size_t  indentation,
BlockChomp_e  chomp 
)

filter a block-literal scalar in place

Definition at line 3098 of file parse_engine.def.hpp.

3099 {
3100  FilterProcessorInplaceEndExtending proc(scalar, cap);
3101  return _filter_block_literal(proc, indentation, chomp);
3102 }

◆ filter_scalar_block_folded()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_block_folded ( csubstr  scalar,
substr  dst,
size_t  indentation,
BlockChomp_e  chomp 
)

filter a block-folded scalar

Definition at line 3377 of file parse_engine.def.hpp.

3378 {
3379  FilterProcessorSrcDst proc(scalar, dst);
3380  return _filter_block_folded(proc, indentation, chomp);
3381 }

◆ filter_scalar_block_folded_in_place()

template<class EventHandler >
FilterResult c4::yml::ParseEngine< EventHandler >::filter_scalar_block_folded_in_place ( substr  scalar,
size_t  cap,
size_t  indentation,
BlockChomp_e  chomp 
)

filter a block-folded scalar in place

Definition at line 3384 of file parse_engine.def.hpp.

3385 {
3386  FilterProcessorInplaceEndExtending proc(scalar, cap);
3387  return _filter_block_folded(proc, indentation, chomp);
3388 }

The documentation for this class was generated from the following files: