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

#include <serialize.hh>

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

Public Member Functions

 XmlOutputArchive (const std::string &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 (const std::string &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 ()
 
void endSection ()
 
template<typename T , typename ... Args>
ALWAYS_INLINE void serialize (const char *tag, const 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, const T &t)
 
template<typename T >
void attribute (const char *name, const T &t)
 
void attribute (const char *name, const std::string &str)
 
void attribute (const char *name, int i)
 
void attribute (const char *name, unsigned u)
 
- 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, const void *data, size_t len, 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< XmlOutputArchive >
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::OutputArchiveBase2
bool isLoader () const
 
bool versionAtLeast (unsigned, unsigned) const
 
bool versionBelow (unsigned, unsigned) const
 
void skipSection (bool)
 
template<typename T >
unsigned generateId (const T *p)
 
template<typename T >
unsigned getId (const T *p)
 

Additional Inherited Members

- Protected Member Functions inherited from openmsx::OutputArchiveBase< XmlOutputArchive >
 OutputArchiveBase ()=default
 
- Protected Member Functions inherited from openmsx::ArchiveBase< XmlOutputArchive >
XmlOutputArchiveself ()
 Returns a reference to the most derived class. More...
 
- Protected Member Functions inherited from openmsx::OutputArchiveBase2
 OutputArchiveBase2 ()=default
 

Detailed Description

Definition at line 862 of file serialize.hh.

Constructor & Destructor Documentation

◆ XmlOutputArchive()

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

◆ ~XmlOutputArchive()

openmsx::XmlOutputArchive::~XmlOutputArchive ( )

Definition at line 298 of file serialize.cc.

References close().

Member Function Documentation

◆ attribute() [1/4]

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

Definition at line 915 of file serialize.hh.

◆ attribute() [2/4]

void openmsx::XmlOutputArchive::attribute ( const char *  name,
const std::string &  str 
)

Definition at line 348 of file serialize.cc.

◆ attribute() [3/4]

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

Definition at line 354 of file serialize.cc.

References attributeImpl().

◆ attribute() [4/4]

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

Definition at line 358 of file serialize.cc.

References attributeImpl().

◆ attributeImpl()

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

Definition at line 911 of file serialize.hh.

References strCat().

Referenced by attribute().

◆ beginSection()

void openmsx::XmlOutputArchive::beginSection ( )
inline

Definition at line 889 of file serialize.hh.

◆ beginTag()

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

Definition at line 363 of file serialize.cc.

◆ canCountChildren()

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

Definition at line 906 of file serialize.hh.

◆ canHaveOptionalAttributes()

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

Definition at line 905 of file serialize.hh.

◆ close()

void openmsx::XmlOutputArchive::close ( )

◆ endSection()

void openmsx::XmlOutputArchive::endSection ( )
inline

Definition at line 890 of file serialize.hh.

◆ endTag()

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

Definition at line 369 of file serialize.cc.

◆ save() [1/9]

template<typename T >
void openmsx::XmlOutputArchive::save ( const T &  t)
inline

Definition at line 875 of file serialize.hh.

Referenced by save(), and saveChar().

◆ save() [2/9]

void openmsx::XmlOutputArchive::save ( const std::string &  str)

Definition at line 311 of file serialize.cc.

◆ save() [3/9]

void openmsx::XmlOutputArchive::save ( bool  b)

Definition at line 317 of file serialize.cc.

◆ save() [4/9]

void openmsx::XmlOutputArchive::save ( unsigned char  b)

Definition at line 323 of file serialize.cc.

References save().

◆ save() [5/9]

void openmsx::XmlOutputArchive::save ( signed char  c)

Definition at line 327 of file serialize.cc.

References save().

◆ save() [6/9]

void openmsx::XmlOutputArchive::save ( char  c)

Definition at line 331 of file serialize.cc.

References save().

◆ save() [7/9]

void openmsx::XmlOutputArchive::save ( int  i)

Definition at line 335 of file serialize.cc.

References saveImpl().

◆ save() [8/9]

void openmsx::XmlOutputArchive::save ( unsigned  u)

Definition at line 339 of file serialize.cc.

References saveImpl().

◆ save() [9/9]

void openmsx::XmlOutputArchive::save ( unsigned long long  ull)

Definition at line 343 of file serialize.cc.

References saveImpl().

◆ saveChar()

void openmsx::XmlOutputArchive::saveChar ( char  c)

Definition at line 307 of file serialize.cc.

References save().

◆ saveImpl()

template<typename T >
void openmsx::XmlOutputArchive::saveImpl ( const T &  t)
inline

Definition at line 869 of file serialize.hh.

Referenced by save().

◆ serialize()

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

◆ translateEnumToString()

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

Definition at line 904 of file serialize.hh.


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