openMSX
Public Member Functions | List of all members
openmsx::XmlInputArchive Class Referencefinal

#include <serialize.hh>

Inheritance diagram for openmsx::XmlInputArchive:
Inheritance graph
[legend]
Collaboration diagram for openmsx::XmlInputArchive:
Collaboration graph
[legend]

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)
 
bool translateEnumToString () const
 
bool canHaveOptionalAttributes () const
 
bool canCountChildren () 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)
 
bool findAttribute (const char *name, unsigned &value)
 
int countChildren () const
 
- Public Member Functions inherited from openmsx::InputArchiveBase< XmlInputArchive >
void serializeWithID (const char *tag, T &t, Args... args)
 
void serialize_blob (const char *tag, void *data, size_t len, 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< XmlInputArchive >
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...
 
bool needVersion () const
 Does this archive store version information. More...
 
bool isReverseSnapshot () const
 Is this a reverse-snapshot? More...
 
bool translateEnumToString () const
 Does this archive store enums as strings. 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 canHaveOptionalAttributes () const
 Some archives (like XML archives) can store optional attributes. More...
 
bool hasAttribute (const char *)
 Check the presence of a (optional) attribute. More...
 
bool findAttribute (const char *, unsigned &)
 Optimization: combination of hasAttribute() and getAttribute(). More...
 
bool canCountChildren () const
 Some archives (like XML archives) can count the number of subtags that belong to the current tag. 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...
 
- Public Member Functions inherited from openmsx::InputArchiveBase2
bool isLoader () const
 
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)
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::InputArchiveBase< XmlInputArchive >
 InputArchiveBase ()=default
 
- Protected Member Functions inherited from openmsx::ArchiveBase< XmlInputArchive >
XmlInputArchiveself ()
 Returns a reference to the most derived class. More...
 
- Protected Member Functions inherited from openmsx::InputArchiveBase2
 InputArchiveBase2 ()=default
 

Detailed Description

Definition at line 904 of file serialize.hh.

Constructor & Destructor Documentation

◆ XmlInputArchive()

openmsx::XmlInputArchive::XmlInputArchive ( const std::string &  filename)
explicit

Definition at line 379 of file serialize.cc.

Member Function Documentation

◆ attribute() [1/4]

void openmsx::XmlInputArchive::attribute ( const char *  name,
int &  i 
)

Definition at line 536 of file serialize.cc.

References attributeImpl().

◆ attribute() [2/4]

void openmsx::XmlInputArchive::attribute ( const char *  name,
std::string &  t 
)

Definition at line 528 of file serialize.cc.

References t.

◆ attribute() [3/4]

template<typename T >
void openmsx::XmlInputArchive::attribute ( const char *  name,
T &  t 
)
inline

Definition at line 964 of file serialize.hh.

References attributeImpl(), and t.

Referenced by attributeImpl().

◆ attribute() [4/4]

void openmsx::XmlInputArchive::attribute ( const char *  name,
unsigned &  u 
)

Definition at line 540 of file serialize.cc.

References attributeImpl().

◆ attributeImpl()

template<typename T >
void openmsx::XmlInputArchive::attributeImpl ( const char *  name,
T &  t 
)
inline

Definition at line 957 of file serialize.hh.

References attribute(), and t.

Referenced by attribute().

◆ beginTag()

void openmsx::XmlInputArchive::beginTag ( const char *  tag)

Definition at line 502 of file serialize.cc.

References strAppend().

◆ canCountChildren()

bool openmsx::XmlInputArchive::canCountChildren ( ) const
inline

Definition at line 952 of file serialize.hh.

◆ canHaveOptionalAttributes()

bool openmsx::XmlInputArchive::canHaveOptionalAttributes ( ) const
inline

Definition at line 951 of file serialize.hh.

Referenced by openmsx::loadVersionHelper().

◆ countChildren()

int openmsx::XmlInputArchive::countChildren ( ) const

Definition at line 552 of file serialize.cc.

◆ endTag()

void openmsx::XmlInputArchive::endTag ( const char *  tag)

Definition at line 516 of file serialize.cc.

◆ findAttribute()

bool openmsx::XmlInputArchive::findAttribute ( const char *  name,
unsigned &  value 
)

Definition at line 548 of file serialize.cc.

Referenced by openmsx::loadVersionHelper().

◆ hasAttribute()

bool openmsx::XmlInputArchive::hasAttribute ( const char *  name)

Definition at line 544 of file serialize.cc.

◆ load() [1/9]

void openmsx::XmlInputArchive::load ( bool &  b)

Definition at line 403 of file serialize.cc.

References loadStr().

◆ load() [2/9]

void openmsx::XmlInputArchive::load ( char &  c)

Definition at line 495 of file serialize.cc.

References load().

◆ load() [3/9]

void openmsx::XmlInputArchive::load ( int &  i)

Definition at line 468 of file serialize.cc.

References loadStr().

◆ load() [4/9]

void openmsx::XmlInputArchive::load ( signed char &  c)

Definition at line 489 of file serialize.cc.

References load().

◆ load() [5/9]

void openmsx::XmlInputArchive::load ( std::string &  t)

Definition at line 392 of file serialize.cc.

References loadStr(), and t.

◆ load() [6/9]

template<typename T >
void openmsx::XmlInputArchive::load ( T &  t)
inline

Definition at line 918 of file serialize.hh.

References t.

Referenced by load(), and loadChar().

◆ load() [7/9]

void openmsx::XmlInputArchive::load ( unsigned &  u)

Definition at line 473 of file serialize.cc.

References loadStr().

◆ load() [8/9]

void openmsx::XmlInputArchive::load ( unsigned char &  b)

Definition at line 483 of file serialize.cc.

References load().

◆ load() [9/9]

void openmsx::XmlInputArchive::load ( unsigned long long &  ull)

Definition at line 478 of file serialize.cc.

References loadStr().

◆ loadChar()

void openmsx::XmlInputArchive::loadChar ( char &  c)

Definition at line 396 of file serialize.cc.

References load().

◆ loadStr()

string_view openmsx::XmlInputArchive::loadStr ( )

Definition at line 385 of file serialize.cc.

Referenced by load().

◆ serialize()

template<typename T , typename ... Args>
ALWAYS_INLINE void openmsx::XmlInputArchive::serialize ( const char *  tag,
T &  t,
Args &&...  args 
)
inline

Definition at line 942 of file serialize.hh.

References t.

◆ skipSection()

void openmsx::XmlInputArchive::skipSection ( bool  )
inline

Definition at line 936 of file serialize.hh.

◆ translateEnumToString()

bool openmsx::XmlInputArchive::translateEnumToString ( ) const
inline

Definition at line 950 of file serialize.hh.

◆ versionAtLeast()

bool openmsx::XmlInputArchive::versionAtLeast ( unsigned  actual,
unsigned  required 
) const
inline

Definition at line 909 of file serialize.hh.

◆ versionBelow()

bool openmsx::XmlInputArchive::versionBelow ( unsigned  actual,
unsigned  required 
) const
inline

Definition at line 913 of file serialize.hh.


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