1
// Copyright (C) 2002-2011 Nikolaus Gebhardt
2
// This file is part of the "Irrlicht Engine".
3
// For conditions of distribution and use, see copyright notice in irrlicht.h
5
#ifndef __C_XML_WRITER_H_INCLUDED__
6
#define __C_XML_WRITER_H_INCLUDED__
9
#include "IXMLWriter.h"
10
#include "IWriteFile.h"
17
//! Interface providing methods for making it easier to write XML files.
18
class CXMLWriter : public IXMLWriter
23
CXMLWriter(IWriteFile* file);
26
virtual ~CXMLWriter();
28
//! Writes a xml 1.0 header like <?xml version="1.0"?>
29
virtual void writeXMLHeader();
31
//! Writes an xml element with maximal 5 attributes
32
virtual void writeElement(const wchar_t* name, bool empty=false,
33
const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0,
34
const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0,
35
const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0,
36
const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0,
37
const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0);
39
//! Writes an xml element with any number of attributes
40
virtual void writeElement(const wchar_t* name, bool empty,
41
core::array<core::stringw> &names, core::array<core::stringw> &values);
43
//! Writes a comment into the xml file
44
virtual void writeComment(const wchar_t* comment);
46
//! Writes the closing tag for an element. Like </foo>
47
virtual void writeClosingTag(const wchar_t* name);
49
//! Writes a text into the file. All occurrences of special characters like
50
//! & (&), < (<), > (>), and " (") are automaticly replaced.
51
virtual void writeText(const wchar_t* text);
53
//! Writes a line break
54
virtual void writeLineBreak();
56
struct XMLSpecialCharacters
59
const wchar_t* Symbol;
64
void writeAttribute(const wchar_t* att, const wchar_t* name);
72
} // end namespace irr