1$#include "Resource/XMLElement.h"
2
3class XMLElement
4{
5    XMLElement CreateChild(const String name);
6    XMLElement GetOrCreateChild(const String name);
7    bool RemoveChild(const XMLElement& element);
8    bool RemoveChild(const String name);
9    bool RemoveChildren(const String name = String::EMPTY);
10    bool RemoveAttribute(const String name = String::EMPTY);
11
12    bool SetValue(const String value);
13    bool SetAttribute(const String name, const String value);
14    bool SetAttribute(const String value);
15    bool SetBool(const String name, bool value);
16    bool SetBoundingBox(const BoundingBox& value);
17    bool SetColor(const String name, const Color& value);
18    bool SetFloat(const String name, float value);
19    bool SetDouble(const String name, double value);
20    bool SetUInt(const String name, unsigned value);
21    bool SetInt(const String name, int value);
22    bool SetUInt64(const String name, unsigned long long value);
23    bool SetInt64(const String name, long long value);
24    bool SetIntRect(const String name, const IntRect& value);
25    bool SetIntVector2(const String name, const IntVector2& value);
26    bool SetIntVector3(const String name, const IntVector3& value);
27    bool SetRect(const String name, const Rect& value);
28    bool SetQuaternion(const String name, const Quaternion& value);
29    bool SetString(const String name, const String value);
30    bool SetVariant(const Variant& value);
31    bool SetVariantValue(const Variant& value);
32    bool SetResourceRef(const ResourceRef& value);
33    bool SetResourceRefList(const ResourceRefList& value);
34    // bool SetVariantVector(const VariantVector& value);
35    // bool SetVariantMap(const VariantMap& value);
36    bool SetVector2(const String name, const Vector2& value);
37    bool SetVector3(const String name, const Vector3& value);
38    bool SetVector4(const String name, const Vector4& value);
39    bool SetVectorVariant(const String name, const Variant& value);
40    bool SetMatrix3(const String name, const Matrix3& value);
41    bool SetMatrix3x4(const String name, const Matrix3x4& value);
42    bool SetMatrix4(const String name, const Matrix4& value);
43
44    bool IsNull() const;
45    bool NotNull() const;
46    operator bool () const;
47    String GetName() const;
48    bool HasChild(const String name) const;
49    XMLElement GetChild(const String name = String::EMPTY) const;
50    XMLElement GetNext(const String name = String::EMPTY) const;
51    XMLElement GetParent() const;
52    unsigned GetNumAttributes() const;
53    bool HasAttribute(const String name) const;
54    String GetValue() const;
55    String GetAttribute(const String name = String::EMPTY) const;
56    String GetAttributeLower(const String name) const;
57    String GetAttributeUpper(const String name) const;
58    Vector<String> GetAttributeNames() const;
59    bool GetBool(const String name) const;
60    BoundingBox GetBoundingBox() const;
61    Color GetColor(const String name) const;
62    float GetFloat(const String name) const;
63    double GetDouble(const String name) const;
64    unsigned GetUInt(const String name) const;
65    int GetInt(const String name) const;
66    unsigned long long GetUInt64(const String name) const;
67    long long GetInt64(const String name) const;
68    IntRect GetIntRect(const String name) const;
69    IntVector2 GetIntVector2(const String name) const;
70    IntVector3 GetIntVector3(const String name) const;
71    Rect GetRect(const String name) const;
72    Quaternion GetQuaternion(const String name) const;
73    Variant GetVariant() const;
74    Variant GetVariantValue(VariantType type) const;
75    ResourceRef GetResourceRef() const;
76    ResourceRefList GetResourceRefList() const;
77    // VariantVector GetVariantVector() const;
78    VariantMap GetVariantMap() const;
79    Vector2 GetVector2(const String name) const;
80    Vector3 GetVector3(const String name) const;
81    Vector4 GetVector4(const String name) const;
82    Vector4 GetVector(const String name) const;
83    // Variant GetVectorVariant(const String name) const;
84    Matrix3 GetMatrix3(const String name) const;
85    Matrix3x4 GetMatrix3x4(const String name) const;
86    Matrix4 GetMatrix4(const String name) const;
87    XMLFile* GetFile() const;
88
89    static const XMLElement EMPTY;
90
91    tolua_readonly tolua_property__is_set bool null;
92    tolua_readonly tolua_property__get_set String name;
93    tolua_readonly tolua_property__get_set XMLElement parent;
94    tolua_readonly tolua_property__get_set String value;
95    tolua_readonly tolua_property__get_set unsigned numAttributes;
96    tolua_readonly tolua_property__get_set XMLFile* file;
97};
98