1#ifndef _C4_YML_EMIT_CONTAINER_HPP_
2#define _C4_YML_EMIT_CONTAINER_HPP_
6#ifndef _C4_YML_EMIT_BUF_HPP_
9#ifndef _C4_YML_EMIT_OPTIONS_HPP_
12#ifndef _C4_YML_NODE_HPP_
34template<
class CharOwningContainer>
37 const size_t startpos = append ? cont->
size() : 0u;
38 cont->resize(cont->capacity());
41 cont->resize(startpos + ret.
len);
50template<
class CharOwningContainer>
62template<
class CharOwningContainer>
65 const size_t startpos = append ? cont->
size() : 0u;
66 cont->resize(cont->capacity());
69 cont->resize(startpos + ret.
len);
78template<
class CharOwningContainer>
86template<
class CharOwningContainer>
89 CharOwningContainer c;
94template<
class CharOwningContainer>
97 CharOwningContainer c;
116template<
class CharOwningContainer>
122template<
class CharOwningContainer>
132template<
class CharOwningContainer>
138template<
class CharOwningContainer>
146template<
class CharOwningContainer>
149 CharOwningContainer c;
154template<
class CharOwningContainer>
157 CharOwningContainer c;
175template<
class CharOwningContainer>
183template<
class CharOwningContainer>
195template<
class CharOwningContainer>
203template<
class CharOwningContainer>
213template<
class CharOwningContainer>
216 CharOwningContainer c;
222template<
class CharOwningContainer>
225 CharOwningContainer c;
Holds a pointer to an existing tree, and a node id.
id_type id() const noexcept
Tree const * tree() const noexcept
bool readable() const noexcept
because a ConstNodeRef cannot be used to write to the tree, readable() has the same meaning as !...
id_type root_id_maybe() const
Get the id of the root node, or NONE if the tree is empty.
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.
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,...
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,...
substr to_substr(char(&s)[N]) noexcept
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...
size_t len
the length of the substring
size_t size() const noexcept
basic_substring sub(size_t first) const noexcept
return [first,len[
C * str
a restricted pointer to the first character of the substring
A lightweight object containing options to be used when emitting.