openMSX
|
#include <serialize.hh>
Public Member Functions | |
XmlOutputArchive (zstring_view filename) | |
void | close () |
~XmlOutputArchive () | |
template<typename T > | |
void | saveImpl (const T &t) |
template<typename T > | |
void | save (const T &t) |
void | saveChar (char c) |
void | save (std::string_view str) |
void | save (bool b) |
void | save (unsigned char b) |
void | save (signed char c) |
void | save (char c) |
void | save (int i) |
void | save (unsigned u) |
void | save (unsigned long long ull) |
void | beginSection () const |
void | endSection () const |
template<typename T , typename ... Args> | |
ALWAYS_INLINE void | serialize (const char *tag, const T &t, Args &&...args) |
auto & | getXMLOutputStream () |
void | beginTag (const char *tag) |
void | endTag (const char *tag) |
template<typename T > | |
void | attributeImpl (const char *name, const T &t) |
template<typename T > | |
void | attribute (const char *name, const T &t) |
void | attribute (const char *name, std::string_view str) |
void | attribute (const char *name, int i) |
void | attribute (const char *name, unsigned u) |
void | write (std::span< const char > buf) |
void | write1 (char c) |
void | check (bool condition) const |
void | error () |
Public Member Functions inherited from openmsx::OutputArchiveBase< XmlOutputArchive > | |
void | serializeInlinedBase (T &t, unsigned version) |
void | serializeWithID (const char *tag, const T &t, Args...) |
void | serialize_blob (const char *tag, std::span< const uint8_t > data, bool diff=true) |
void | serialize (const char *tag, const T &t) |
void | serializePointerID (const char *tag, const T &t) |
void | serializePolymorphic (const char *tag, const T &t) |
void | serializeOnlyOnce (const char *tag, const T &t) |
void | serializeChar (const char *tag, char c) |
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::OutputArchiveBase2 | |
bool | versionAtLeast (unsigned, unsigned) const |
bool | versionBelow (unsigned, unsigned) const |
void | skipSection (bool) const |
template<typename T > | |
unsigned | generateId (const T *p) |
template<typename T > | |
unsigned | getId (const T *p) |
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::OutputArchiveBase2 | |
static constexpr bool | IS_LOADER = false |
Additional Inherited Members | |
Protected Member Functions inherited from openmsx::OutputArchiveBase< XmlOutputArchive > | |
OutputArchiveBase ()=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::OutputArchiveBase2 | |
OutputArchiveBase2 ()=default | |
Definition at line 846 of file serialize.hh.
|
explicit |
Definition at line 251 of file serialize.cc.
openmsx::XmlOutputArchive::~XmlOutputArchive | ( | ) |
Definition at line 292 of file serialize.cc.
References close().
|
inline |
Definition at line 901 of file serialize.hh.
References attributeImpl(), and t.
Referenced by attributeImpl().
void openmsx::XmlOutputArchive::attribute | ( | const char * | name, |
int | i | ||
) |
Definition at line 370 of file serialize.cc.
References attributeImpl().
void openmsx::XmlOutputArchive::attribute | ( | const char * | name, |
std::string_view | str | ||
) |
Definition at line 366 of file serialize.cc.
void openmsx::XmlOutputArchive::attribute | ( | const char * | name, |
unsigned | u | ||
) |
Definition at line 374 of file serialize.cc.
References attributeImpl().
|
inline |
Definition at line 897 of file serialize.hh.
References attribute(), t, and tmpStrCat().
Referenced by attribute(), attribute(), and attribute().
|
inline |
Definition at line 873 of file serialize.hh.
void openmsx::XmlOutputArchive::beginTag | ( | const char * | tag | ) |
Definition at line 379 of file serialize.cc.
void openmsx::XmlOutputArchive::check | ( | bool | condition | ) | const |
Definition at line 315 of file serialize.cc.
void openmsx::XmlOutputArchive::close | ( | ) |
Definition at line 280 of file serialize.cc.
References error().
Referenced by openmsx::StoreMachineCommand::execute(), and ~XmlOutputArchive().
|
inline |
Definition at line 874 of file serialize.hh.
void openmsx::XmlOutputArchive::endTag | ( | const char * | tag | ) |
Definition at line 383 of file serialize.cc.
void openmsx::XmlOutputArchive::error | ( | ) |
Definition at line 320 of file serialize.cc.
|
inline |
Definition at line 887 of file serialize.hh.
Referenced by openmsx::XMLDocument::serialize().
void openmsx::XmlOutputArchive::save | ( | bool | b | ) |
Definition at line 337 of file serialize.cc.
void openmsx::XmlOutputArchive::save | ( | char | c | ) |
Definition at line 349 of file serialize.cc.
References save().
|
inline |
Definition at line 859 of file serialize.hh.
References saveImpl(), and t.
Referenced by save(), save(), save(), and saveImpl().
void openmsx::XmlOutputArchive::save | ( | int | i | ) |
Definition at line 353 of file serialize.cc.
References saveImpl().
void openmsx::XmlOutputArchive::save | ( | signed char | c | ) |
Definition at line 345 of file serialize.cc.
References save().
void openmsx::XmlOutputArchive::save | ( | std::string_view | str | ) |
Definition at line 333 of file serialize.cc.
void openmsx::XmlOutputArchive::save | ( | unsigned char | b | ) |
Definition at line 341 of file serialize.cc.
References save().
void openmsx::XmlOutputArchive::save | ( | unsigned long long | ull | ) |
Definition at line 361 of file serialize.cc.
References saveImpl().
void openmsx::XmlOutputArchive::save | ( | unsigned | u | ) |
Definition at line 357 of file serialize.cc.
References saveImpl().
void openmsx::XmlOutputArchive::saveChar | ( | char | c | ) |
Definition at line 329 of file serialize.cc.
|
inline |
Definition at line 853 of file serialize.hh.
References save(), t, and tmpStrCat().
|
inline |
Definition at line 880 of file serialize.hh.
References openmsx::ArchiveBase< Derived >::self(), and t.
Referenced by openmsx::StoreMachineCommand::execute().
void openmsx::XmlOutputArchive::write | ( | std::span< const char > | buf | ) |
Definition at line 301 of file serialize.cc.
References error().
void openmsx::XmlOutputArchive::write1 | ( | char | c | ) |
Definition at line 308 of file serialize.cc.
References error().
|
staticconstexpr |
Definition at line 892 of file serialize.hh.
|
staticconstexpr |
Definition at line 891 of file serialize.hh.
|
staticconstexpr |
Definition at line 890 of file serialize.hh.