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

freestanding write() and write_key() implementing ryml's built-in serialization of fundamental types. More...

Functions

template<class T>
void c4::yml::write (NodeRef *n, T const &v)
template<class T>
void c4::yml::write_key (NodeRef *n, T const &v)
template<class T>
void c4::yml::write (NodeRef &n, T const &v)
template<class T>
void c4::yml::write_key (NodeRef &n, T const &v)

Detailed Description

freestanding write() and write_key() implementing ryml's built-in serialization of fundamental types.

Function Documentation

◆ write() [1/2]

template<class T>
void c4::yml::write ( NodeRef * n,
T const & v )
inline

Definition at line 2114 of file node.hpp.

2115{
2116 n->tree()->set_serialized(n->id(), v); // defer to the tree implementation
2117}
Tree const * tree() const noexcept
Definition node.hpp:1210
id_type id() const noexcept
Definition node.hpp:1208
void set_serialized(id_type node, T const &val) RYML_NOEXCEPT
Definition tree.hpp:823

Referenced by c4::yml::NodeRef::save(), c4::yml::NodeRef::save(), c4::yml::NodeRef::set_serialized(), c4::yml::NodeRef::set_serialized(), write(), write(), and write().

◆ write_key() [1/2]

template<class T>
void c4::yml::write_key ( NodeRef * n,
T const & v )
inline

◆ write() [2/2]

template<class T>
void c4::yml::write ( NodeRef & n,
T const & v )
inline

Definition at line 2125 of file node.hpp.

2126{
2127 // forward to the pointer call, to ensure the user's function is
2128 // called regardless if it is write(NodeRef*,T), write(NodeRef&,T)
2129 // or write(NodeRef,T)
2130 write(&n, v);
2131}
void write(NodeRef *n, T const &v)
Definition node.hpp:2114

◆ write_key() [2/2]

template<class T>
void c4::yml::write_key ( NodeRef & n,
T const & v )
inline

Definition at line 2133 of file node.hpp.

2134{
2135 // forward to the pointer call, to ensure the user's function is
2136 // called regardless if it is write(NodeRef*,T), write(NodeRef&,T)
2137 // or write(NodeRef,T)
2138 write_key(&n, v);
2139}
void write_key(NodeRef *n, T const &v)
Definition node.hpp:2119