|
Functionality designed for use by those requiring control over the inner mechanisms of the YAMLOutputArchive
|
void | startNode () |
| Starts a new node in the YAML output.
|
|
void | finishNode () |
| Designates the most recently added node as finished.
|
|
void | setNextName (const char *name) |
| Sets the name for the next node created with startNode.
|
|
void | saveValue (bool b) |
| Saves a bool to the current node.
|
|
void | saveValue (int i) |
| Saves an int to the current node.
|
|
void | saveValue (unsigned u) |
| Saves a uint to the current node.
|
|
void | saveValue (int64_t i64) |
| Saves an int64 to the current node.
|
|
void | saveValue (uint64_t u64) |
| Saves a uint64 to the current node.
|
|
void | saveValue (double d) |
| Saves a double to the current node.
|
|
void | saveValue (std::string const &s) |
| Saves a string to the current node.
|
|
void | saveValue (char const *s) |
| Saves a const char * to the current node.
|
|
void | saveValue (std::nullptr_t) |
| Saves a nullptr to the current node.
|
|
template<class T >
requires (std::is_same_v<T, long> && !std::is_same_v<T, int> && !std::is_same_v<T, std::int64_t>) |
void | saveValue (T t) |
| Serialize a long if it would not be caught otherwise.
|
|
template<class T >
requires (std::is_same_v<T, unsigned long> && !std::is_same_v<T, unsigned> && !std::is_same_v<T, std::uint64_t>) |
void | saveValue (T t) |
| Serialize an unsigned long if it would not be caught otherwise.
|
|
template<class T >
requires (std::is_arithmetic_v<T> && !std::is_same_v<T, long> && !std::is_same_v<T, unsigned long> && !std::is_same_v<T, std::int64_t> && !std::is_same_v<T, std::uint64_t> && !std::is_same_v<T, long long> && !std::is_same_v<T, unsigned long long> && (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long))) |
void | saveValue (T const &t) |
| Save exotic arithmetic as strings to current node.
|
|
void | writeName () |
| Write the name of the upcoming node and prepare object/array state.
|
|
void | makeArray () |
| Designates that the current node should be output as an array, not an object.
|
|
Definition at line 48 of file yaml.hpp.
void ser20::YAMLOutputArchive::saveBinaryValue |
( |
const void * | data, |
|
|
size_t | size, |
|
|
const char * | name = nullptr ) |
|
inline |
Saves some binary data, encoded as a base64 string, with an optional name.
This will create a new node, optionally named, and insert a value that consists of the data encoded as a base64 string
Definition at line 86 of file yaml.hpp.
template<class T >
requires (std::is_arithmetic_v<T> && !std::is_same_v<T, long> && !std::is_same_v<T, unsigned long> && !std::is_same_v<T, std::int64_t> && !std::is_same_v<T, std::uint64_t> && !std::is_same_v<T, long long> && !std::is_same_v<T, unsigned long long> && (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long)))
void ser20::YAMLOutputArchive::saveValue |
( |
T const & | t | ) |
|
|
inline |
Save exotic arithmetic as strings to current node.
Handles long long (if distinct from other types), unsigned long (if distinct), and long double
Definition at line 256 of file yaml.hpp.
template<class T >
requires (std::is_same_v<T, long> && !std::is_same_v<T, int> && !std::is_same_v<T, std::int64_t>)
void ser20::YAMLOutputArchive::saveValue |
( |
T | t | ) |
|
|
inline |
Serialize a long if it would not be caught otherwise.
Definition at line 237 of file yaml.hpp.
template<class T >
requires (std::is_same_v<T, unsigned long> && !std::is_same_v<T, unsigned> && !std::is_same_v<T, std::uint64_t>)
void ser20::YAMLOutputArchive::saveValue |
( |
T | t | ) |
|
|
inline |
Serialize an unsigned long if it would not be caught otherwise.
Definition at line 245 of file yaml.hpp.
void ser20::YAMLOutputArchive::writeName |
( |
| ) |
|
|
inline |
Write the name of the upcoming node and prepare object/array state.
Since writeName is called for every value that is output, regardless of whether it has a name or not, it is the place where we will do a deferred check of our node state and decide whether we are in an array or an object.
The general workflow of saving to the YAML archive is:
- (optional) Set the name for the next node to be created, usually done by an NVP
- Start the node
- (if there is data to save) Write the name of the node (this function)
- (if there is data to save) Save the data (with saveValue)
- Finish the node
Definition at line 281 of file yaml.hpp.