1#ifndef C4_YML_STD_VECTOR_HPP_
2#define C4_YML_STD_VECTOR_HPP_
11C4_SUPPRESS_WARNING_GCC_WITH_PUSH(
"-Wuseless-cast")
18template<class T, class Alloc>
22 for(T
const& val : vec)
23 tree->set_serialized(tree->append_child(
id), val);
27template<
class T,
class Alloc>
38 for(T
const& val : vec)
51template<
class T,
class Alloc>
54 if C4_UNLIKELY(!tree->
is_seq(
id))
63 T &val = vec->emplace_back();
66 T &val = (*vec)[pos++];
78template<
class T,
class Alloc>
88 if C4_UNLIKELY(!node.
is_seq())
97 T &val = vec->emplace_back();
100 T &val = (*vec)[pos++];
105 if(!child.deserialize(&val))
121 if C4_UNLIKELY(!tree->
is_seq(
id))
144C4_SUPPRESS_WARNING_GCC_POP
Holds a pointer to an existing tree, and a node id.
id_type id() const noexcept
const_children_view children() const RYML_NOEXCEPT
get an iterable view over children
Tree const * tree() const noexcept
A reference to a node in an existing yaml tree, offering a more convenient API than the index-based A...
id_type first_child(id_type node) const
csubstr const & val(id_type node) const
ReadResult deserialize(id_type node, T *v) const
(1) deserialize a node's contents to a variable
id_type next_sibling(id_type node) const
bool is_seq(id_type node) const
provides conversion and comparison facilities from/between std::vector<char> to c4::substr and c4::cs...
bool from_chars(csubstr buf, uint8_t *v) noexcept
ReadResult read(ConstNodeRef const &n, T *v)
void write(NodeRef *n, T const &v)
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...
A lightweight truthy type, used to enable reporting the offending node when a deserializing error hap...
bool is_seq() const RYML_NOEXCEPT
Forward to Tree::is_seq().