1#ifndef CPPUNIT_TOOLS_XMLELEMENT_H
2#define CPPUNIT_TOOLS_XMLELEMENT_H
6#if CPPUNIT_NEED_DLL_DECL
8#pragma warning( disable: 4251 )
20#if CPPUNIT_NEED_DLL_DECL
57 std::string
name()
const;
122 std::string
toString(
const std::string &indent =
"" )
const;
128 std::string
escape( std::string value )
const;
144#if CPPUNIT_NEED_DLL_DECL
145#pragma warning( pop )
#define CPPUNIT_API
Definition CppUnitApi.h:27
#define CppUnitDeque
Definition CppUnitDeque.h:20
#define CPPUNIT_NS_END
Definition Portability.h:120
#define CPPUNIT_NS_BEGIN
Definition Portability.h:119
A XML Element.
Definition XmlElement.h:34
void setName(const std::string &name)
Sets the name of the element.
Definition XmlElement.cpp:51
void addAttribute(std::string attributeName, std::string value)
Adds an attribute with the specified string value.
Definition XmlElement.cpp:72
std::string escape(std::string value) const
Definition XmlElement.cpp:193
std::string attributesAsString() const
Definition XmlElement.cpp:173
Attributes m_attributes
Definition XmlElement.h:135
void addElement(XmlElement *element)
Adds a child element to the element.
Definition XmlElement.cpp:88
std::string content() const
Returns the content of the element.
Definition XmlElement.cpp:44
std::string m_name
Definition XmlElement.h:131
XmlElement * elementFor(const std::string &name) const
Returns the first child element with the specified name.
Definition XmlElement.cpp:112
XmlElement * elementAt(int index) const
Returns the child element at the specified index.
Definition XmlElement.cpp:102
CppUnitDeque< XmlElement * > Elements
Definition XmlElement.h:137
void setContent(const std::string &content)
Sets the content of the element.
Definition XmlElement.cpp:58
std::string m_content
Definition XmlElement.h:132
std::string name() const
Returns the name of the element.
Definition XmlElement.cpp:37
std::string toString(const std::string &indent="") const
Returns a XML string that represents the element.
Definition XmlElement.cpp:127
XmlElement(std::string elementName, std::string content="")
Constructs an element with the specified name and string content.
Definition XmlElement.cpp:9
int elementCount() const
Returns the number of child elements.
Definition XmlElement.cpp:95
CppUnitDeque< Attribute > Attributes
Definition XmlElement.h:134
std::pair< std::string, std::string > Attribute
Definition XmlElement.h:125
Elements m_elements
Definition XmlElement.h:138