1#ifndef _C4_YML_EMIT_BUF_HPP_
4#ifndef _C4_YML_WRITER_BUF_HPP_
7#ifndef _C4_YML_TREE_HPP_
10#ifndef _C4_YML_NODE_HPP_
13#ifndef _C4_YML_EMITTER_DEF_HPP_
38 em.emit_as(EMIT_YAML, &t);
39 return em.get_result(error_on_excess);
52 em.emit_as(EMIT_JSON, &t);
53 return em.get_result(error_on_excess);
69 em.emit_as(EMIT_YAML, &t,
id);
70 return em.get_result(error_on_excess);
83 em.emit_as(EMIT_JSON, &t,
id);
84 return em.get_result(error_on_excess);
100 em.emit_as(EMIT_YAML, r.
tree(), r.
id());
101 return em.get_result(error_on_excess);
114 em.emit_as(EMIT_JSON, r.
tree(), r.
id());
115 return em.get_result(error_on_excess);
Holds a pointer to an existing tree, and a node id.
id_type id() const noexcept
Tree const * tree() const noexcept
A YAML/JSON emitter, templated on a writer class such as WriterBuf, WriterFile, or WriterOStream.
void emit_as(EmitType_e type, Tree const *tree, id_type id=NONE)
emit!
Utilities to emit YAML and JSON to buffers or containers.
substr emit_yaml(Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess)
(1) emit YAML to the given buffer.
substr emit_json(Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess)
(1) emit JSON to the given buffer.
Emitter< WriterBuf > EmitterBuf
basic_substring< char > substr
a mutable string view
RYML_ID_TYPE id_type
The type of a node id in the YAML tree; to override the default type, define the macro RYML_ID_TYPE t...
(Undefined by default) Use shorter error message from checks/asserts: do not show the check condition...
A lightweight object containing options to be used when emitting.
substr get_result(bool error_on_excess) const
Return the buffer written so far, or optionally throw an error if the buffer was too small.