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_
34 template<
class CharOwningContainer>
37 const size_t startpos = append ? cont->
size() : 0u;
38 cont->resize(cont->capacity());
41 cont->resize(startpos + ret.
len);
50 template<
class CharOwningContainer>
62 template<
class CharOwningContainer>
65 const size_t startpos = append ? cont->
size() : 0u;
66 cont->resize(cont->capacity());
69 cont->resize(startpos + ret.
len);
78 template<
class CharOwningContainer>
86 template<
class CharOwningContainer>
89 CharOwningContainer c;
94 template<
class CharOwningContainer>
97 CharOwningContainer c;
116 template<
class CharOwningContainer>
122 template<
class CharOwningContainer>
132 template<
class CharOwningContainer>
138 template<
class CharOwningContainer>
146 template<
class CharOwningContainer>
149 CharOwningContainer c;
154 template<
class CharOwningContainer>
157 CharOwningContainer c;
175 template<
class CharOwningContainer>
183 template<
class CharOwningContainer>
195 template<
class CharOwningContainer>
203 template<
class CharOwningContainer>
213 template<
class CharOwningContainer>
216 CharOwningContainer c;
222 template<
class CharOwningContainer>
225 CharOwningContainer c;
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-like container, resizing it as needed to fit the emitted YAML.
id_type id() const noexcept
C * str
a restricted pointer to the first character of the substring
id_type root_id_maybe() const
Get the id of the root node, or NONE if the tree is empty.
substr to_substr(char(&s)[N]) noexcept
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-like container, resizing it as needed to fit the emitted JSON.
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...
size_t size() const noexcept
basic_substring sub(size_t first) const noexcept
return [first,len[
bool readable() const noexcept
because a ConstNodeRef cannot be used to write to the tree, readable() has the same meaning as !inval...
Utilities to emit YAML and JSON to buffers or containers.
Holds a pointer to an existing tree, and a node id.
Tree const * tree() const noexcept
size_t len
the length of the substring
substr emit_yaml(Tree const &t, EmitOptions const &opts, substr buf, bool error_on_excess)
(1) emit YAML to the given buffer.
A lightweight object containing options to be used when emitting.