1#ifndef _C4_YML_EMIT_HPP_
2#define _C4_YML_EMIT_HPP_
7#ifndef _C4_YML_EMIT_BUF_HPP_
10#ifndef _C4_YML_EMIT_CONTAINER_HPP_
13#ifndef _C4_YML_EMIT_FILE_HPP_
16#ifndef _C4_YML_EMIT_OSTREAM_HPP_
30#define RYML_DEPRECATE_EMIT \
31 RYML_DEPRECATED("use emit_yaml() instead. " \
32 "See https://github.com/biojppm/rapidyaml/issues/120")
33#define RYML_DEPRECATE_EMITRS \
34 RYML_DEPRECATED("use emitrs_yaml() instead. " \
35 "See https://github.com/biojppm/rapidyaml/issues/120")
41#define RYML_TMP_EMIT_ emit
45RYML_DEPRECATE_EMIT
inline void emit(
Tree const& t,
id_type id, FILE *f)
49RYML_DEPRECATE_EMIT
inline void emit(
Tree const& t, FILE *f=
nullptr)
53RYML_DEPRECATE_EMIT
inline void emit(
ConstNodeRef const& r, FILE *f=
nullptr)
60 return emit_yaml(t,
id, buf, error_on_excess);
62RYML_DEPRECATE_EMIT
inline substr emit(
Tree const& t,
substr buf,
bool error_on_excess=
true)
64 return emit_yaml(t, buf, error_on_excess);
68 return emit_yaml(r, buf, error_on_excess);
76template<
class CharOwningContainer>
77RYML_DEPRECATE_EMITRS
substr emitrs(
Tree const& t,
id_type id, CharOwningContainer * cont)
81template<
class CharOwningContainer>
82RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(
Tree const& t,
id_type id)
86template<
class CharOwningContainer>
87RYML_DEPRECATE_EMITRS
substr emitrs(
Tree const& t, CharOwningContainer * cont)
91template<
class CharOwningContainer>
92RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(
Tree const& t)
96template<
class CharOwningContainer>
101template<
class CharOwningContainer>
102RYML_DEPRECATE_EMITRS CharOwningContainer emitrs(
ConstNodeRef const& n)
107#undef RYML_DEPRECATE_EMIT
108#undef RYML_DEPRECATE_EMITRS
Holds a pointer to an existing tree, and a node id.
Utilities to emit YAML and JSON to buffers or containers.
emit to STL-like ostreams
substr emit_yaml(Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess)
(1) emit YAML to the given buffer.
substr emitrs_yaml(Tree const &t, id_type id, EmitOptions const &opts, CharOwningContainer *cont, bool append=false)
(1) emit+resize: emit YAML to the given std::string/std::vector<char>-like container,...
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...