Unravel Engine C++ Reference
Loading...
Searching...
No Matches
ser20::YAMLInputArchive Class Reference

#include <yaml.hpp>

Inheritance diagram for ser20::YAMLInputArchive:

Public Member Functions

 YAMLInputArchive (std::istream &stream)
 
 ~YAMLInputArchive () noexcept=default
 
void loadBinaryValue (void *data, size_t size, const char *name=nullptr)
 Loads some binary data, encoded as a base64 string.
 

Internal Functionality

Functionality designed for use by those requiring control over the inner mechanisms of the YAMLInputArchive

void startNode ()
 Starts a new node, going into its proper iterator.
 
void finishNode ()
 Finishes the most recently started node.
 
const char * getNodeName () const
 Retrieves the current node name.
 
void setNextName (const char *name)
 Sets the name for the next node created with startNode.
 
template<class T >
requires (std::is_signed<T>::value && sizeof(T) < sizeof(int64_t))
void loadValue (T &val)
 Loads a value from the current node - small signed overload.
 
template<class T >
requires (std::is_unsigned<T>::value && sizeof(T) < sizeof(uint64_t) && !std::is_same<bool, T>::value)
void loadValue (T &val)
 Loads a value from the current node - small unsigned overload.
 
void loadValue (bool &val)
 Loads a value from the current node - bool overload.
 
void loadValue (int64_t &val)
 Loads a value from the current node - int64 overload.
 
void loadValue (uint64_t &val)
 Loads a value from the current node - uint64 overload.
 
void loadValue (float &val)
 Loads a value from the current node - float overload.
 
void loadValue (double &val)
 Loads a value from the current node - double overload.
 
void loadValue (std::string &val)
 Loads a value from the current node - string overload.
 
void loadValue (std::nullptr_t &)
 Loads a nullptr from the current node.
 
template<class T >
std::enable_if< std::is_same< T, long >::value &&sizeof(T)>=sizeof(std::int64_t)&&!std::is_same< T, std::int64_t >::value, void >::type loadValue (T &t)
 Serialize a long if it would not be caught otherwise.
 
template<class T >
std::enable_if< std::is_same< T, unsignedlong >::value &&sizeof(T)>=sizeof(std::uint64_t)&&!std::is_same< T, std::uint64_t >::value, void >::type loadValue (T &t)
 Serialize an unsigned long if it would not be caught otherwise.
 
template<class T >
requires (std::is_arithmetic<T>::value && !std::is_same<T, long>::value && !std::is_same<T, unsigned long>::value && !std::is_same<T, std::int64_t>::value && !std::is_same<T, std::uint64_t>::value && (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long)))
void loadValue (T &val)
 Loads a value from the current node - long double and long long overloads.
 
void loadSize (size_type &size)
 Loads the size for a SizeTag.
 

Detailed Description

Definition at line 336 of file yaml.hpp.

Constructor & Destructor Documentation

◆ YAMLInputArchive()

ser20::YAMLInputArchive::YAMLInputArchive ( std::istream & stream)
inline

Definition at line 343 of file yaml.hpp.

◆ ~YAMLInputArchive()

ser20::YAMLInputArchive::~YAMLInputArchive ( )
defaultnoexcept

Member Function Documentation

◆ finishNode()

void ser20::YAMLInputArchive::finishNode ( )
inline

Finishes the most recently started node.

Definition at line 543 of file yaml.hpp.

◆ getNodeName()

const char * ser20::YAMLInputArchive::getNodeName ( ) const
inline

Retrieves the current node name.

Returns
nullptr if no name exists

Definition at line 551 of file yaml.hpp.

◆ loadBinaryValue()

void ser20::YAMLInputArchive::loadBinaryValue ( void * data,
size_t size,
const char * name = nullptr )
inline

Loads some binary data, encoded as a base64 string.

This will automatically start and finish a node to load the data, and can be called directly by users.

Note that this follows the same ordering rules specified in the class description in regards to loading in/out of order

Definition at line 367 of file yaml.hpp.

◆ loadSize()

void ser20::YAMLInputArchive::loadSize ( size_type & size)
inline

Loads the size for a SizeTag.

Definition at line 723 of file yaml.hpp.

◆ loadValue() [1/12]

void ser20::YAMLInputArchive::loadValue ( bool & val)
inline

Loads a value from the current node - bool overload.

Definition at line 585 of file yaml.hpp.

◆ loadValue() [2/12]

void ser20::YAMLInputArchive::loadValue ( double & val)
inline

Loads a value from the current node - double overload.

Definition at line 613 of file yaml.hpp.

◆ loadValue() [3/12]

void ser20::YAMLInputArchive::loadValue ( float & val)
inline

Loads a value from the current node - float overload.

Definition at line 606 of file yaml.hpp.

◆ loadValue() [4/12]

void ser20::YAMLInputArchive::loadValue ( int64_t & val)
inline

Loads a value from the current node - int64 overload.

Definition at line 592 of file yaml.hpp.

◆ loadValue() [5/12]

void ser20::YAMLInputArchive::loadValue ( std::nullptr_t & )
inline

Loads a nullptr from the current node.

Definition at line 627 of file yaml.hpp.

◆ loadValue() [6/12]

void ser20::YAMLInputArchive::loadValue ( std::string & val)
inline

Loads a value from the current node - string overload.

Definition at line 620 of file yaml.hpp.

◆ loadValue() [7/12]

template<class T >
std::enable_if< std::is_same< T, long >::value &&sizeof(T)>=sizeof(std::int64_t)&&!std::is_same< T, std::int64_t >::value, void >::type ser20::YAMLInputArchive::loadValue ( T & t)
inline

Serialize a long if it would not be caught otherwise.

Definition at line 675 of file yaml.hpp.

◆ loadValue() [8/12]

template<class T >
std::enable_if< std::is_same< T, unsignedlong >::value &&sizeof(T)>=sizeof(std::uint64_t)&&!std::is_same< T, std::uint64_t >::value, void >::type ser20::YAMLInputArchive::loadValue ( T & t)
inline

Serialize an unsigned long if it would not be caught otherwise.

Definition at line 685 of file yaml.hpp.

◆ loadValue() [9/12]

template<class T >
requires (std::is_signed<T>::value && sizeof(T) < sizeof(int64_t))
void ser20::YAMLInputArchive::loadValue ( T & val)
inline

Loads a value from the current node - small signed overload.

Definition at line 564 of file yaml.hpp.

◆ loadValue() [10/12]

template<class T >
requires (std::is_unsigned<T>::value && sizeof(T) < sizeof(uint64_t) && !std::is_same<bool, T>::value)
void ser20::YAMLInputArchive::loadValue ( T & val)
inline

Loads a value from the current node - small unsigned overload.

Definition at line 575 of file yaml.hpp.

◆ loadValue() [11/12]

template<class T >
requires (std::is_arithmetic<T>::value && !std::is_same<T, long>::value && !std::is_same<T, unsigned long>::value && !std::is_same<T, std::int64_t>::value && !std::is_same<T, std::uint64_t>::value && (sizeof(T) >= sizeof(long double) || sizeof(T) >= sizeof(long long)))
void ser20::YAMLInputArchive::loadValue ( T & val)
inline

Loads a value from the current node - long double and long long overloads.

Definition at line 711 of file yaml.hpp.

◆ loadValue() [12/12]

void ser20::YAMLInputArchive::loadValue ( uint64_t & val)
inline

Loads a value from the current node - uint64 overload.

Definition at line 599 of file yaml.hpp.

◆ setNextName()

void ser20::YAMLInputArchive::setNextName ( const char * name)
inline

Sets the name for the next node created with startNode.

Definition at line 557 of file yaml.hpp.

◆ startNode()

void ser20::YAMLInputArchive::startNode ( )
inline

Starts a new node, going into its proper iterator.

This places an iterator for the next node to be parsed onto the iterator stack. If the next node is an array, this will be a value iterator, otherwise it will be a member iterator.

By default our strategy is to start with the document root node and then recursively iterate through all children in the order they show up in the document. We don't need to know NVPs to do this; we'll just blindly load in the order things appear in.

If we were given an NVP, we will search for it if it does not match our the name of the next node that would normally be loaded. This functionality is provided by search().

Definition at line 526 of file yaml.hpp.


The documentation for this class was generated from the following file: