iFun Engine API  1.0.0-b2936
Great Technology for Great Games
 All Classes Files Functions Variables Typedefs Macros
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
fun::Json Class Reference
Inheritance diagram for fun::Json:

Classes

class  Attribute
 

Public Types

typedef AttributeAttributeIterator
 
typedef const AttributeConstAttributeIterator
 
typedef const JsonConstValueIterator
 
typedef boost::function< void(const
string &, const string
&, size_t)> 
ParseErrorCallback
 
enum  Type {
  kNull = 0, kBoolean, kInteger, kDouble,
  kString, kArray, kObject
}
 
typedef JsonValueIterator
 

Public Member Functions

 Json (bool value)
 
 Json (int value)
 
 Json (int64_t value)
 
 Json (double value)
 
 Json (const char *value)
 
 Json (const string &value)
 
 Json (const Json &other)
 
void AddAttribute (const string &attr_name, bool value)
 
void AddAttribute (const string &attr_name, int value)
 
void AddAttribute (const string &attr_name, int64_t value)
 
void AddAttribute (const string &attr_name, double value)
 
void AddAttribute (const string &attr_name, const char *value)
 
void AddAttribute (const string &attr_name, const string &value)
 
void AddAttribute (const string &attr_name, const Json &value)
 
AttributeIterator AttributeBegin ()
 
ConstAttributeIterator AttributeBegin () const
 
AttributeIterator AttributeEnd ()
 
ConstAttributeIterator AttributeEnd () const
 
ValueIterator Begin ()
 
ConstValueIterator Begin () const
 
void Copy (Json *to) const
 
Json Copy () const
 
 DECLARE_CLASS_PTR (Json)
 
ValueIterator End ()
 
ConstValueIterator End () const
 
AttributeIterator FindAttribute (const string &attr_name)
 
ConstAttributeIterator FindAttribute (const string &attr_name) const
 
bool FromFile (const string &file_path, const ParseErrorCallback &cb=NULL)
 
bool FromFileWithComments (const string &file_path, const ParseErrorCallback &cb=NULL)
 
bool FromStream (std::istream &input_stream, const ParseErrorCallback &cb=NULL)
 
bool FromStreamWithComments (std::istream &input_stream, const ParseErrorCallback &cb=NULL)
 
bool FromString (const string &json_string, const ParseErrorCallback &cb=NULL)
 
bool FromString (const char *json_string, const ParseErrorCallback &cb=NULL)
 
bool FromString (const char *json_string, size_t len, const ParseErrorCallback &cb=NULL)
 
bool FromStringInsitu (string *json_string, const ParseErrorCallback &cb=NULL)
 
bool FromStringInsitu (char *json_string, const ParseErrorCallback &cb=NULL)
 
bool FromStringInsitu (char *json_string, size_t len, const ParseErrorCallback &cb=NULL)
 
bool FromStringWithComments (const string &json_string, const ParseErrorCallback &cb=NULL)
 
const JsonGetAttribute (const string &attr_name) const
 
JsonGetAttribute (const string &attr_name)
 
bool GetBool () const
 
double GetDouble () const
 
int64_t GetInteger () const
 
string GetString () const
 
bool HasAttribute (const string &attr_name) const
 
bool HasAttribute (const string &attr_name, Type type) const
 
bool IsArray () const
 
bool IsBool () const
 
bool IsDouble () const
 
bool IsInteger () const
 
bool IsNull () const
 
bool IsObject () const
 
bool IsString () const
 
size_t MemberCount () const
 
void Move (Json *to)
 
Jsonoperator= (bool value)
 
Jsonoperator= (int value)
 
Jsonoperator= (int64_t value)
 
Jsonoperator= (double value)
 
Jsonoperator= (const char *value)
 
Jsonoperator= (const string &value)
 
Jsonoperator= (const Json &value)
 
const Jsonoperator[] (size_t index) const
 
Jsonoperator[] (size_t index)
 
const Jsonoperator[] (const string &attr_name) const
 
Jsonoperator[] (const string &attr_name)
 
void PushBack ()
 
void PushBack (bool value)
 
void PushBack (int value)
 
void PushBack (int64_t value)
 
void PushBack (double value)
 
void PushBack (const char *value)
 
void PushBack (const string &value)
 
void PushBack (const Json &value)
 
void RemoveAllAttributes ()
 
void RemoveAllElements ()
 
bool RemoveAttribute (const string &attr_name)
 
AttributeIterator RemoveAttribute (AttributeIterator iterator)
 
ValueIterator RemoveElement (ValueIterator iterator)
 
void RemoveElementByIndex (size_t index)
 
void SetArray ()
 
void SetBool (bool value)
 
void SetDouble (double value)
 
void SetInteger (int64_t value)
 
void SetNull ()
 
void SetObject ()
 
void SetString (const string &value)
 
size_t Size () const
 
string ToString (bool pretty=false) const
 
void ToString (string *str, bool pretty=false) const
 
void ToString (Buffer *buffer, bool pretty=false) const
 
void ToString (std::ostream *stream, bool pretty=false) const
 
Type type () const
 

Static Public Attributes

static const ParseErrorCallback kDefaultParseErrorHandler