From 7028cbe09c688437910a25623098762bf0fa592d Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 28 Mar 2016 22:28:34 +1000 Subject: Move Irrlicht to src/others. --- .../irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h | 76 ++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/others/irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h') diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h b/src/others/irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h new file mode 100644 index 0000000..9a69e71 --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/CXMLWriter.h @@ -0,0 +1,76 @@ +// Copyright (C) 2002-2012 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#ifndef __C_XML_WRITER_H_INCLUDED__ +#define __C_XML_WRITER_H_INCLUDED__ + +#include +#include "IXMLWriter.h" +#include "IWriteFile.h" + +namespace irr +{ +namespace io +{ + + //! Interface providing methods for making it easier to write XML files. + class CXMLWriter : public IXMLWriter + { + public: + + //! Constructor + CXMLWriter(IWriteFile* file); + + //! Destructor + virtual ~CXMLWriter(); + + //! Writes a xml 1.0 header like + virtual void writeXMLHeader(); + + //! Writes an xml element with maximal 5 attributes + virtual void writeElement(const wchar_t* name, bool empty=false, + const wchar_t* attr1Name = 0, const wchar_t* attr1Value = 0, + const wchar_t* attr2Name = 0, const wchar_t* attr2Value = 0, + const wchar_t* attr3Name = 0, const wchar_t* attr3Value = 0, + const wchar_t* attr4Name = 0, const wchar_t* attr4Value = 0, + const wchar_t* attr5Name = 0, const wchar_t* attr5Value = 0); + + //! Writes an xml element with any number of attributes + virtual void writeElement(const wchar_t* name, bool empty, + core::array &names, core::array &values); + + //! Writes a comment into the xml file + virtual void writeComment(const wchar_t* comment); + + //! Writes the closing tag for an element. Like + virtual void writeClosingTag(const wchar_t* name); + + //! Writes a text into the file. All occurrences of special characters like + //! & (&), < (<), > (>), and " (") are automaticly replaced. + virtual void writeText(const wchar_t* text); + + //! Writes a line break + virtual void writeLineBreak(); + + struct XMLSpecialCharacters + { + wchar_t Character; + const wchar_t* Symbol; + }; + + private: + + void writeAttribute(const wchar_t* att, const wchar_t* name); + + IWriteFile* File; + s32 Tabs; + + bool TextWrittenLast; + }; + +} // end namespace irr +} // end namespace io + +#endif + -- cgit v1.1