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 CPPUNIT_NS_END
Definition Portability.h:106
#define CPPUNIT_NS_BEGIN
Definition Portability.h:105
A XML Element.
Definition XmlElement.h:34
void setName(const std::string &name)
Sets the name of the element.
Definition XmlElement.cpp:56
void addAttribute(std::string attributeName, std::string value)
Adds an attribute with the specified string value.
Definition XmlElement.cpp:77
std::deque< Attribute > Attributes
Definition XmlElement.h:134
std::string escape(std::string value) const
Definition XmlElement.cpp:198
std::string attributesAsString() const
Definition XmlElement.cpp:178
Attributes m_attributes
Definition XmlElement.h:135
void addElement(XmlElement *element)
Adds a child element to the element.
Definition XmlElement.cpp:93
std::string content() const
Returns the content of the element.
Definition XmlElement.cpp:49
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:117
XmlElement * elementAt(int index) const
Returns the child element at the specified index.
Definition XmlElement.cpp:107
std::deque< XmlElement * > Elements
Definition XmlElement.h:137
void setContent(const std::string &content)
Sets the content of the element.
Definition XmlElement.cpp:63
std::string m_content
Definition XmlElement.h:132
std::string name() const
Returns the name of the element.
Definition XmlElement.cpp:42
std::string toString(const std::string &indent="") const
Returns a XML string that represents the element.
Definition XmlElement.cpp:132
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:100
std::pair< std::string, std::string > Attribute
Definition XmlElement.h:125
Elements m_elements
Definition XmlElement.h:138