XML attribute. More...
#include <Xml.h>
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 > | |
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) |
XML attribute.
cinder::XmlTree::Attr::Attr | ( | const std::string & | name, | |
const std::string & | value | |||
) |
Constructs an XML attribute named name with the value value.
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.
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.
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.