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)
 
string_ref loadStr ()
 
void skipSection (bool)
 
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 ()
 
- 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 ()
 

Detailed Description

Definition at line 774 of file serialize.hh.

Constructor & Destructor Documentation

◆ XmlInputArchive()

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

Definition at line 366 of file serialize.cc.

Member Function Documentation

◆ attribute() [1/4]

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

◆ attribute() [2/4]

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

Definition at line 516 of file serialize.cc.

References openmsx::MSXException::getMessage().

◆ attribute() [3/4]

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

Definition at line 524 of file serialize.cc.

References attributeImpl().

◆ attribute() [4/4]

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

Definition at line 528 of file serialize.cc.

References attributeImpl().

◆ attributeImpl()

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

Definition at line 816 of file serialize.hh.

References openmsx::ArchiveBase< Derived >::attribute().

Referenced by attribute().

◆ beginTag()

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

Definition at line 489 of file serialize.cc.

◆ canCountChildren()

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

◆ canHaveOptionalAttributes()

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

Definition at line 810 of file serialize.hh.

Referenced by openmsx::loadVersionHelper().

◆ countChildren()

int openmsx::XmlInputArchive::countChildren ( ) const

Definition at line 540 of file serialize.cc.

◆ endTag()

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

Definition at line 504 of file serialize.cc.

◆ findAttribute()

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

Definition at line 536 of file serialize.cc.

Referenced by openmsx::loadVersionHelper().

◆ hasAttribute()

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

Definition at line 532 of file serialize.cc.

◆ load() [1/9]

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

Definition at line 788 of file serialize.hh.

References openmsx::XMLLoader::load().

Referenced by load(), and loadChar().

◆ load() [2/9]

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

Definition at line 390 of file serialize.cc.

References loadStr().

◆ load() [3/9]

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

Definition at line 470 of file serialize.cc.

References load().

◆ load() [4/9]

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

Definition at line 476 of file serialize.cc.

References load().

◆ load() [5/9]

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

Definition at line 482 of file serialize.cc.

References load().

◆ load() [6/9]

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

Definition at line 455 of file serialize.cc.

References loadStr().

◆ load() [7/9]

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

Definition at line 460 of file serialize.cc.

References loadStr().

◆ load() [8/9]

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

Definition at line 465 of file serialize.cc.

References loadStr().

◆ load() [9/9]

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

Definition at line 379 of file serialize.cc.

References loadStr(), and string_ref::str().

◆ loadChar()

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

Definition at line 383 of file serialize.cc.

References load().

◆ loadStr()

string_ref openmsx::XmlInputArchive::loadStr ( )

Definition at line 372 of file serialize.cc.

Referenced by load().

◆ skipSection()

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

Definition at line 806 of file serialize.hh.

◆ translateEnumToString()

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

Definition at line 809 of file serialize.hh.

◆ versionAtLeast()

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

Definition at line 779 of file serialize.hh.

◆ versionBelow()

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

Definition at line 783 of file serialize.hh.


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