rapidyaml  0.7.2
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 247 of file parse_engine.def.hpp.

248  : m_options(opts)
249  , m_file()
250  , m_buf()
251  , m_evt_handler(evt_handler)
252  , m_pending_anchors()
253  , m_pending_tags()
254  , m_newline_offsets()
255  , m_newline_offsets_size(0)
256  , m_newline_offsets_capacity(0)
257  , m_newline_offsets_buf()
258 {
259  RYML_CHECK(evt_handler);
260 }

◆ ~ParseEngine()

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

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

241 {
242  _free();
243  _clr();
244 }

◆ ParseEngine() [2/3]

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

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

264  : m_options(that.m_options)
265  , m_file(that.m_file)
266  , m_buf(that.m_buf)
267  , m_evt_handler(that.m_evt_handler)
268  , m_pending_anchors(that.m_pending_anchors)
269  , m_pending_tags(that.m_pending_tags)
270  , m_newline_offsets(that.m_newline_offsets)
271  , m_newline_offsets_size(that.m_newline_offsets_size)
272  , m_newline_offsets_capacity(that.m_newline_offsets_capacity)
273  , m_newline_offsets_buf(that.m_newline_offsets_buf)
274 {
275  that._clr();
276 }

◆ ParseEngine() [3/3]

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

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

280  : m_options(that.m_options)
281  , m_file(that.m_file)
282  , m_buf(that.m_buf)
283  , m_evt_handler(that.m_evt_handler)
284  , m_pending_anchors(that.m_pending_anchors)
285  , m_pending_tags(that.m_pending_tags)
286  , m_newline_offsets()
287  , m_newline_offsets_size()
288  , m_newline_offsets_capacity()
289  , m_newline_offsets_buf()
290 {
291  if(that.m_newline_offsets_capacity)
292  {
293  _resize_locations(that.m_newline_offsets_capacity);
294  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity == that.m_newline_offsets_capacity);
295  memcpy(m_newline_offsets, that.m_newline_offsets, that.m_newline_offsets_size * sizeof(size_t));
296  m_newline_offsets_size = that.m_newline_offsets_size;
297  }
298 }

Member Function Documentation

◆ operator=() [1/2]

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

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

302 {
303  _free();
304  m_options = (that.m_options);
305  m_file = (that.m_file);
306  m_buf = (that.m_buf);
307  m_evt_handler = that.m_evt_handler;
308  m_pending_anchors = that.m_pending_anchors;
309  m_pending_tags = that.m_pending_tags;
310  m_newline_offsets = (that.m_newline_offsets);
311  m_newline_offsets_size = (that.m_newline_offsets_size);
312  m_newline_offsets_capacity = (that.m_newline_offsets_capacity);
313  m_newline_offsets_buf = (that.m_newline_offsets_buf);
314  that._clr();
315  return *this;
316 }

◆ operator=() [2/2]

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

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

320 {
321  _free();
322  m_options = (that.m_options);
323  m_file = (that.m_file);
324  m_buf = (that.m_buf);
325  m_evt_handler = that.m_evt_handler;
326  m_pending_anchors = that.m_pending_anchors;
327  m_pending_tags = that.m_pending_tags;
328  if(that.m_newline_offsets_capacity > m_newline_offsets_capacity)
329  _resize_locations(that.m_newline_offsets_capacity);
330  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity >= that.m_newline_offsets_capacity);
331  _RYML_CB_CHECK(m_evt_handler->m_stack.m_callbacks, m_newline_offsets_capacity >= that.m_newline_offsets_size);
332  memcpy(m_newline_offsets, that.m_newline_offsets, that.m_newline_offsets_size * sizeof(size_t));
333  m_newline_offsets_size = that.m_newline_offsets_size;
334  m_newline_offsets_buf = that.m_newline_offsets_buf;
335  return *this;
336 }

◆ 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 8058 of file parse_engine.def.hpp.

8059 {
8060  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_evt_handler->m_stack.size() >= 1);
8061  m_file = filename;
8062  m_buf = src;
8063  _reset();
8064  m_evt_handler->start_parse(filename.str, &_s_relocate_arena, this);
8065  m_evt_handler->begin_stream();
8066  while( ! _finished_file())
8067  {
8068  _scan_line();
8069  while( ! _finished_line())
8070  {
8071  _c4dbgnextline();
8072  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, ! m_evt_handler->m_curr->line_contents.rem.empty());
8073  if(has_any(FLOW))
8074  {
8075  if(has_none(RSEQIMAP))
8076  {
8077  if(has_any(RSEQ))
8078  {
8079  _handle_seq_flow();
8080  }
8081  else
8082  {
8083  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, has_all(RMAP));
8084  _handle_map_flow();
8085  }
8086  }
8087  else
8088  {
8089  _handle_seq_imap();
8090  }
8091  }
8092  else if(has_any(BLCK))
8093  {
8094  if(has_any(RSEQ))
8095  {
8096  _handle_seq_block();
8097  }
8098  else
8099  {
8100  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, has_all(RMAP));
8101  _handle_map_block();
8102  }
8103  }
8104  else if(has_any(RUNK))
8105  {
8106  _handle_unk();
8107  }
8108  else if(has_any(USTY))
8109  {
8110  _handle_usty();
8111  }
8112  else
8113  {
8114  _c4err("internal error");
8115  }
8116  }
8117  if(_finished_file())
8118  break; // it may have finished because of multiline blocks
8119  _line_ended();
8120  }
8121  _end_stream();
8122  m_evt_handler->finish_parse();
8123 }
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 8014 of file parse_engine.def.hpp.

8015 {
8016  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, m_evt_handler->m_stack.size() >= 1);
8017  m_file = filename;
8018  m_buf = src;
8019  _reset();
8020  m_evt_handler->start_parse(filename.str, &_s_relocate_arena, this);
8021  m_evt_handler->begin_stream();
8022  while( ! _finished_file())
8023  {
8024  _scan_line();
8025  while( ! _finished_line())
8026  {
8027  _c4dbgnextline();
8028  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, ! m_evt_handler->m_curr->line_contents.rem.empty());
8029  if(has_any(RSEQ))
8030  {
8031  _handle_seq_json();
8032  }
8033  else if(has_any(RMAP))
8034  {
8035  _handle_map_json();
8036  }
8037  else if(has_any(RUNK))
8038  {
8039  _handle_unk_json();
8040  }
8041  else
8042  {
8043  _c4err("internal error");
8044  }
8045  }
8046  if(_finished_file())
8047  break; // it may have finished because of multiline blocks
8048  _line_ended();
8049  }
8050  _end_stream();
8051  m_evt_handler->finish_parse();
8052 }

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 3830 of file parse_engine.def.hpp.

3831 {
3832  // try hard to avoid getting the location from a null string.
3833  Location loc;
3834  if(_location_from_node(tree, node, &loc, 0))
3835  return loc;
3836  return val_location(m_buf.str);
3837 }
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 3823 of file parse_engine.def.hpp.

3824 {
3825  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, node.readable());
3826  return location(*node.tree(), node.id());
3827 }
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 3816 of file parse_engine.def.hpp.

3817 {
3818  _RYML_CB_ASSERT(m_evt_handler->m_stack.m_callbacks, loc.offset < m_buf.len);
3819  return m_buf.sub(loc.offset);
3820 }

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 3936 of file parse_engine.def.hpp.

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

2375 {
2376  FilterProcessorSrcDst proc(scalar, dst);
2377  return _filter_plain(proc, indentation);
2378 }

◆ 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 2381 of file parse_engine.def.hpp.

2382 {
2383  FilterProcessorInplaceEndExtending proc(dst, cap);
2384  return _filter_plain(proc, indentation);
2385 }

◆ 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 2485 of file parse_engine.def.hpp.

2486 {
2487  FilterProcessorSrcDst proc(scalar, dst);
2488  return _filter_squoted(proc);
2489 }

◆ 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 2492 of file parse_engine.def.hpp.

2493 {
2494  FilterProcessorInplaceEndExtending proc(dst, cap);
2495  return _filter_squoted(proc);
2496 }

◆ 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 2776 of file parse_engine.def.hpp.

2777 {
2778  FilterProcessorSrcDst proc(scalar, dst);
2779  return _filter_dquoted(proc);
2780 }

◆ 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 2783 of file parse_engine.def.hpp.

2784 {
2785  FilterProcessorInplaceMidExtending proc(dst, cap);
2786  return _filter_dquoted(proc);
2787 }

◆ 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 3107 of file parse_engine.def.hpp.

3108 {
3109  FilterProcessorSrcDst proc(scalar, dst);
3110  return _filter_block_literal(proc, indentation, chomp);
3111 }

◆ 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 3114 of file parse_engine.def.hpp.

3115 {
3116  FilterProcessorInplaceEndExtending proc(scalar, cap);
3117  return _filter_block_literal(proc, indentation, chomp);
3118 }

◆ 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 3393 of file parse_engine.def.hpp.

3394 {
3395  FilterProcessorSrcDst proc(scalar, dst);
3396  return _filter_block_folded(proc, indentation, chomp);
3397 }

◆ 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 3400 of file parse_engine.def.hpp.

3401 {
3402  FilterProcessorInplaceEndExtending proc(scalar, cap);
3403  return _filter_block_folded(proc, indentation, chomp);
3404 }

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