#include <Xml.h>
cinder::XmlTree::Attr::Attr |
( |
XmlTree * |
xml, |
|
|
const std::string & |
name, |
|
|
const std::string & |
value |
|
) |
| |
Constructs an XML attribute named name with the value value.
cinder::XmlTree::Attr::operator const std::string & |
( |
| ) |
const |
Returns an empty string for a non-existent attribute.
template<typename T >
Attr& cinder::XmlTree::Attr::operator= |
( |
const T & |
val | ) |
|
Assigns the Attr a new value, and creates it if it doesn't exist. The equivalent of calling setAttribute( this->getName(), toString( newValue ) )
.
bool cinder::XmlTree::Attr::operator== |
( |
const char * |
rhs | ) |
const |
bool cinder::XmlTree::Attr::operator== |
( |
const std::string & |
rhs | ) |
const |
bool cinder::XmlTree::Attr::operator!= |
( |
const char * |
rhs | ) |
const |
bool cinder::XmlTree::Attr::operator!= |
( |
const std::string & |
rhs | ) |
const |
template<typename T >
T cinder::XmlTree::Attr::as |
( |
| ) |
const |
bool cinder::XmlTree::Attr::empty |
( |
| ) |
const |
Returns true if the Attr value is empty.
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: