LDK::XmlElement Class Reference

#include <LDK/XML.h>

Inheritance diagram for LDK::XmlElement:

Inheritance graph
[legend]
Collaboration diagram for LDK::XmlElement:

Collaboration graph
[legend]

Public Member Functions

 XmlElement (const char *in_value)
 Construct an element.
 XmlElement (const String &_value)
 String constructor.
 XmlElement (const XmlElement &)
void operator= (const XmlElement &base)
const char * Attribute (const char *name) const
const char * Attribute (const char *name, int *i) const
const char * Attribute (const char *name, double *d) const
int QueryIntAttribute (const char *name, int *value) const
int QueryDoubleAttribute (const char *name, double *value) const
 QueryDoubleAttribute examines the attribute - see QueryIntAttribute().
int QueryDoubleAttribute (const char *name, float *value) const
 QueryFloatAttribute examines the attribute - see QueryIntAttribute().
void SetAttribute (const char *name, const char *value)
const char * Attribute (const String &name) const
const char * Attribute (const String &name, int *i) const
const char * Attribute (const String &name, double *d) const
int QueryIntAttribute (const String &name, int *value) const
int QueryDoubleAttribute (const String &name, double *value) const
void SetAttribute (const String &_name, const String &_value)
 LDK::String form.
void SetAttribute (const String &_name, int _value)
 LDK::String form.
void SetAttribute (const char *name, int value)
void SetDoubleAttribute (const char *name, double value)
void RemoveAttribute (const char *name)
void RemoveAttribute (const String &name)
 LDK::String form.
const XmlAttributeFirstAttribute () const
 Access the first attribute in this element.
XmlAttributeFirstAttribute ()
const XmlAttributeLastAttribute () const
 Access the last attribute in this element.
XmlAttributeLastAttribute ()
virtual XmlNodeClone () const
 Creates a new Element and returns it - the returned element is a copy.
virtual void Print (SmartFile f, int depth) const
virtual const char * Parse (const char *p, XmlParsingData *data, XmlEncoding encoding)

Protected Member Functions

void CopyTo (XmlElement *target) const
void ClearThis ()
virtual void StreamOut (LDKXML_OSTREAM *out) const
const char * ReadValue (const char *in, XmlParsingData *prevData, XmlEncoding encoding)

Detailed Description

The element is a container class. It has a value, the element name, and can contain other elements, text, comments, and unknowns. Elements also contain an arbitrary number of attributes.

Definition at line 826 of file XML.h.


Member Function Documentation

const char* LDK::XmlElement::Attribute ( const char *  name  )  const

Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists.

Referenced by LDK::FromXmlAttribute< T, MT >::fromXml().

const char* LDK::XmlElement::Attribute ( const char *  name,
int *  i 
) const

Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an integer, the integer value will be put in the return 'i', if 'i' is non-null.

const char* LDK::XmlElement::Attribute ( const char *  name,
double *  d 
) const

Given an attribute name, Attribute() returns the value for the attribute of that name, or null if none exists. If the attribute exists and can be converted to an double, the double value will be put in the return 'd', if 'd' is non-null.

int LDK::XmlElement::QueryIntAttribute ( const char *  name,
int *  value 
) const

QueryIntAttribute examines the attribute - it is an alternative to the Attribute() method with richer error checking. If the attribute is an integer, it is stored in 'value' and the call returns LDKXML_SUCCESS. If it is not an integer, it returns LDKXML_WRONG_TYPE. If the attribute does not exist, then LDKXML_NO_ATTRIBUTE is returned.

void LDK::XmlElement::SetAttribute ( const char *  name,
const char *  value 
)

Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does.

Referenced by LDK::StlContainerPtrBinding< T, VecT >::intoXml(), LDK::StlContainerXmlBinding< T, VecT >::intoXml(), and LDK::FromXmlAttribute< T, MT >::intoXml().

void LDK::XmlElement::SetAttribute ( const char *  name,
int  value 
)

Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does.

void LDK::XmlElement::SetDoubleAttribute ( const char *  name,
double  value 
)

Sets an attribute of name to a given value. The attribute will be created if it does not exist, or changed if it does.

void LDK::XmlElement::RemoveAttribute ( const char *  name  ) 

Deletes an attribute with the given name.

virtual void LDK::XmlElement::Print ( SmartFile  f,
int  depth 
) const [virtual]

All TinyXml classes can print themselves to a filestream. This is a formatted print, and will insert tabs and newlines.

(For an unformatted stream, use the << operator.)

Implements LDK::XmlBase.


The documentation for this class was generated from the following file:
Generated on Fri Aug 17 18:32:28 2007 for LDK by  doxygen 1.5.1