cxxtools::xml::Attribute Class Reference

A class representing a single attribute of a tag from an XML document. More...

#include <cxxtools/xml/attribute.h>

Public Member Functions

 Attribute ()
 Constructs a new Attribute object with an empty name and value.
 Attribute (const String &name, const String &value)
 Constructs a new Attribute using the given name and value.
 Attribute (const String &name, const Date &value)
 Attribute (const String &name, const Time &value)
 Attribute (const String &name, const DateTime &value)
const Stringname () const
 Returns the name of this attribute.
Stringname ()
void setName (const String &name)
 Sets the name of this attribute.
const Stringvalue () const
 Returns the value of this attribute.
Stringvalue ()
void setValue (const String &value)
 Sets the value of this attribute.
void clear ()

Detailed Description

A class representing a single attribute of a tag from an XML document.

An XML attribute consists of the attribute's name and the attribute's value. The name can be retrieved using the method name(). The value can be retrieved using the method value().

The attributes of a tag are retrieved from the document when the opening tag is parsed. The attributes are stored in a StartElement object from where they can be retrieved.

Constructor & Destructor Documentation

cxxtools::xml::Attribute::Attribute ( )
inline

Constructs a new Attribute object with an empty name and value.

cxxtools::xml::Attribute::Attribute ( const String name,
const String value 
)
inline

Constructs a new Attribute using the given name and value.

Parameters
nameThe name of the XML attribute.
valueThe value of the XML attribute.
cxxtools::xml::Attribute::Attribute ( const String name,
const Date value 
)
inline
cxxtools::xml::Attribute::Attribute ( const String name,
const Time value 
)
inline
cxxtools::xml::Attribute::Attribute ( const String name,
const DateTime value 
)
inline

Member Function Documentation

void cxxtools::xml::Attribute::clear ( )
inline
const String& cxxtools::xml::Attribute::name ( ) const
inline

Returns the name of this attribute.

Returns
The attribute's name.
String& cxxtools::xml::Attribute::name ( )
inline
void cxxtools::xml::Attribute::setName ( const String name)
inline

Sets the name of this attribute.

Parameters
nameThe new name of this attribute.
void cxxtools::xml::Attribute::setValue ( const String value)
inline

Sets the value of this attribute.

Parameters
valueThe new value of this attribute.
const String& cxxtools::xml::Attribute::value ( ) const
inline

Returns the value of this attribute.

Returns
The attribute's value.
String& cxxtools::xml::Attribute::value ( )
inline

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