1
#ifndef CPPUNIT_TOOLS_XMLDOCUMENT_H
2
#define CPPUNIT_TOOLS_XMLDOCUMENT_H
4
#include <cppunit/Portability.h>
6
#if CPPUNIT_NEED_DLL_DECL
7
#pragma warning( push )
8
#pragma warning( disable: 4251 ) // X needs to have dll-interface to be used by clients of class Z
20
/*! \brief A XML Document.
22
* A XmlDocument represents a XML file. It holds a pointer on the root XmlElement
23
* of the document. It also holds the encoding and style sheet used.
25
* By default, the XML document is stand-alone and tagged with enconding "ISO-8859-1".
27
class CPPUNIT_API XmlDocument
30
/*! \brief Constructs a XmlDocument object.
31
* \param encoding Encoding used in the XML file (default is Latin-1, ISO-8859-1 ).
32
* \param styleSheet Name of the XSL style sheet file used. If empty then no
33
* style sheet will be specified in the output.
35
XmlDocument( const std::string &encoding = "",
36
const std::string &styleSheet = "" );
39
virtual ~XmlDocument();
41
std::string encoding() const;
42
void setEncoding( const std::string &encoding = "" );
44
std::string styleSheet() const;
45
void setStyleSheet( const std::string &styleSheet = "" );
47
bool standalone() const;
49
/*! \brief set the output document as standalone or not.
51
* For the output document, specify wether it's a standalone XML
54
* \param standalone if true, the output will be specified as standalone.
55
* if false, it will be not.
57
void setStandalone( bool standalone );
59
void setRootElement( XmlElement *rootElement );
60
XmlElement &rootElement() const;
62
std::string toString() const;
65
/// Prevents the use of the copy constructor.
66
XmlDocument( const XmlDocument © );
68
/// Prevents the use of the copy operator.
69
void operator =( const XmlDocument © );
72
std::string m_encoding;
73
std::string m_styleSheet;
74
XmlElement *m_rootElement;
79
#if CPPUNIT_NEED_DLL_DECL
80
#pragma warning( pop )
86
#endif // CPPUNIT_TOOLS_XMLDOCUMENT_H