rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches

Functions

template<class CharOwningContainer>
substr c4::yml::emitrs_yaml (Tree const &t, EmitOptions const &opts, CharOwningContainer *cont, bool append=false)
 (1) emit+resize: YAML to the given std::string/std::vector<char>-like container, resizing it as needed to fit the emitted YAML.
template<class CharOwningContainer>
substr c4::yml::emitrs_yaml (Tree const &t, CharOwningContainer *cont, bool append=false)
 (2) like (1), but use default emit options
template<class CharOwningContainer>
substr c4::yml::emitrs_json (Tree const &t, EmitOptions const &opts, CharOwningContainer *cont, bool append=false)
 (1) emit+resize: JSON to the given std::string/std::vector<char>-like container, resizing it as needed to fit the emitted JSON.
template<class CharOwningContainer>
substr c4::yml::emitrs_json (Tree const &t, CharOwningContainer *cont, bool append=false)
 (2) like (1), but use default emit options
template<class CharOwningContainer>
CharOwningContainer c4::yml::emitrs_yaml (Tree const &t, EmitOptions const &opts={})
 (3) emit+resize: YAML to a newly-created std::string/std::vector<char>-like container.
template<class CharOwningContainer>
CharOwningContainer c4::yml::emitrs_json (Tree const &t, EmitOptions const &opts={})
 (3) emit+resize: JSON to a newly-created std::string/std::vector<char>-like container.

Detailed Description

Function Documentation

◆ emitrs_yaml() [1/3]

template<class CharOwningContainer>
substr c4::yml::emitrs_yaml ( Tree const & t,
EmitOptions const & opts,
CharOwningContainer * cont,
bool append = false )

(1) emit+resize: YAML to the given std::string/std::vector<char>-like container, resizing it as needed to fit the emitted YAML.

Returns
a substr trimmed to the new emitted contents.

Definition at line 117 of file emit_container.hpp.

118{
119 return emitrs_yaml(t, t.root_id_maybe(), opts, cont, append);
120}
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,...

◆ emitrs_yaml() [2/3]

template<class CharOwningContainer>
substr c4::yml::emitrs_yaml ( Tree const & t,
CharOwningContainer * cont,
bool append = false )

(2) like (1), but use default emit options

Definition at line 123 of file emit_container.hpp.

124{
125 return emitrs_yaml(t, t.root_id_maybe(), EmitOptions{}, cont, append);
126}
A lightweight object containing options to be used when emitting.

◆ emitrs_json() [1/3]

template<class CharOwningContainer>
substr c4::yml::emitrs_json ( Tree const & t,
EmitOptions const & opts,
CharOwningContainer * cont,
bool append = false )

(1) emit+resize: JSON to the given std::string/std::vector<char>-like container, resizing it as needed to fit the emitted JSON.

Returns
a substr trimmed to the new emitted contents.

Definition at line 133 of file emit_container.hpp.

134{
135 return emitrs_json(t, t.root_id_maybe(), opts, cont, append);
136}
substr emitrs_json(Tree const &t, id_type id, EmitOptions const &opts, CharOwningContainer *cont, bool append=false)
(1) emit+resize: emit JSON to the given std::string/std::vector<char>-like container,...

◆ emitrs_json() [2/3]

template<class CharOwningContainer>
substr c4::yml::emitrs_json ( Tree const & t,
CharOwningContainer * cont,
bool append = false )

(2) like (1), but use default emit options

Definition at line 139 of file emit_container.hpp.

140{
141 return emitrs_json(t, t.root_id_maybe(), EmitOptions{}, cont, append);
142}

◆ emitrs_yaml() [3/3]

template<class CharOwningContainer>
CharOwningContainer c4::yml::emitrs_yaml ( Tree const & t,
EmitOptions const & opts = {} )

(3) emit+resize: YAML to a newly-created std::string/std::vector<char>-like container.

Definition at line 147 of file emit_container.hpp.

147 {})
148{
149 CharOwningContainer c;
150 emitrs_yaml(t, t.root_id_maybe(), opts, &c);
151 return c;
152}

◆ emitrs_json() [3/3]

template<class CharOwningContainer>
CharOwningContainer c4::yml::emitrs_json ( Tree const & t,
EmitOptions const & opts = {} )

(3) emit+resize: JSON to a newly-created std::string/std::vector<char>-like container.

Definition at line 155 of file emit_container.hpp.

155 {})
156{
157 CharOwningContainer c;
158 emitrs_json(t, t.root_id_maybe(), opts, &c);
159 return c;
160}