Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::io::IIrrXMLWriter< char_type, super_class > Class Template Referenceabstract

Interface providing methods for making it easier to write XML files. More...

#include <nirtcpp/core/engine/irrXML.hpp>

Inheritance diagram for nirt::io::IIrrXMLWriter< char_type, super_class >:
Inheritance graph
Collaboration diagram for nirt::io::IIrrXMLWriter< char_type, super_class >:
Collaboration graph

Public Member Functions

virtual ~IIrrXMLWriter ()
 Destructor.
 
virtual void writeXMLHeader ()=0
 Writes an xml 1.0 header.
 
virtual void writeElement (const char_type *name, bool empty=false, const char_type *attr1Name=0, const char_type *attr1Value=0, const char_type *attr2Name=0, const char_type *attr2Value=0, const char_type *attr3Name=0, const char_type *attr3Value=0, const char_type *attr4Name=0, const char_type *attr4Value=0, const char_type *attr5Name=0, const char_type *attr5Value=0)=0
 
virtual void writeElement (const char_type *name, bool empty, core::array< core::string< char_type > > &names, core::array< core::string< char_type > > &values)=0
 Writes an xml element with any number of attributes.
 
virtual void writeComment (const char_type *comment)=0
 Writes a comment into the xml file.
 
virtual void writeClosingTag (const char_type *name)=0
 Writes the closing tag for an element. Like "</foo>".
 
virtual void writeText (const char_type *text)=0
 Writes a text into the file.
 
virtual void writeLineBreak ()=0
 Writes a line break.
 

Detailed Description

template<class char_type, class super_class>
class nirt::io::IIrrXMLWriter< char_type, super_class >

Interface providing methods for making it easier to write XML files.

Member Function Documentation

◆ writeElement()

template<class char_type , class super_class >
virtual void nirt::io::IIrrXMLWriter< char_type, super_class >::writeElement ( const char_type *  name,
bool  empty = false,
const char_type *  attr1Name = 0,
const char_type *  attr1Value = 0,
const char_type *  attr2Name = 0,
const char_type *  attr2Value = 0,
const char_type *  attr3Name = 0,
const char_type *  attr3Value = 0,
const char_type *  attr4Name = 0,
const char_type *  attr4Value = 0,
const char_type *  attr5Name = 0,
const char_type *  attr5Value = 0 
)
pure virtual

Writes an xml element with maximal 5 attributes like "<foo />" or <foo optAttr="value" />. The element can be empty or not.

Parameters
nameName of the element
emptySpecifies if the element should be empty. Like "<foo />". If You set this to false, something like this is written instead: "<foo>".
attr1Name1st attributes name
attr1Value1st attributes value
attr2Name2nd attributes name
attr2Value2nd attributes value
attr3Name3rd attributes name
attr3Value3rd attributes value
attr4Name4th attributes name
attr4Value4th attributes value
attr5Name5th attributes name
attr5Value5th attributes value

◆ writeText()

template<class char_type , class super_class >
virtual void nirt::io::IIrrXMLWriter< char_type, super_class >::writeText ( const char_type *  text)
pure virtual

Writes a text into the file.

All occurrences of special characters such as & (&), < (<), > (>), and " (") are automatically replaced.

◆ writeXMLHeader()

template<class char_type , class super_class >
virtual void nirt::io::IIrrXMLWriter< char_type, super_class >::writeXMLHeader ( )
pure virtual

Writes an xml 1.0 header.

Looks like <?xml version="1.0"?>. This should always be called before writing anything other, because also the text file header for Unicode texts is written out with this method.


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

Nirtcpp    @cppfx.xyz

Esvcpp    esv::print