|
rapidyaml 0.15.2
parse and emit YAML, and do it fast
|
Implementation utils for serializing scalars in a tree's arena. More...
Functions | |
| template<class T> | |
| csubstr | c4::yml::serialize_to_arena_scalar (Tree *tree, T const &scalar) |
| Serialize a scalar to the tree's arena. | |
| csubstr | c4::yml::serialize_to_arena_str (Tree *tree, csubstr scalar) |
| Serialize a string type (as specified by c4::is_string) to a tree's arena, ensuring that there is an entry for the string in the arena even if the string is empty. | |
| template<class T> | |
| csubstr | c4::yml::serialize_to_arena (Tree *tree, T const &scalar) |
| Serialize a scalar to a tree's arena, dispatching to either serialize_to_arena_scalar() or serialize_to_arena_str() when the type is a string according to c4::is_string. | |
| csubstr | c4::yml::serialize_to_arena (Tree *, std::nullptr_t) noexcept |
| implementation for null values | |
Implementation utils for serializing scalars in a tree's arena.
These functions are implementation helpers used by Tree::to_arena() and NodeRef::to_arena() to grow the tree arena as needed and serialize scalars in it. There should be no reason to call these functions directly.
They can be overriden by the user to customize behavior for a user type, but generally there should be no reason to do so – if you think there is, please open an issue in github.
Serialize a scalar to the tree's arena.
Forward to scalar_serialize(), giving it the tree's arena and resizing the arena as needed to fit the result.
This is an implementation helper for serialize_to_arena(), serializing through scalar_serialize().
Definition at line 1754 of file tree.hpp.
Referenced by serialize_to_arena(), serialize_to_arena_scalar(), and serialize_to_arena_str().
Serialize a string type (as specified by c4::is_string) to a tree's arena, ensuring that there is an entry for the string in the arena even if the string is empty.
This is an implementation helper for serialize_to_arena(), serializing through scalar_serialize() and then ensuring that the serialized string will be placed in the arena, even if the string is zero-length.
Definition at line 27 of file tree.cpp.
Referenced by serialize_to_arena(), and serialize_to_arena_str().
Serialize a scalar to a tree's arena, dispatching to either serialize_to_arena_scalar() or serialize_to_arena_str() when the type is a string according to c4::is_string.
This is the entry point for customizing how a scalar is serialized to a tree's arena. It is never needed for the user to call this function, and generally there is no reason for overriding this function for user types, unless it has specific requirements for the tree's arena, as happens for example with string types. For user string types, defining c4::is_string is enough. For example:
Definition at line 109 of file tree.hpp.
Referenced by serialize_to_arena(), serialize_to_arena(), c4::yml::Tree::to_arena(), write(), and write_key().