XMLElement.pkg 4.5 KB

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