84 XML(
const std::string& v) : m_type(
VALUE), m_value(v) {}
110 void load(
const std::string& filename);
112 void save(
const std::string& filename)
const;
114 void parse(
const std::string &s);
116 void unparse(std::string& s)
const;
128 return m_child.
size();
133 return m_attribute.
size();
144 return m_attribute[k];
153 XML get(
const std::string& k,
const XML& defaultVal)
const {
167 const std::string
name()
const {
182 operator std::string()
const {
190 operator double()
const {
194 operator float()
const {
198 operator int()
const {
void parse(const std::string &s)
Definition: XML.cpp:91
AttributeTable m_attribute
Definition: XML.h:77
void save(const std::string &filename) const
Definition: XML.cpp:47
const std::string & string() const
Definition: XML.h:172
Value * getPointer(const Key &key) const
Definition: Table.h:731
Table< std::string, XML > AttributeTable
Definition: XML.h:70
int numChildren() const
Definition: XML.h:127
const AttributeTable & attributeTable() const
Definition: XML.h:118
Type m_type
Definition: XML.h:74
const Array< XML > & childArray() const
Definition: XML.h:122
size_t size() const
Definition: Table.h:589
void unparse(std::string &s) const
Definition: XML.cpp:54
int iRound(double fValue)
Definition: g3dmath.h:226
std::string m_value
Definition: XML.h:76
Dynamic 1D array tuned for performance.
Definition: Array.h:95
const std::string name() const
Definition: XML.h:167
XML(const double &v)
Definition: XML.h:86
void load(const std::string &filename)
Definition: XML.cpp:36
#define bool
Definition: CascPort.h:16
XML(float v)
Definition: XML.h:88
XML(int v)
Definition: XML.h:90
#define debugAssert(exp)
Definition: debugAssert.h:160
Array< XML > m_child
Definition: XML.h:78
A simple tokenizer for parsing text files.
Definition: TextInput.h:223
Easy loading and saving of XML and HTML files.
Definition: XML.h:65
XML(Type tagType, const std::string &name, const Array< XML > &ch=Array< XML >())
Definition: XML.h:99
std::string __cdecl format(const char *fmt...) G3D_CHECK_PRINTF_ARGS
int size() const
Definition: Array.h:430
Definition: TextOutput.h:60
bool containsAttribute(const std::string &k) const
Definition: XML.h:147
Type type() const
Definition: XML.h:162
void deserialize(TextInput &t)
Definition: XML.cpp:125
void serialize(TextOutput &t) const
Definition: XML.cpp:65
bool boolean() const
Definition: XML.cpp:31
std::string m_name
Definition: XML.h:75
double number() const
Definition: XML.cpp:26
const XML & operator[](int i) const
Definition: XML.h:138
XML()
Definition: XML.h:82
XML(Type tagType, const std::string &name, const AttributeTable &at, const Array< XML > &ch=Array< XML >())
Definition: XML.h:93
G3D::int16 x
Definition: Vector2int16.h:37
size_t numAttributes() const
Definition: XML.h:132
const XML & operator[](const std::string &k) const
Definition: XML.h:143
bool containsKey(const Key &key) const
Definition: Table.h:874
XML(const std::string &v)
Definition: XML.h:84