InspIRCd
3.0
|
#include <serialize.h>
Public Types | |
typedef insp::flat_map< std::string, Data > | ChildMap |
typedef insp::flat_map< std::string, std::string > | EntryMap |
Public Member Functions | |
const ChildMap & | GetChildren () const |
ChildMap & | GetChildren () |
const EntryMap & | GetEntries () const |
EntryMap & | GetEntries () |
Data & | Load (const std::string &key, Data &out) |
Data & | Load (const std::string &key, std::string &out) |
template<typename T > | |
Data & | Load (const std::string &key, T &out) |
Data & | Store (const std::string &key, const Data &value) |
Data & | Store (const std::string &key, const std::string &value) |
template<typename T > | |
Data & | Store (const std::string &key, const T &value) |
Encapsulates a chunk of serialised data.
typedef insp::flat_map<std::string, Data> Serializable::Data::ChildMap |
Maps keys to serialised data.
typedef insp::flat_map<std::string, std::string> Serializable::Data::EntryMap |
Maps keys to simple values.
|
inline |
Retrieves the child elements.
|
inline |
Retrieves the key/value map.
Serializable::Data & Serializable::Data::Load | ( | const std::string & | key, |
Serializable::Data & | out | ||
) |
Loads the serialised data with the specified key.
key | The key by which this serialised data is identified. |
out | The location to store the serialised data for this key. |
Serializable::Data & Serializable::Data::Load | ( | const std::string & | key, |
std::string & | out | ||
) |
Loads the value with the specified key.
key | The key by which this data is identified. |
out | The location to store the value for this keu |
|
inline |
Loads the value with the specified key. The value will be converted to the specified type.
key | The key by which this data is identified. |
out | The location to store the value for this key. |
Serializable::Data & Serializable::Data::Store | ( | const std::string & | key, |
const Data & | value | ||
) |
Stores the serialised data against the specified key.
key | The key by which this serialised data should be stored against. |
value | The serialised data to store. |
Serializable::Data & Serializable::Data::Store | ( | const std::string & | key, |
const std::string & | value | ||
) |
Stores the value against the specified key.
key | The key by which this value should be stored against. |
value | The value to store. |
|
inline |
Stores the value against the specified key. The value will be converted to a string using ConvToStr.
key | The key by which this value should be stored against. |
value | The value to store. |