SDX::Attribute Class Reference

An attribute which holds a value and can have a name. More...

#include <SDXAttribute.h>

List of all members.

Public Member Functions

 Attribute ()
 Constructor creating an empty attribute.
 Attribute (Attribute &other)
 Copy contructor taking a reference to an attribute.
 Attribute (Attribute *other)
 Copy contructor taking a pointer to an attribute.
 Attribute (std::string value)
 Constructor creating an unnamed attribute with the given value.
 Attribute (std::string name, std::string value)
 Constructor creating an attribute with the given name and value.
bool isNamedAttribute ()
 Check whether this is a named attribute.
std::string getName ()
 Get the name of the attribute.
bool getValue (std::string *value)
 Get the value of this attribute.
template<class T >
bool getValue (T *value)
 Get the value of this attribute.
void sendToContentHandler (ContentHandler *contentHandler)
 Send this attribute to the given contentHandler.


Detailed Description

An attribute which holds a value and can have a name.

Definition at line 12 of file SDXAttribute.h.


Constructor & Destructor Documentation

Attribute::Attribute ( Attribute other  ) 

Copy contructor taking a reference to an attribute.

Parameters:
other The attribute of which this attribute should be a copy.

Definition at line 7 of file SDXAttribute.cpp.

Attribute::Attribute ( Attribute other  ) 

Copy contructor taking a pointer to an attribute.

Parameters:
other The attribute of which this attribute should be a copy.

Definition at line 13 of file SDXAttribute.cpp.

Attribute::Attribute ( std::string  value  ) 

Constructor creating an unnamed attribute with the given value.

Parameters:
value The value that this attribute should contain.

Definition at line 19 of file SDXAttribute.cpp.

SDX::Attribute::Attribute ( std::string  name,
std::string  value 
)

Constructor creating an attribute with the given name and value.

Parameters:
name The name of this attribute. If this is empty, this attribute will be unnamed.
value The value that this attribute should contain.


Member Function Documentation

std::string Attribute::getName (  ) 

Get the name of the attribute.

If this is an unnamed attribute, this function returns its value.

See also:
isNamedAttribute

Definition at line 35 of file SDXAttribute.cpp.

template<class T >
bool SDX::Attribute::getValue ( T *  value  )  [inline]

Get the value of this attribute.

Parameters:
value Variable to write value to.
Returns:
True if the value could be successfuly converted to T, false otherwise.

Definition at line 67 of file SDXAttribute.h.

bool Attribute::getValue ( std::string *  value  ) 

Get the value of this attribute.

Parameters:
value Variable to write value to.
Returns:
True if the value could be successfuly converted to T, false otherwise.

Definition at line 42 of file SDXAttribute.cpp.

bool Attribute::isNamedAttribute (  ) 

Check whether this is a named attribute.

This is determined by checking whether the name is an empty string.

Definition at line 31 of file SDXAttribute.cpp.

void Attribute::sendToContentHandler ( ContentHandler contentHandler  ) 

Send this attribute to the given contentHandler.

Parameters:
contentHandler Content handler to send attribute to.

Definition at line 50 of file SDXAttribute.cpp.


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

Generated on Mon Apr 27 16:55:48 2009 for SDX by  doxygen 1.5.8