XMLElement.pkg 4.0 KB

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