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 837 of file serialize.hh.

Constructor & Destructor Documentation

◆ XmlOutputArchive()

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

◆ ~XmlOutputArchive()

openmsx::XmlOutputArchive::~XmlOutputArchive ( )

Definition at line 299 of file serialize.cc.

References close().

Member Function Documentation

◆ attribute() [1/4]

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

Definition at line 349 of file serialize.cc.

◆ attribute() [2/4]

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

Definition at line 890 of file serialize.hh.

References attributeImpl(), and t.

Referenced by attributeImpl().

◆ attribute() [3/4]

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

Definition at line 355 of file serialize.cc.

References attributeImpl().

◆ attribute() [4/4]

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

Definition at line 359 of file serialize.cc.

References attributeImpl().

◆ attributeImpl()

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

Definition at line 886 of file serialize.hh.

References attribute(), strCat(), and t.

Referenced by attribute().

◆ beginSection()

void openmsx::XmlOutputArchive::beginSection ( )
inline

Definition at line 864 of file serialize.hh.

◆ beginTag()

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

Definition at line 364 of file serialize.cc.

◆ canCountChildren()

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

Definition at line 881 of file serialize.hh.

◆ canHaveOptionalAttributes()

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

Definition at line 880 of file serialize.hh.

◆ close()

void openmsx::XmlOutputArchive::close ( )

◆ endSection()

void openmsx::XmlOutputArchive::endSection ( )
inline

Definition at line 865 of file serialize.hh.

◆ endTag()

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

Definition at line 370 of file serialize.cc.

◆ save() [1/9]

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

Definition at line 318 of file serialize.cc.

◆ save() [2/9]

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

Definition at line 332 of file serialize.cc.

References save().

◆ save() [3/9]

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

Definition at line 312 of file serialize.cc.

◆ save() [4/9]

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

Definition at line 850 of file serialize.hh.

References saveImpl(), and t.

Referenced by save(), saveChar(), and saveImpl().

◆ save() [5/9]

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

Definition at line 336 of file serialize.cc.

References saveImpl().

◆ save() [6/9]

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

Definition at line 328 of file serialize.cc.

References save().

◆ save() [7/9]

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

Definition at line 324 of file serialize.cc.

References save().

◆ save() [8/9]

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

Definition at line 344 of file serialize.cc.

References saveImpl().

◆ save() [9/9]

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

Definition at line 340 of file serialize.cc.

References saveImpl().

◆ saveChar()

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

Definition at line 308 of file serialize.cc.

References save().

◆ saveImpl()

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

Definition at line 844 of file serialize.hh.

References save(), strCat(), and t.

Referenced by save().

◆ serialize()

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

Definition at line 871 of file serialize.hh.

References t.

Referenced by openmsx::StoreMachineCommand::execute().

◆ translateEnumToString()

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

Definition at line 879 of file serialize.hh.


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