$#include "JSONValue.h" enum JSONValueType { JSON_ANY = 0, JSON_OBJECT, JSON_ARRAY }; class JSONValue { bool IsNull() const; bool NotNull() const; operator bool () const; JSONValue CreateChild(const String name, JSONValueType valueType = JSON_OBJECT); JSONValue GetChild(const String name, JSONValueType valueType = JSON_ANY) const; void SetInt(const String name, int value); void SetBool(const String name, bool value); void SetFloat(const String name, float value); void SetVector2(const String name, const Vector2& value); void SetVector3(const String name, const Vector3& value); void SetVector4(const String name, const Vector4& value); void SetVectorVariant(const String name, const Variant& value); void SetQuaternion(const String name, const Quaternion& value); void SetColor(const String name, const Color& value); void SetString(const String name, const String value); // void SetBuffer(const String name, const void* data, unsigned size); // void SetBuffer(const String name, const PODVector& value); void SetResourceRef(const String name, const ResourceRef& value); void SetResourceRefList(const String name, const ResourceRefList& value); void SetIntRect(const String name, const IntRect& value); void SetIntVector2(const String name, const IntVector2& value); void SetMatrix3(const String name, const Matrix3& value); void SetMatrix3x4(const String name, const Matrix3x4& value); void SetMatrix4(const String name, const Matrix4& value); void SetVariant(const String name, const Variant& value); void SetVariantValue(const String name, const Variant& value); bool IsObject() const; Vector GetChildNames() const; Vector GetValueNames() const; int GetInt(const String name) const; bool GetBool(const String name) const; float GetFloat(const String name) const; Vector2 GetVector2(const String name) const; Vector3 GetVector3(const String name) const; Vector4 GetVector4(const String name) const; Variant GetVectorVariant(const String name) const; Quaternion GetQuaternion(const String name) const; Color GetColor(const String name) const; String GetString(const String name) const; const char* GetCString(const String name) const; // PODVector GetBuffer(const String name) const; // bool GetBuffer(const String name, void* dest, unsigned size) const; ResourceRef GetResourceRef(const String name) const; ResourceRefList GetResourceRefList(const String name) const; IntRect GetIntRect(const String name) const; IntVector2 GetIntVector2(const String name) const; Matrix3 GetMatrix3(const String name) const; Matrix3x4 GetMatrix3x4(const String name) const; Matrix4 GetMatrix4(const String name) const; Variant GetVariant(const String name) const; Variant GetVariantValue(const String name, VariantType type) const; JSONValue CreateChild(JSONValueType valueType = JSON_OBJECT); JSONValue GetChild(unsigned index, JSONValueType valueType = JSON_ANY) const; void AddInt(int value); void AddBool(bool value); void AddFloat(float value); void AddVector2(const Vector2& value); void AddVector3(const Vector3& value); void AddVector4(const Vector4& value); void AddVectorVariant(const Variant& value); void AddQuaternion(const Quaternion& value); void AddColor(const Color& value); void AddString(const String value); // void AddBuffer(const PODVector& value); // void AddBuffer(const void* data, unsigned size); void AddResourceRef(const ResourceRef& value); void AddResourceRefList(const ResourceRefList& value); void AddIntRect(const IntRect& value); void AddIntVector2(const IntVector2& value); void AddMatrix3(const Matrix3& value); void AddMatrix3x4(const Matrix3x4& value); void AddMatrix4(const Matrix4& value); void AddVariant(const Variant& value); void AddVariantValue(const Variant& value); bool IsArray() const; unsigned GetSize() const; int GetInt(unsigned index) const; bool GetBool(unsigned index) const; float GetFloat(unsigned index) const; Vector2 GetVector2(unsigned index) const; Vector3 GetVector3(unsigned index) const; Vector4 GetVector4(unsigned index) const; Variant GetVectorVariant(unsigned index) const; Quaternion GetQuaternion(unsigned index) const; Color GetColor(unsigned index) const; String GetString(unsigned index) const; const char* GetCString(unsigned index) const; // PODVector GetBuffer(unsigned index) const; // bool GetBuffer(unsigned index, void* dest, unsigned size) const; ResourceRef GetResourceRef(unsigned index) const; ResourceRefList GetResourceRefList(unsigned index) const; IntRect GetIntRect(unsigned index) const; IntVector2 GetIntVector2(unsigned index) const; Matrix3 GetMatrix3(unsigned index) const; Matrix3x4 GetMatrix3x4(unsigned index) const; Matrix4 GetMatrix4(unsigned index) const; Variant GetVariant(unsigned index) const; Variant GetVariantValue(unsigned index, VariantType type) const; static const JSONValue EMPTY; tolua_readonly tolua_property__is_set bool null; tolua_readonly tolua_property__is_set bool object; tolua_readonly tolua_property__is_set bool array; };