57 #ifndef _xmlattribute_h
58 #define _xmlattribute_h
71 struct AttributeStruct;
82 AttributeStruct* AttributeData;
87 typedef void (*unspecified_bool_type)(
Attribute***);
96 explicit Attribute(AttributeStruct* attr);
102 operator unspecified_bool_type()
const;
108 bool operator!()
const;
115 bool operator==(
const Attribute& r)
const;
122 bool operator!=(
const Attribute& r)
const;
128 bool operator<(
const Attribute& r)
const;
134 bool operator>(
const Attribute& r)
const;
140 bool operator<=(
const Attribute& r)
const;
146 bool operator>=(
const Attribute& r)
const;
155 const Char8* Name()
const;
160 const Char8* Value()
const;
167 const Char8* AsString(
const Char8* def =
"")
const;
174 int AsInt(
int def = 0)
const;
181 unsigned int AsUint(
unsigned int def = 0)
const;
188 double AsDouble(
double def = 0)
const;
195 float AsFloat(
float def = 0)
const;
221 bool AsBool(
bool def =
false)
const;
228 bool SetName(
const Char8* rhs);
236 {
return SetName(rhs.c_str()); }
245 bool SetValue(
const Char8* rhs);
254 bool SetValue(
int rhs);
262 bool SetValue(
unsigned int rhs);
270 bool SetValue(
double rhs);
278 bool SetValue(
bool rhs);
286 {
return SetValue(
ToString(rhs).c_str()); }
295 {
return SetValue(rhs.c_str()); }
334 size_t HashValue()
const;
339 AttributeStruct* InternalObject()
const;
348 #endif // Include guard
A light-weight handle for manipulating attributes in DOM tree.
String ToString(const T &Datum)
Converts whatever to a String as long as a streaming operator is available for it.
All the definitions for datatypes as well as some basic conversion functions are defined here...
int Integer
A datatype used to represent any integer close to.
bool SetValue(const String &rhs)
Set the value of this.
float Real
A Datatype used to represent a real floating point number.
char Char8
A datatype to represent one character.
A light-weight handle for manipulating nodes in DOM tree.
Attribute iterator (a bidirectional iterator over a collection of Attribute).
bool SetValue(T rhs)
Convert rhs to a character array that contains the meaning of rhs, then use that as the new value...
The bulk of the engine components go in this namspace.
bool SetName(const String &rhs)
Set the name of this object.
unsigned long Whole
Whole is an unsigned integer, it will be at least 32bits in size.
std::string String
A datatype used to a series of characters.