openMSX
|
#include <serialize.hh>
Public Member Functions | |
XmlInputArchive (const std::string &filename) | |
bool | versionAtLeast (unsigned actual, unsigned required) const |
bool | versionBelow (unsigned actual, unsigned required) const |
template<typename T > | |
void | load (T &t) |
void | loadChar (char &c) |
void | load (bool &b) |
void | load (unsigned char &b) |
void | load (signed char &c) |
void | load (char &c) |
void | load (int &i) |
void | load (unsigned &u) |
void | load (unsigned long long &ull) |
void | load (std::string &t) |
std::string_view | loadStr () |
void | skipSection (bool) |
template<typename T , typename ... Args> | |
ALWAYS_INLINE void | serialize (const char *tag, T &t, Args &&...args) |
const XMLElement * | currentElement () const |
void | beginTag (const char *tag) |
void | endTag (const char *tag) |
template<typename T > | |
void | attributeImpl (const char *name, T &t) |
template<typename T > | |
void | attribute (const char *name, T &t) |
void | attribute (const char *name, std::string &t) |
void | attribute (const char *name, int &i) |
void | attribute (const char *name, unsigned &u) |
bool | hasAttribute (const char *name) const |
int | countChildren () const |
template<typename T > | |
std::optional< T > | findAttributeAs (const char *name) |
![]() | |
void | serializeWithID (const char *tag, T &t, Args... args) |
void | serialize_blob (const char *tag, std::span< uint8_t > data, bool diff=true) |
void | serialize (const char *tag, T &t) |
void | serializePointerID (const char *tag, const T &t) |
void | serializePolymorphic (const char *tag, T &t) |
void | serializeOnlyOnce (const char *tag, const T &t) |
void | serializeChar (const char *tag, char &c) |
void | doSerialize (const char *tag, T &t, TUPLE args, int id=0) |
![]() | |
void | serializeBase (T &t) |
Is this archive a loader or a saver. More... | |
void | serializeInlinedBase (T &t, unsigned version) |
Serialize the base class of this classtype. More... | |
void | serialize_blob (const char *tag, std::span< T > data, bool diff=true) |
void | serialize_blob (const char *tag, std::span< const T > data, bool diff=true) |
bool | isReverseSnapshot () const |
Is this a reverse-snapshot? More... | |
void | attribute (const char *name, T &t) |
Load/store an attribute from/in the archive. More... | |
void | attribute (const char *name, const char *value) |
bool | hasAttribute (const char *) |
Check the presence of a (optional) attribute. More... | |
std::optional< T > | findAttributeAs (const char *) |
Optimization: combination of hasAttribute() and getAttribute(). More... | |
int | countChildren () const |
Count the number of child tags. More... | |
void | beginTag (const char *) |
Indicate begin of a tag. More... | |
void | endTag (const char *) |
Indicate begin of a tag. More... | |
![]() | |
void | beginSection () |
void | endSection () |
void * | getPointer (unsigned id) |
void | addPointer (unsigned id, const void *p) |
unsigned | getId (const void *p) const |
template<typename T > | |
void | resetSharedPtr (std::shared_ptr< T > &s, T *r) |
Static Public Attributes | |
static constexpr bool | TRANSLATE_ENUM_TO_STRING = true |
static constexpr bool | CAN_HAVE_OPTIONAL_ATTRIBUTES = true |
static constexpr bool | CAN_COUNT_CHILDREN = true |
![]() | |
static constexpr bool | NEED_VERSION |
Does this archive store version information. More... | |
static constexpr bool | TRANSLATE_ENUM_TO_STRING |
Does this archive store enums as strings. More... | |
static constexpr bool | CAN_HAVE_OPTIONAL_ATTRIBUTES |
Some archives (like XML archives) can store optional attributes. More... | |
static constexpr bool | CAN_COUNT_CHILDREN |
Some archives (like XML archives) can count the number of subtags that belong to the current tag. More... | |
![]() | |
static constexpr bool | IS_LOADER = true |
Additional Inherited Members | |
![]() | |
InputArchiveBase ()=default | |
![]() | |
XmlInputArchive & | self () |
Returns a reference to the most derived class. More... | |
![]() | |
InputArchiveBase2 ()=default | |
Definition at line 932 of file serialize.hh.
|
explicit |
Definition at line 394 of file serialize.cc.
References openmsx::XMLDocument::getRoot(), and openmsx::XMLDocument::load().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
int & | i | ||
) |
Definition at line 548 of file serialize.cc.
References attributeImpl().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
std::string & | t | ||
) |
Definition at line 540 of file serialize.cc.
References currentElement(), openmsx::XMLElement::findAttribute(), and t.
|
inline |
Definition at line 996 of file serialize.hh.
References attributeImpl(), and t.
Referenced by attributeImpl().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
unsigned & | u | ||
) |
Definition at line 552 of file serialize.cc.
References attributeImpl().
|
inline |
Definition at line 989 of file serialize.hh.
References attribute(), and t.
Referenced by attribute().
void openmsx::XmlInputArchive::beginTag | ( | const char * | tag | ) |
Definition at line 515 of file serialize.cc.
References currentElement(), Math::e, openmsx::XMLElement::findChild(), and strAppend().
int openmsx::XmlInputArchive::countChildren | ( | ) | const |
Definition at line 560 of file serialize.cc.
References currentElement().
|
inline |
Definition at line 977 of file serialize.hh.
Referenced by attribute(), beginTag(), countChildren(), endTag(), findAttributeAs(), hasAttribute(), loadStr(), and openmsx::XMLDocument::serialize().
void openmsx::XmlInputArchive::endTag | ( | const char * | tag | ) |
Definition at line 528 of file serialize.cc.
References openmsx::XMLElement::clearName(), and currentElement().
|
inline |
Definition at line 1008 of file serialize.hh.
References currentElement().
Referenced by openmsx::loadVersionHelper().
bool openmsx::XmlInputArchive::hasAttribute | ( | const char * | name | ) | const |
Definition at line 556 of file serialize.cc.
References currentElement(), and openmsx::XMLElement::findAttribute().
void openmsx::XmlInputArchive::load | ( | bool & | b | ) |
Definition at line 419 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::load | ( | char & | c | ) |
Definition at line 508 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | int & | i | ) |
Definition at line 471 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::load | ( | signed char & | c | ) |
Definition at line 502 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | std::string & | t | ) |
Definition at line 408 of file serialize.cc.
|
inline |
Definition at line 946 of file serialize.hh.
Referenced by load(), and loadChar().
void openmsx::XmlInputArchive::load | ( | unsigned & | u | ) |
Definition at line 476 of file serialize.cc.
void openmsx::XmlInputArchive::load | ( | unsigned char & | b | ) |
Definition at line 496 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | unsigned long long & | ull | ) |
Definition at line 491 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::loadChar | ( | char & | c | ) |
Definition at line 412 of file serialize.cc.
References load().
string_view openmsx::XmlInputArchive::loadStr | ( | ) |
Definition at line 401 of file serialize.cc.
References currentElement(), and openmsx::XMLElement::getData().
Referenced by load().
|
inline |
Definition at line 970 of file serialize.hh.
References openmsx::ArchiveBase< XmlInputArchive >::self(), serialize(), and t.
Referenced by openmsx::RestoreMachineCommand::execute(), and serialize().
|
inline |
Definition at line 964 of file serialize.hh.
|
inline |
Definition at line 937 of file serialize.hh.
|
inline |
Definition at line 941 of file serialize.hh.
|
staticconstexpr |
Definition at line 984 of file serialize.hh.
|
staticconstexpr |
Definition at line 983 of file serialize.hh.
Referenced by openmsx::loadVersionHelper().
|
staticconstexpr |
Definition at line 982 of file serialize.hh.