cereal
A C++11 library for serialization
 All Classes Files Functions Variables Typedefs Enumerations Groups
Classes | Public Member Functions | Static Public Member Functions | List of all members
cereal::XMLInputArchive Class Reference

An output archive designed to save data to XML. More...

#include <cereal/archives/xml.hpp>

Inheritance diagram for cereal::XMLInputArchive:
cereal::InputArchive< XMLInputArchive > cereal::detail::InputArchiveBase

Classes

struct  NodeInfo
 A struct that contains metadata about a node. More...
 

Public Member Functions

 XMLInputArchive (std::istream &stream)
 Construct, reading in from the provided stream. More...
 
void startNode ()
 Prepares to start reading the next node.
 
void finishNode ()
 Finishes reading the current node.
 
template<class T >
void loadValue (T &value)
 Loads a value from the current node.
 
template<class CharT , class Traits , class Alloc >
void loadValue (std::basic_string< CharT, Traits, Alloc > &str)
 Loads a string from the current node.
 
void loadBinaryValue (void *data, size_t size)
 Loads some binary data, encoded as a base64 string. More...
 
template<class T >
void loadSize (T &value)
 Loads the size of the current node.
 
- Public Member Functions inherited from cereal::InputArchive< XMLInputArchive >
 InputArchive (XMLInputArchive *const self)
 Construct the output archive. More...
 
XMLInputArchiveoperator() (Types &&...args)
 Serializes all passed in data.
 
std::shared_ptr< void > getSharedPointer (std::uint32_t const id)
 Retrieves a shared pointer given a unique key for it. More...
 
void registerSharedPointer (std::uint32_t const id, std::shared_ptr< void > ptr)
 Registers a shared pointer to its unique identifier. More...
 
std::string getPolymorphicName (std::uint32_t const id)
 Retrieves the string for a polymorphic type given a unique key for it. More...
 
void registerPolymorphicName (std::uint32_t const id, std::string const &name)
 Registers a polymorphic name string to its unique identifier. More...
 

Static Public Member Functions

static size_t getNumChildren (rapidxml::xml_node<> *node=nullptr)
 Gets the number of children (usually interpreted as size) for the specified node.
 

Detailed Description

An output archive designed to save data to XML.

Constructor & Destructor Documentation

cereal::XMLInputArchive::XMLInputArchive ( std::istream &  stream)
inline

Construct, reading in from the provided stream.

Reads in an entire XML document from some stream and parses it as soon as serialization starts

Parameters
streamThe stream to read from. Can be a stringstream or a file.

Member Function Documentation

void cereal::XMLInputArchive::loadBinaryValue ( void *  data,
size_t  size 
)
inline

Loads some binary data, encoded as a base64 string.

This will automatically start and finish a node to load the data


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