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 (ConstNodeRef const &n, 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 (ConstNodeRef const &n, CharOwningContainer *cont, bool append=false)
 (2) like (1), but use default emit options
template<class CharOwningContainer>
substr c4::yml::emitrs_json (ConstNodeRef const &n, 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 (ConstNodeRef const &n, CharOwningContainer *cont, bool append=false)
 (2) like (1), but use default emit options
template<class CharOwningContainer>
CharOwningContainer c4::yml::emitrs_yaml (ConstNodeRef const &n, 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 (ConstNodeRef const &n, 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 ( ConstNodeRef const & n,
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 176 of file emit_container.hpp.

177{
178 if(!n.readable())
179 return {};
180 return emitrs_yaml(*n.tree(), n.id(), opts, cont, append);
181}
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 ( ConstNodeRef const & n,
CharOwningContainer * cont,
bool append = false )

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

Definition at line 184 of file emit_container.hpp.

185{
186 if(!n.readable())
187 return {};
188 return emitrs_yaml(*n.tree(), n.id(), EmitOptions{}, cont, append);
189}

◆ emitrs_json() [1/3]

template<class CharOwningContainer>
substr c4::yml::emitrs_json ( ConstNodeRef const & n,
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 196 of file emit_container.hpp.

197{
198 if(!n.readable())
199 return {};
200 return emitrs_json(*n.tree(), n.id(), opts, cont, append);
201}
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 ( ConstNodeRef const & n,
CharOwningContainer * cont,
bool append = false )

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

Definition at line 204 of file emit_container.hpp.

205{
206 if(!n.readable())
207 return {};
208 return emitrs_json(*n.tree(), n.id(), EmitOptions{}, cont, append);
209}

◆ emitrs_yaml() [3/3]

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

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

Definition at line 214 of file emit_container.hpp.

214 {})
215{
216 CharOwningContainer c;
217 if(n.readable())
218 emitrs_yaml(*n.tree(), n.id(), opts, &c);
219 return c;
220}

◆ emitrs_json() [3/3]

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

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

Definition at line 223 of file emit_container.hpp.

223 {})
224{
225 CharOwningContainer c;
226 if(n.readable())
227 emitrs_json(*n.tree(), n.id(), opts, &c);
228 return c;
229}