XMLElement.pkg 4.1 KB

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