CppUnit - The Unit Testing Library

CppUnit project page | FAQ

Public Member Functions | Protected Attributes | Private Member Functions | List of all members
XmlDocument Class Reference

A XML Document. More...

`#include <XmlDocument.h>`

Collaboration diagram for XmlDocument:
[legend]

## Public Member Functions
| XmlDocument (const std::string &encoding="", const std::string &styleSheet="")
| Constructs a XmlDocument object.
virtual | ~XmlDocument ()
| Destructor.
std::string | encoding () const
void | setEncoding (const std::string &encoding="")
std::string | styleSheet () const
void | setStyleSheet (const std::string &styleSheet="")
bool | standalone () const
void | setStandalone (bool standalone)
| set the output document as standalone or not.
void | setRootElement (XmlElement *rootElement)
XmlElement & | rootElement () const
std::string | toString () const

## Protected Attributes
std::string | m_encoding
std::string | m_styleSheet
XmlElement * | m_rootElement
bool | m_standalone

## Private Member Functions
| XmlDocument (const XmlDocument &copy)
| Prevents the use of the copy constructor.
void | operator= (const XmlDocument &copy)
| Prevents the use of the copy operator.

## Detailed Description

A XML Document.

A XmlDocument represents a XML file. It holds a pointer on the root XmlElement of the document. It also holds the encoding and style sheet used.

By default, the XML document is stand-alone and tagged with enconding "ISO-8859-1".

## Constructor & Destructor Documentation

## ◆ XmlDocument() [1/2]

CPPUNIT_NS_BEGIN XmlDocument::XmlDocument | ( | const std::string & | encoding = "",
|  | const std::string & | styleSheet = "" )

Constructs a XmlDocument object.

Parameters

  encoding | Encoding used in the XML file (default is Latin-1, ISO-8859-1 ).
  styleSheet | Name of the XSL style sheet file used. If empty then no style sheet will be specified in the output.

## ◆ ~XmlDocument()

XmlDocument::~XmlDocument | ( |  | ) |
| virtual

Destructor.

## ◆ XmlDocument() [2/2]

XmlDocument::XmlDocument | ( | const XmlDocument & | copy | ) |
| private

Prevents the use of the copy constructor.

## Member Function Documentation

## ◆ encoding()

std::string XmlDocument::encoding | ( |  | ) | const

## ◆ operator=()

void XmlDocument::operator= | ( | const XmlDocument & | copy | ) |
| private

Prevents the use of the copy operator.

## ◆ rootElement()

XmlElement & XmlDocument::rootElement | ( |  | ) | const

## ◆ setEncoding()

void XmlDocument::setEncoding | ( | const std::string & | encoding = "" | ) |

## ◆ setRootElement()

void XmlDocument::setRootElement | ( | XmlElement * | rootElement | ) |

## ◆ setStandalone()

void XmlDocument::setStandalone | ( | bool | standalone | ) |

set the output document as standalone or not.

For the output document, specify wether it's a standalone XML document, or not.

Parameters

  standalone | if true, the output will be specified as standalone. if false, it will be not.

## ◆ setStyleSheet()

void XmlDocument::setStyleSheet | ( | const std::string & | styleSheet = "" | ) |

## ◆ standalone()

bool XmlDocument::standalone | ( |  | ) | const

## ◆ styleSheet()

std::string XmlDocument::styleSheet | ( |  | ) | const

## ◆ toString()

std::string XmlDocument::toString | ( |  | ) | const

## Member Data Documentation

## ◆ m_encoding

std::string XmlDocument::m_encoding
| protected

## ◆ m_rootElement

XmlElement* XmlDocument::m_rootElement
| protected

## ◆ m_standalone

bool XmlDocument::m_standalone
| protected

## ◆ m_styleSheet

std::string XmlDocument::m_styleSheet
| protected

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

- XmlDocument.h
- XmlDocument.cpp

| Send comments to: CppUnit Developers