A light-weight handle for manipulating attributes in DOM tree. More...
#include <attribute.h>
Public Member Functions | |
Attribute () | |
Constructs an empty Attribute. | |
Attribute (AttributeStruct *attr) | |
Constructs attribute from internal pointer. More... | |
bool | AsBool (bool def=false) const |
Attempts to convert the value of the attribute to a float and returns the results. More... | |
double | AsDouble (double def=0) const |
Attempts to convert the value of the attribute to a double and returns the results. More... | |
float | AsFloat (float def=0) const |
Attempts to convert the value of the attribute to a float and returns the results. More... | |
int | AsInt (int def=0) const |
Attempts to convert the value of the attribute to an int and returns the results. More... | |
Integer | AsInteger (Integer def=0) const |
Attempts to convert the value of the attribute to a Integer and returns the results. More... | |
Real | AsReal (Real def=0) const |
Attempts to convert the value of the attribute to a Real and returns the results. More... | |
const Char8 * | AsString (const Char8 *def="") const |
Attempts to convert the value of the attribute to a String and returns the results. More... | |
unsigned int | AsUint (unsigned int def=0) const |
Attempts to convert the value of the attribute to an unsigned int and returns the results. More... | |
Whole | AsWhole (Whole def=0) const |
Attempts to convert the value of the attribute to a Whole and returns the results. More... | |
bool | Empty () const |
Is this storing anything at all? More... | |
Attribute | GetNextAttribute () const |
Get the next attribute. More... | |
Attribute | GetPreviousAttribute () const |
Get the previous attribute. More... | |
size_t | HashValue () const |
Get a unique identifying value for the Attribute this represents. More... | |
AttributeStruct * | InternalObject () const |
Retrieve a pointer to the internal data. More... | |
const Char8 * | Name () const |
Get the name of this Attribute. More... | |
operator unspecified_bool_type () const | |
Used to convert this to a boolean value in a safe way. More... | |
bool | operator! () const |
Used to convert this attribute the opposite of it's normal boolean value. More... | |
bool | operator!= (const Attribute &r) const |
Compares the internal values to check inequality. More... | |
bool | operator< (const Attribute &r) const |
Compares the internal values to check for inequality. More... | |
bool | operator<= (const Attribute &r) const |
Compares the internal values to check for inequality. More... | |
Attribute & | operator= (const Char8 *rhs) |
The same as Attribute::SetValue(); without the error return. More... | |
Attribute & | operator= (int rhs) |
The same as Attribute::SetValue(); without the error return. More... | |
Attribute & | operator= (unsigned int rhs) |
The same as Attribute::SetValue(); without the error return. More... | |
Attribute & | operator= (double rhs) |
The same as Attribute::SetValue(); without the error return. More... | |
Attribute & | operator= (bool rhs) |
The same as Attribute::SetValue(); without the error return. More... | |
bool | operator== (const Attribute &r) const |
Compares the internal values to check equality. More... | |
bool | operator> (const Attribute &r) const |
Compares the internal values to check for inequality. More... | |
bool | operator>= (const Attribute &r) const |
Compares the internal values to check for inequality. More... | |
bool | SetName (const Char8 *rhs) |
Set the name of . More... | |
bool | SetName (const String &rhs) |
Set the name of this object. More... | |
bool | SetValue (const Char8 *rhs) |
Set the value of this. More... | |
bool | SetValue (int rhs) |
Convert rhs to a character array that contains rhs, then use that as the new value. More... | |
bool | SetValue (unsigned int rhs) |
Convert rhs to a character array that contains rhs, then use that as the new value. More... | |
bool | SetValue (double rhs) |
Convert rhs to a character array that contains rhs, then use that as the new value. More... | |
bool | SetValue (bool rhs) |
Convert rhs to a character array that contains the meaning of rhs, then use that as the new value. More... | |
template<class T > | |
bool | SetValue (T rhs) |
Convert rhs to a character array that contains the meaning of rhs, then use that as the new value. More... | |
bool | SetValue (const String &rhs) |
Set the value of this. More... | |
const Char8 * | Value () const |
Get the Value of this Attribute. More... | |
Friends | |
class | AttributeIterator |
class | Node |
A light-weight handle for manipulating attributes in DOM tree.
Definition at line 74 of file attribute.h.
|
explicit |
Constructs attribute from internal pointer.
attr | An internal AttributeStruct pointer containing all the data to create an attribute. |
bool Mezzanine::XML::Attribute::AsBool | ( | bool | def = false | ) | const |
Attempts to convert the value of the attribute to a float and returns the results.
def | Is returned if the attribute is empty |
double Mezzanine::XML::Attribute::AsDouble | ( | double | def = 0 | ) | const |
Attempts to convert the value of the attribute to a double and returns the results.
def | Is returned if the attribute is empty |
float Mezzanine::XML::Attribute::AsFloat | ( | float | def = 0 | ) | const |
Attempts to convert the value of the attribute to a float and returns the results.
def | Is returned if the attribute is empty |
int Mezzanine::XML::Attribute::AsInt | ( | int | def = 0 | ) | const |
Attempts to convert the value of the attribute to an int and returns the results.
def | Is returned if the attribute is empty. |
Attempts to convert the value of the attribute to a Integer and returns the results.
def | Is returned if the attribute is empty |
This | can throw exception in certain overflow conditions |
Attempts to convert the value of the attribute to a Real and returns the results.
def | Is returned if the attribute is empty |
This | can throw exception in certain overflow conditions |
Attempts to convert the value of the attribute to a String and returns the results.
def | Is returned if the attribute is empty |
This | can throw exception in certain overflow conditions |
unsigned int Mezzanine::XML::Attribute::AsUint | ( | unsigned int | def = 0 | ) | const |
Attempts to convert the value of the attribute to an unsigned int and returns the results.
def | Is returned if the attribute is empty |
Attempts to convert the value of the attribute to a Whole and returns the results.
def | Is returned if the attribute is empty |
This | can throw exception in certain overflow conditions |
bool Mezzanine::XML::Attribute::Empty | ( | ) | const |
Is this storing anything at all?
Attribute Mezzanine::XML::Attribute::GetNextAttribute | ( | ) | const |
Get the next attribute.
This will get the next sibling attribute. That is, another Attribute on the same node as this attribute. This is internally a circular linked list, so once you reach the end, you simply be given the first node. If this attribute is empty this will return a empty attribute.
Attribute Mezzanine::XML::Attribute::GetPreviousAttribute | ( | ) | const |
Get the previous attribute.
This will get the previous sibling attribute. That is, another Attribute on the same node as this attribute. This is internally a circular linked list, so once you reach the beginning, you simply be given the last node. If this attribute is empty this will return a empty attribute.
size_t Mezzanine::XML::Attribute::HashValue | ( | ) | const |
AttributeStruct* Mezzanine::XML::Attribute::InternalObject | ( | ) | const |
Retrieve a pointer to the internal data.
const Char8* Mezzanine::XML::Attribute::Name | ( | ) | const |
Get the name of this Attribute.
Mezzanine::XML::Attribute::operator unspecified_bool_type | ( | ) | const |
Used to convert this to a boolean value in a safe way.
bool Mezzanine::XML::Attribute::operator! | ( | ) | const |
Used to convert this attribute the opposite of it's normal boolean value.
This is described in the PugiXML source a a workaround for a borland c++ issue.
bool Mezzanine::XML::Attribute::operator!= | ( | const Attribute & | r | ) | const |
Compares the internal values to check inequality.
r | The other Attribute this is being compared to. |
Many of the internal values are pointers, and it is the addresses of these that are being compared.
bool Mezzanine::XML::Attribute::operator< | ( | const Attribute & | r | ) | const |
Compares the internal values to check for inequality.
r | The other Attribute this is being compared to. |
Many of the internal values are pointers, and it is the addresses of these that are being compared.
bool Mezzanine::XML::Attribute::operator<= | ( | const Attribute & | r | ) | const |
Compares the internal values to check for inequality.
r | The other Attribute this is being compared to. |
Many of the internal values are pointers, and it is the addresses of these that are being compared.
The same as Attribute::SetValue(); without the error return.
rhs | The new value as an c-style string. |
Attribute& Mezzanine::XML::Attribute::operator= | ( | int | rhs | ) |
The same as Attribute::SetValue(); without the error return.
rhs | The new value as an int. |
Attribute& Mezzanine::XML::Attribute::operator= | ( | unsigned int | rhs | ) |
The same as Attribute::SetValue(); without the error return.
rhs | The new value as an unsigned int. |
Attribute& Mezzanine::XML::Attribute::operator= | ( | double | rhs | ) |
The same as Attribute::SetValue(); without the error return.
rhs | The new value as a double. |
Attribute& Mezzanine::XML::Attribute::operator= | ( | bool | rhs | ) |
The same as Attribute::SetValue(); without the error return.
rhs | This with be interpretted, then converted to "true" or "false" and used as the new value. |
bool Mezzanine::XML::Attribute::operator== | ( | const Attribute & | r | ) | const |
bool Mezzanine::XML::Attribute::operator> | ( | const Attribute & | r | ) | const |
Compares the internal values to check for inequality.
r | The other Attribute this is being compared to. |
Many of the internal values are pointers, and it is the addresses of these that are being compared.
bool Mezzanine::XML::Attribute::operator>= | ( | const Attribute & | r | ) | const |
Compares the internal values to check for inequality.
r | The other Attribute this is being compared to. |
Many of the internal values are pointers, and it is the addresses of these that are being compared.
bool Mezzanine::XML::Attribute::SetName | ( | const Char8 * | rhs | ) |
Set the name of .
rhs | The desired name. |
|
inline |
Set the name of this object.
rhs | The desired name . |
Definition at line 235 of file attribute.h.
bool Mezzanine::XML::Attribute::SetValue | ( | const Char8 * | rhs | ) |
Set the value of this.
rhs | The new Value. |
update this to make the error return code redundant and use an exception instead.
Review for possiblity of buffer overflow.
bool Mezzanine::XML::Attribute::SetValue | ( | int | rhs | ) |
Convert rhs to a character array that contains rhs, then use that as the new value.
rhs | The new value as an int. |
update this to make the error return code redundant and use an exception instead.
Review for possiblity of buffer overflow.
bool Mezzanine::XML::Attribute::SetValue | ( | unsigned int | rhs | ) |
Convert rhs to a character array that contains rhs, then use that as the new value.
rhs | The new value as an unsigned int. |
update this to make the error return code redundant and use an exception instead.
Review for possiblity of buffer overflow.
bool Mezzanine::XML::Attribute::SetValue | ( | double | rhs | ) |
Convert rhs to a character array that contains rhs, then use that as the new value.
rhs | The new value as a double. |
update this to make the error return code redundant and use an exception instead.
Review for possiblity of buffer overflow.
bool Mezzanine::XML::Attribute::SetValue | ( | bool | rhs | ) |
Convert rhs to a character array that contains the meaning of rhs, then use that as the new value.
rhs | This with be interpretted, then converted to "true" or "false" and used as the new value. |
update this to make the error return code redundant and use an exception instead.
Review for possiblity of buffer overflow.
|
inline |
Convert rhs to a character array that contains the meaning of rhs, then use that as the new value.
rhs | This with be converted to a character array using the appropriate streaming operator <<, then used as the new value. |
Definition at line 285 of file attribute.h.
|
inline |
Set the value of this.
rhs | The new Value. |
Definition at line 294 of file attribute.h.
const Char8* Mezzanine::XML::Attribute::Value | ( | ) | const |
Get the Value of this Attribute.