Mana
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
XML::Writer Class Reference

Helper class for writing out XML data. More...

#include <xml.h>

Public Member Functions

 Writer (const std::string &fileName)
 
 ~Writer ()
 
bool isValid () const
 
void startElement (const char *name)
 
void endElement ()
 
void addAttribute (const char *name, const std::string &value)
 
void addAttribute (const char *name, const char *value)
 
void addAttribute (const char *name, int value)
 
void addAttribute (const char *name, unsigned value)
 
void addAttribute (const char *name, float value)
 
void addAttribute (const char *name, bool value)
 
template<typename Enum , std::enable_if_t< std::is_enum_v< Enum >, bool > = true>
void addAttribute (const char *name, Enum &value)
 
void writeText (const std::string &text)
 

Private Attributes

xmlTextWriterPtr mWriter
 

Detailed Description

Helper class for writing out XML data.

Based on libxml2's text writing API for XML.

Definition at line 228 of file xml.h.

Constructor & Destructor Documentation

◆ Writer()

XML::Writer::Writer ( const std::string &  fileName)

Definition at line 107 of file xml.cpp.

◆ ~Writer()

XML::Writer::~Writer ( )

Definition at line 120 of file xml.cpp.

Member Function Documentation

◆ addAttribute() [1/7]

void XML::Writer::addAttribute ( const char *  name,
bool  value 
)
inline

Definition at line 296 of file xml.h.

◆ addAttribute() [2/7]

void XML::Writer::addAttribute ( const char *  name,
const char *  value 
)
inline

Definition at line 276 of file xml.h.

◆ addAttribute() [3/7]

void XML::Writer::addAttribute ( const char *  name,
const std::string &  value 
)
inline

Definition at line 271 of file xml.h.

◆ addAttribute() [4/7]

template<typename Enum , std::enable_if_t< std::is_enum_v< Enum >, bool > >
void XML::Writer::addAttribute ( const char *  name,
Enum &  value 
)
inline

Definition at line 256 of file xml.h.

◆ addAttribute() [5/7]

void XML::Writer::addAttribute ( const char *  name,
float  value 
)
inline

Definition at line 291 of file xml.h.

◆ addAttribute() [6/7]

void XML::Writer::addAttribute ( const char *  name,
int  value 
)
inline

Definition at line 281 of file xml.h.

◆ addAttribute() [7/7]

void XML::Writer::addAttribute ( const char *  name,
unsigned  value 
)
inline

Definition at line 286 of file xml.h.

◆ endElement()

void XML::Writer::endElement ( )
inline

Definition at line 266 of file xml.h.

◆ isValid()

bool XML::Writer::isValid ( ) const
inline

Definition at line 234 of file xml.h.

◆ startElement()

void XML::Writer::startElement ( const char *  name)
inline

Definition at line 261 of file xml.h.

◆ writeText()

void XML::Writer::writeText ( const std::string &  text)
inline

Definition at line 301 of file xml.h.

Member Data Documentation

◆ mWriter

xmlTextWriterPtr XML::Writer::mWriter
private

Definition at line 252 of file xml.h.


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