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 |
void | loadChar (char &c) const |
void | load (bool &b) const |
void | load (unsigned char &b) const |
void | load (signed char &c) const |
void | load (char &c) const |
void | load (int &i) const |
void | load (unsigned &u) const |
void | load (unsigned long long &ull) const |
void | load (std::string &t) const |
template<typename T > | |
void | load (T &t) const |
std::string_view | loadStr () const |
void | skipSection (bool) const |
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) const |
template<typename T > | |
void | attribute (const char *name, T &t) |
void | attribute (const char *name, std::string &t) const |
void | attribute (const char *name, int &i) const |
void | attribute (const char *name, unsigned &u) const |
bool | hasAttribute (const char *name) const |
int | countChildren () const |
template<typename T > | |
std::optional< T > | findAttributeAs (const char *name) |
Public Member Functions inherited from openmsx::InputArchiveBase< XmlInputArchive > | |
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) |
Public Member Functions inherited from openmsx::ArchiveBase< Derived > | |
template<typename Base , typename T > | |
void | serializeBase (T &t) |
Is this archive a loader or a saver. | |
template<typename Base , typename T > | |
void | serializeInlinedBase (T &t, unsigned version) |
Serialize the base class of this classtype. | |
template<typename T > | |
void | serialize_blob (const char *tag, std::span< T > data, bool diff=true) |
template<typename T > | |
void | serialize_blob (const char *tag, std::span< const T > data, bool diff=true) |
bool | isReverseSnapshot () const |
Is this a reverse-snapshot? | |
template<typename T > | |
void | attribute (const char *name, T &t) |
Load/store an attribute from/in the archive. | |
void | attribute (const char *name, const char *value) |
bool | hasAttribute (const char *) const |
Check the presence of a (optional) attribute. | |
template<typename T > | |
std::optional< T > | findAttributeAs (const char *) |
Optimization: combination of hasAttribute() and getAttribute(). | |
int | countChildren () const |
Count the number of child tags. | |
void | beginTag (const char *) const |
Indicate begin of a tag. | |
void | endTag (const char *) const |
Indicate begin of a tag. | |
Public Member Functions inherited from openmsx::InputArchiveBase2 | |
void | beginSection () const |
void | endSection () const |
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 Public Attributes inherited from openmsx::ArchiveBase< Derived > | |
static constexpr bool | NEED_VERSION = true |
Does this archive store version information. | |
static constexpr bool | TRANSLATE_ENUM_TO_STRING = false |
Does this archive store enums as strings. | |
static constexpr bool | CAN_HAVE_OPTIONAL_ATTRIBUTES = false |
Some archives (like XML archives) can store optional attributes. | |
static constexpr bool | CAN_COUNT_CHILDREN = false |
Some archives (like XML archives) can count the number of subtags that belong to the current tag. | |
Static Public Attributes inherited from openmsx::InputArchiveBase2 | |
static constexpr bool | IS_LOADER = true |
Additional Inherited Members | |
Protected Member Functions inherited from openmsx::InputArchiveBase< XmlInputArchive > | |
InputArchiveBase ()=default | |
Protected Member Functions inherited from openmsx::ArchiveBase< Derived > | |
Derived & | self () |
Returns a reference to the most derived class. | |
Protected Member Functions inherited from openmsx::InputArchiveBase2 | |
InputArchiveBase2 ()=default | |
Definition at line 921 of file serialize.hh.
|
explicit |
Definition at line 390 of file serialize.cc.
References openmsx::XMLDocument::getRoot(), and openmsx::XMLDocument::load().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
int & | i | ||
) | const |
Definition at line 544 of file serialize.cc.
References attributeImpl().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
std::string & | t | ||
) | const |
Definition at line 536 of file serialize.cc.
References currentElement(), openmsx::XMLElement::findAttribute(), and t.
|
inline |
Definition at line 985 of file serialize.hh.
References attributeImpl(), and t.
Referenced by attributeImpl().
void openmsx::XmlInputArchive::attribute | ( | const char * | name, |
unsigned & | u | ||
) | const |
Definition at line 548 of file serialize.cc.
References attributeImpl().
|
inline |
Definition at line 978 of file serialize.hh.
References attribute(), and t.
Referenced by attribute(), attribute(), and attribute().
void openmsx::XmlInputArchive::beginTag | ( | const char * | tag | ) |
Definition at line 511 of file serialize.cc.
References currentElement(), openmsx::XMLElement::findChild(), and strAppend().
int openmsx::XmlInputArchive::countChildren | ( | ) | const |
Definition at line 556 of file serialize.cc.
References currentElement().
|
inline |
Definition at line 966 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 524 of file serialize.cc.
References openmsx::XMLElement::clearName(), and currentElement().
|
inline |
Definition at line 997 of file serialize.hh.
References currentElement().
Referenced by openmsx::loadVersionHelper().
bool openmsx::XmlInputArchive::hasAttribute | ( | const char * | name | ) | const |
Definition at line 552 of file serialize.cc.
References currentElement(), and openmsx::XMLElement::findAttribute().
void openmsx::XmlInputArchive::load | ( | bool & | b | ) | const |
Definition at line 415 of file serialize.cc.
References loadStr().
Referenced by load(), load(), load(), load(), and loadChar().
void openmsx::XmlInputArchive::load | ( | char & | c | ) | const |
Definition at line 504 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | int & | i | ) | const |
Definition at line 467 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::load | ( | signed char & | c | ) | const |
Definition at line 498 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | std::string & | t | ) | const |
Definition at line 404 of file serialize.cc.
|
inline |
Definition at line 944 of file serialize.hh.
void openmsx::XmlInputArchive::load | ( | unsigned & | u | ) | const |
Definition at line 472 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::load | ( | unsigned char & | b | ) | const |
Definition at line 492 of file serialize.cc.
References load().
void openmsx::XmlInputArchive::load | ( | unsigned long long & | ull | ) | const |
Definition at line 487 of file serialize.cc.
References loadStr().
void openmsx::XmlInputArchive::loadChar | ( | char & | c | ) | const |
Definition at line 408 of file serialize.cc.
References load().
string_view openmsx::XmlInputArchive::loadStr | ( | ) | const |
Definition at line 397 of file serialize.cc.
References currentElement(), and openmsx::XMLElement::getData().
|
inline |
Definition at line 959 of file serialize.hh.
References openmsx::ArchiveBase< Derived >::self(), and t.
Referenced by openmsx::RestoreMachineCommand::execute(), and openmsx::YMF278B::serialize_bw_compat().
|
inline |
Definition at line 953 of file serialize.hh.
|
inline |
Definition at line 926 of file serialize.hh.
Referenced by openmsx::YMF278B::serialize_bw_compat().
|
inline |
Definition at line 930 of file serialize.hh.
|
staticconstexpr |
Definition at line 973 of file serialize.hh.
|
staticconstexpr |
Definition at line 972 of file serialize.hh.
Referenced by openmsx::loadVersionHelper().
|
staticconstexpr |
Definition at line 971 of file serialize.hh.