rapidyaml 0.14.0
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
c4::yml::as_yaml Struct Reference

mark a tree or node to be emitted as yaml when using operator<< . More...

#include <emit.hpp>

Public Member Functions

 as_yaml (Tree const &t, EmitOptions const &opts={})
 as_yaml (Tree const &t, id_type id, EmitOptions const &opts={})
 as_yaml (ConstNodeRef const &n, EmitOptions const &opts={})

Public Attributes

Tree const * tree
id_type node
EmitOptions options

Detailed Description

mark a tree or node to be emitted as yaml when using operator<< .

For example:

Tree t = parse_in_arena("{foo: bar}");
std::cout << t; // emits YAML
std::cout << as_json(t); // emits JSON
std::cout << as_json(t, EmitOptions().max_depth(10)); // emits JSON with a max tree depth
void parse_in_arena(Parser *parser, csubstr filename, csubstr yaml, Tree *t, id_type node_id)
(1) parse YAML into an existing tree node. The filename will be used in any error messages arising du...
Definition parse.cpp:92
A lightweight object containing options to be used when emitting.
Definition emit.hpp:60
mark a tree or node to be emitted as yaml when using operator<<, with options.
Definition emit.hpp:552
See also
operator<<

Definition at line 572 of file emit.hpp.


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/emit.hpp