XmlElement Class Reference

#include <XmlElement.h>

Inherits Support.

Inherited by XmlAttributeElement, XmlDataElement, and XmlRegistryElement.

Inheritance diagram for XmlElement:

Inheritance graph
[legend]
Collaboration diagram for XmlElement:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 XmlElement (const String &tag, XmlAttribute *attr=NULL, const String &innerData="", XmlElement *nextChild=NULL, XmlElement *nextSibling=NULL)
virtual ~XmlElement ()
String tag () const
String id () const
int setId (const String &id)
String name () const
int setName (const String &name)
int attribute (const String &name, String &value) const
XmlAttributeCollection atributes () const
int setAttribute (const String &name, const String &value)
bool hasChildren () const
XmlElementCollectionchildren () const
int appendChild (XmlElement *element)
int detachChild (XmlElement *element)
int removeChild (XmlElement *element)
int removeChildren ()
XmlDocumentdocument () const
XmlElementparent () const
String innerData () const
int setInnerData (const String &data)
int appendInnerData (const String &data)
int toString (String &str) const

Protected Member Functions

virtual int close ()

Private Member Functions

int setDocument (const XmlDocument *doc)
int setParent (const XmlElement *parent)
int _toString (String &str, unsigned int &indent) const

Private Attributes

String _tag
XmlDocument_document
XmlElement_parent
XmlElement_nextSibling
String _innerData
XmlAttributeCollection _attributes
XmlElementCollection _children

Friends

class XmlDocument

Detailed Description

Definition at line 40 of file XmlElement.h.


Constructor & Destructor Documentation

XmlElement::XmlElement ( const String tag,
XmlAttribute attr = NULL,
const String innerData = "",
XmlElement nextChild = NULL,
XmlElement nextSibling = NULL 
)

Definition at line 13 of file XmlElement.cpp.

References _attributes, appendChild(), CHECK_PARENT, ERROR_BACKTRACE(), FAILED(), Support::failure(), XmlAttribute::name(), XmlAttribute::next(), and XmlAttribute::value().

XmlElement::~XmlElement (  )  [virtual]

Definition at line 46 of file XmlElement.cpp.


Member Function Documentation

String XmlElement::tag (  )  const

Definition at line 50 of file XmlElement.cpp.

References _tag.

Referenced by XmlDocument::_getElementsByTagName(), XmlAttributeElement::close(), and S11n< T >::fromXml().

String XmlElement::id (  )  const

Definition at line 55 of file XmlElement.cpp.

References _attributes, MSG_XML_ELEMENT_ATTR_NOT_FOUND, WARNING, and XML_ATTR_ID.

Referenced by setId().

int XmlElement::setId ( const String id  ) 

Definition at line 65 of file XmlElement.cpp.

References _attributes, id(), OK, and XML_ATTR_ID.

String XmlElement::name (  )  const

Definition at line 71 of file XmlElement.cpp.

References _attributes, MSG_XML_ELEMENT_ATTR_NOT_FOUND, WARNING, and XML_ATTR_NAME.

Referenced by XmlDocument::_getElementsByName(), attribute(), setAttribute(), and setName().

int XmlElement::setName ( const String name  ) 

Definition at line 81 of file XmlElement.cpp.

References _attributes, name(), OK, and XML_ATTR_NAME.

int XmlElement::attribute ( const String name,
String value 
) const

Definition at line 87 of file XmlElement.cpp.

References _attributes, CSTRING(), MSG_XML_ELEMENT_ATTR_NOT_FOUND, name(), OK, and WARNING.

Referenced by XmlRegistryElement::defaultValue(), S11n< T >::fromXml(), S11n< T >::fromXmlAttrValue(), XmlRegistryElement::type(), XmlRegistryElement::value(), and XmlDataElement::XmlDataElement().

XmlAttributeCollection XmlElement::atributes (  )  const

Definition at line 99 of file XmlElement.cpp.

References _attributes.

int XmlElement::setAttribute ( const String name,
const String value 
)

Definition at line 104 of file XmlElement.cpp.

References _attributes, name(), and OK.

Referenced by XmlAttributeElement::close(), and S11n< T >::toXmlAttrValue().

bool XmlElement::hasChildren (  )  const

Definition at line 110 of file XmlElement.cpp.

References _children.

Referenced by XmlDocument::_getElementsByName(), XmlDocument::_getElementsByTagName(), and _toString().

XmlElementCollection * XmlElement::children (  )  const

Definition at line 115 of file XmlElement.cpp.

References _children.

Referenced by S11n< T >::fromXml().

int XmlElement::appendChild ( XmlElement element  ) 

Definition at line 120 of file XmlElement.cpp.

References _children, ERROR, ERROR_BACKTRACE(), FAILED(), MSG_NULL_POINTER, OK, and setParent().

Referenced by XmlDocument::start(), S11n< T >::toXml(), and XmlElement().

int XmlElement::detachChild ( XmlElement element  ) 

Definition at line 135 of file XmlElement.cpp.

References _children, ERROR, ERROR_BACKTRACE(), FAILED(), MSG_NULL_POINTER, MSG_XML_ELEMENT_NOT_FOUND, OK, setParent(), and WARNING.

Referenced by removeChild().

int XmlElement::removeChild ( XmlElement element  ) 

Definition at line 160 of file XmlElement.cpp.

References detachChild(), ERROR_BACKTRACE(), FAILED(), and OK.

Referenced by XmlDocument::removeElement().

int XmlElement::removeChildren (  ) 

Definition at line 170 of file XmlElement.cpp.

References _children, and OK.

Referenced by S11n< T >::toXml(), and S11n< T >::toXmlAttrValue().

XmlDocument * XmlElement::document (  )  const

Definition at line 183 of file XmlElement.cpp.

References _document.

XmlElement * XmlElement::parent (  )  const

Definition at line 188 of file XmlElement.cpp.

References _parent.

Referenced by XmlAttributeElement::close(), XmlDocument::end(), XmlDocument::removeElement(), and setParent().

String XmlElement::innerData (  )  const

Definition at line 193 of file XmlElement.cpp.

References _innerData.

Referenced by XmlAttributeElement::close(), and S11n< T >::fromXml().

int XmlElement::setInnerData ( const String data  ) 

Definition at line 198 of file XmlElement.cpp.

References _innerData, OK, and String::trim().

Referenced by S11n< T >::toXml().

int XmlElement::appendInnerData ( const String data  ) 

Definition at line 205 of file XmlElement.cpp.

References _innerData, OK, and String::trim().

Referenced by XmlDocument::data().

int XmlElement::toString ( String str  )  const

Definition at line 212 of file XmlElement.cpp.

References _toString(), ERROR_BACKTRACE(), FAILED(), and OK.

Referenced by Config::save().

int XmlElement::close (  )  [protected, virtual]

Reimplemented in XmlAttributeElement.

Definition at line 227 of file XmlElement.cpp.

References OK.

Referenced by XmlDocument::end().

int XmlElement::setDocument ( const XmlDocument doc  )  [private]

Definition at line 234 of file XmlElement.cpp.

References _document, and OK.

int XmlElement::setParent ( const XmlElement parent  )  [private]

Definition at line 240 of file XmlElement.cpp.

References _nextSibling, _parent, ERROR_BACKTRACE(), FAILED(), OK, parent(), and setParent().

Referenced by appendChild(), detachChild(), and setParent().

int XmlElement::_toString ( String str,
unsigned int &  indent 
) const [private]

Definition at line 253 of file XmlElement.cpp.

References _attributes, _children, _innerData, _tag, String::eol(), ERROR_BACKTRACE(), FAILED(), hasChildren(), OK, and XML_INDENT.

Referenced by toString().


Friends And Related Function Documentation

friend class XmlDocument [friend]

Definition at line 43 of file XmlElement.h.


Member Data Documentation

String XmlElement::_tag [private]

Definition at line 91 of file XmlElement.h.

Referenced by _toString(), and tag().

XmlDocument* XmlElement::_document [private]

Definition at line 92 of file XmlElement.h.

Referenced by document(), and setDocument().

XmlElement* XmlElement::_parent [private]

Definition at line 93 of file XmlElement.h.

Referenced by parent(), and setParent().

XmlElement* XmlElement::_nextSibling [private]

Definition at line 94 of file XmlElement.h.

Referenced by setParent().

String XmlElement::_innerData [private]

Definition at line 95 of file XmlElement.h.

Referenced by _toString(), appendInnerData(), innerData(), and setInnerData().

XmlAttributeCollection XmlElement::_attributes [private]

Definition at line 96 of file XmlElement.h.

Referenced by _toString(), atributes(), attribute(), id(), name(), setAttribute(), setId(), setName(), and XmlElement().

XmlElementCollection XmlElement::_children [private]

Definition at line 97 of file XmlElement.h.

Referenced by XmlDocument::_getElementsByName(), XmlDocument::_getElementsByTagName(), _toString(), appendChild(), children(), detachChild(), hasChildren(), and removeChildren().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:14:16 2007 for Pylon Application Platform by  doxygen 1.5.1