XMLElement.pkg 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. $#include "Resource/XMLElement.h"
  2. class XMLElement
  3. {
  4. bool AppendChild(XMLElement element, bool asCopy);
  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. bool Remove();
  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. bool IsNull() const;
  44. bool NotNull() const;
  45. operator bool () const;
  46. String GetName() const;
  47. bool HasChild(const String name) const;
  48. XMLElement GetChild(const String name = String::EMPTY) const;
  49. XMLElement GetNext(const String name = String::EMPTY) const;
  50. XMLElement GetParent() const;
  51. unsigned GetNumAttributes() const;
  52. bool HasAttribute(const String name) const;
  53. String GetValue() const;
  54. String GetAttribute(const String name = String::EMPTY) const;
  55. String GetAttributeLower(const String name) const;
  56. String GetAttributeUpper(const String name) const;
  57. Vector<String> GetAttributeNames() const;
  58. bool GetBool(const String name) const;
  59. BoundingBox GetBoundingBox() const;
  60. Color GetColor(const String name) const;
  61. float GetFloat(const String name) const;
  62. double GetDouble(const String name) const;
  63. unsigned GetUInt(const String name) const;
  64. int GetInt(const String name) const;
  65. unsigned long long GetUInt64(const String name) const;
  66. long long GetInt64(const String name) const;
  67. IntRect GetIntRect(const String name) const;
  68. IntVector2 GetIntVector2(const String name) const;
  69. IntVector3 GetIntVector3(const String name) const;
  70. Rect GetRect(const String name) const;
  71. Quaternion GetQuaternion(const String name) const;
  72. Variant GetVariant() const;
  73. Variant GetVariantValue(VariantType type) const;
  74. ResourceRef GetResourceRef() const;
  75. ResourceRefList GetResourceRefList() const;
  76. // VariantVector GetVariantVector() const;
  77. VariantMap GetVariantMap() const;
  78. Vector2 GetVector2(const String name) const;
  79. Vector3 GetVector3(const String name) const;
  80. Vector4 GetVector4(const String name) const;
  81. Vector4 GetVector(const String name) const;
  82. // Variant GetVectorVariant(const String name) const;
  83. Matrix3 GetMatrix3(const String name) const;
  84. Matrix3x4 GetMatrix3x4(const String name) const;
  85. Matrix4 GetMatrix4(const String name) const;
  86. XMLFile* GetFile() const;
  87. static const XMLElement EMPTY;
  88. tolua_readonly tolua_property__is_set bool null;
  89. tolua_readonly tolua_property__get_set String name;
  90. tolua_readonly tolua_property__get_set XMLElement parent;
  91. tolua_readonly tolua_property__get_set String value;
  92. tolua_readonly tolua_property__get_set unsigned numAttributes;
  93. tolua_readonly tolua_property__get_set XMLFile* file;
  94. };