cinder::XmlTree::Attr Class Reference

XML attribute. More...

#include <Xml.h>

List of all members.

Public Member Functions

 Attr (const std::string &name, const std::string &value)
 Constructs an XML attribute named name with the value value.
const std::string & getName () const
 Returns the name of the attribute as a string.
std::string getValue () const
 Returns the value of the attribute as a string.
template<typename T >
getValue () const
 Returns the value of the attribute parsed as a T. Requires T to support the istream>> operator.
float size = myAttr.getValue<float>( "size" );
void setValue (const std::string &value)
template<typename T >
void setValue (const T &value)

Detailed Description

XML attribute.


Constructor & Destructor Documentation

cinder::XmlTree::Attr::Attr ( const std::string &  name,
const std::string &  value 
)

Constructs an XML attribute named name with the value value.


Member Function Documentation

const std::string& cinder::XmlTree::Attr::getName (  )  const

Returns the name of the attribute as a string.

std::string cinder::XmlTree::Attr::getValue (  )  const

Returns the value of the attribute as a string.

template<typename T >
T cinder::XmlTree::Attr::getValue (  )  const

Returns the value of the attribute parsed as a T. Requires T to support the istream>> operator.
float size = myAttr.getValue<float>( "size" );

void cinder::XmlTree::Attr::setValue ( const std::string &  value  ) 

Sets the value of the attribute to value.

template<typename T >
void cinder::XmlTree::Attr::setValue ( const T &  value  ) 

Sets the value of the attribute to value, which is cast to a string first. Requires T to support the ostream<< operator.


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