Bike-X  0.8
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OVR::JSON Class Reference

#include "OVR_JSON.h"

Inheritance diagram for OVR::JSON:
Inheritance graph
Collaboration diagram for OVR::JSON:
Collaboration graph

Public Member Functions

 ~JSON ()
 
bool Save (const char *path)
 
bool HasItems () const
 
JSONGetFirstItem ()
 
JSONGetLastItem ()
 
unsigned GetItemCount () const
 
JSONGetItemByIndex (unsigned i)
 
JSONGetItemByName (const char *name)
 
double GetNumberByName (const char *name, double defValue=0.0)
 
int GetIntByName (const char *name, int defValue=0)
 
bool GetBoolByName (const char *name, bool defValue=false)
 
String GetStringByName (const char *name, const String &defValue="")
 
JSONGetNextItem (JSON *item)
 
JSONGetPrevItem (JSON *item)
 
void AddItem (const char *string, JSON *item)
 
void AddNullItem (const char *name)
 
void AddBoolItem (const char *name, bool b)
 
void AddNumberItem (const char *name, double n)
 
void AddStringItem (const char *name, const char *s)
 
void RemoveLast ()
 
void AddArrayElement (JSON *item)
 
void InsertArrayElement (int index, JSON *item)
 
void AddArrayNumber (double n)
 
void AddArrayString (const char *s)
 
int GetArraySize ()
 
double GetArrayNumber (int index)
 
const char * GetArrayString (int index)
 
JSONCopy ()
 
- Public Member Functions inherited from OVR::RefCountBase< JSON >
OVR_FORCE_INLINE RefCountBase ()
 
- Public Member Functions inherited from OVR::RefCountBaseStatImpl< RefCountImpl >
 RefCountBaseStatImpl ()
 
- Public Member Functions inherited from OVR::RefCountImpl
void AddRef ()
 
void Release ()
 
- Public Member Functions inherited from OVR::RefCountImplCore
OVR_FORCE_INLINE RefCountImplCore ()
 
virtual ~RefCountImplCore ()
 
int GetRefCount () const
 
void operator= (const RefCountImplCore &)
 
- Public Member Functions inherited from OVR::ListNode< JSON >
void RemoveNode ()
 
void ReplaceNodeWith (JSON *pnew)
 
void InsertNodeAfter (JSON *p)
 
void InsertNodeBefore (JSON *p)
 
void Alloc_MoveTo (ListNode< JSON > *pdest)
 

Static Public Member Functions

static JSONCreateObject ()
 
static JSONCreateNull ()
 
static JSONCreateArray ()
 
static JSONCreateBool (bool b)
 
static JSONCreateNumber (double num)
 
static JSONCreateString (const char *s)
 
static JSONParse (const char *buff, const char **perror=0)
 
static JSONParseBuffer (const char *buff, int len, const char **perror=0)
 
static JSONLoad (const char *path, const char **perror=0)
 
- Static Public Member Functions inherited from OVR::RefCountImplCore
static void checkInvalidDelete (RefCountImplCore *)
 

Data Fields

JSONItemType Type
 
String Name
 
String Value
 
double dValue
 
- Data Fields inherited from OVR::ListNode< JSON >
union {
T * pPrev
 
void * pVoidPrev
 
}; 
 
union {
T * pNext
 
void * pVoidNext
 
}; 
 

Protected Member Functions

 JSON (JSONItemType itemType=JSON_Object)
 
const char * parseValue (const char *buff, const char **perror)
 
const char * parseNumber (const char *num)
 
const char * parseArray (const char *value, const char **perror)
 
const char * parseObject (const char *value, const char **perror)
 
const char * parseString (const char *str, const char **perror)
 
char * PrintValue (int depth, bool fmt)
 
char * PrintObject (int depth, bool fmt)
 
char * PrintArray (int depth, bool fmt)
 

Static Protected Member Functions

static JSONcreateHelper (JSONItemType itemType, double dval, const char *strVal=0)
 

Protected Attributes

List< JSONChildren
 
- Protected Attributes inherited from OVR::RefCountImplCore
volatile int RefCount
 

Detailed Description

Definition at line 58 of file OVR_JSON.h.

Constructor & Destructor Documentation

OVR::JSON::~JSON ( )

Definition at line 127 of file OVR_JSON.cpp.

OVR::JSON::JSON ( JSONItemType  itemType = JSON_Object)
protected

Definition at line 122 of file OVR_JSON.cpp.

Member Function Documentation

void OVR::JSON::AddArrayElement ( JSON item)

Definition at line 1041 of file OVR_JSON.cpp.

void OVR::JSON::AddArrayNumber ( double  n)
inline

Definition at line 134 of file OVR_JSON.h.

void OVR::JSON::AddArrayString ( const char *  s)
inline

Definition at line 135 of file OVR_JSON.h.

void OVR::JSON::AddBoolItem ( const char *  name,
bool  b 
)
inline

Definition at line 122 of file OVR_JSON.h.

void OVR::JSON::AddItem ( const char *  string,
JSON item 
)

Definition at line 921 of file OVR_JSON.cpp.

void OVR::JSON::AddNullItem ( const char *  name)
inline

Definition at line 121 of file OVR_JSON.h.

void OVR::JSON::AddNumberItem ( const char *  name,
double  n 
)
inline

Definition at line 123 of file OVR_JSON.h.

void OVR::JSON::AddStringItem ( const char *  name,
const char *  s 
)
inline

Definition at line 124 of file OVR_JSON.h.

JSON * OVR::JSON::Copy ( )

Definition at line 1112 of file OVR_JSON.cpp.

static JSON* OVR::JSON::CreateArray ( )
inlinestatic

Definition at line 76 of file OVR_JSON.h.

static JSON* OVR::JSON::CreateBool ( bool  b)
inlinestatic

Definition at line 77 of file OVR_JSON.h.

JSON * OVR::JSON::createHelper ( JSONItemType  itemType,
double  dval,
const char *  strVal = 0 
)
staticprotected

Definition at line 981 of file OVR_JSON.cpp.

static JSON* OVR::JSON::CreateNull ( )
inlinestatic

Definition at line 75 of file OVR_JSON.h.

static JSON* OVR::JSON::CreateNumber ( double  num)
inlinestatic

Definition at line 78 of file OVR_JSON.h.

static JSON* OVR::JSON::CreateObject ( )
inlinestatic

Definition at line 74 of file OVR_JSON.h.

static JSON* OVR::JSON::CreateString ( const char *  s)
inlinestatic

Definition at line 79 of file OVR_JSON.h.

double OVR::JSON::GetArrayNumber ( int  index)

Definition at line 1085 of file OVR_JSON.cpp.

int OVR::JSON::GetArraySize ( )

Definition at line 1076 of file OVR_JSON.cpp.

const char * OVR::JSON::GetArrayString ( int  index)

Definition at line 1099 of file OVR_JSON.cpp.

bool OVR::JSON::GetBoolByName ( const char *  name,
bool  defValue = false 
)

Definition at line 1017 of file OVR_JSON.cpp.

JSON* OVR::JSON::GetFirstItem ( )
inline

Definition at line 100 of file OVR_JSON.h.

int OVR::JSON::GetIntByName ( const char *  name,
int  defValue = 0 
)

Definition at line 1006 of file OVR_JSON.cpp.

JSON * OVR::JSON::GetItemByIndex ( unsigned  i)

Definition at line 872 of file OVR_JSON.cpp.

JSON * OVR::JSON::GetItemByName ( const char *  name)

Definition at line 897 of file OVR_JSON.cpp.

unsigned OVR::JSON::GetItemCount ( ) const

Definition at line 864 of file OVR_JSON.cpp.

JSON* OVR::JSON::GetLastItem ( )
inline

Definition at line 101 of file OVR_JSON.h.

JSON* OVR::JSON::GetNextItem ( JSON item)
inline

Definition at line 115 of file OVR_JSON.h.

double OVR::JSON::GetNumberByName ( const char *  name,
double  defValue = 0.0 
)

Definition at line 995 of file OVR_JSON.cpp.

JSON* OVR::JSON::GetPrevItem ( JSON item)
inline

Definition at line 116 of file OVR_JSON.h.

String OVR::JSON::GetStringByName ( const char *  name,
const String defValue = "" 
)

Definition at line 1028 of file OVR_JSON.cpp.

bool OVR::JSON::HasItems ( ) const
inline

Definition at line 98 of file OVR_JSON.h.

void OVR::JSON::InsertArrayElement ( int  index,
JSON item 
)

Definition at line 1050 of file OVR_JSON.cpp.

JSON * OVR::JSON::Load ( const char *  path,
const char **  perror = 0 
)
static

Definition at line 1132 of file OVR_JSON.cpp.

JSON * OVR::JSON::Parse ( const char *  buff,
const char **  perror = 0 
)
static

Definition at line 413 of file OVR_JSON.cpp.

const char * OVR::JSON::parseArray ( const char *  value,
const char **  perror 
)
protected

Definition at line 528 of file OVR_JSON.cpp.

JSON * OVR::JSON::ParseBuffer ( const char *  buff,
int  len,
const char **  perror = 0 
)
static

Definition at line 436 of file OVR_JSON.cpp.

const char * OVR::JSON::parseNumber ( const char *  num)
protected

Definition at line 141 of file OVR_JSON.cpp.

const char * OVR::JSON::parseObject ( const char *  value,
const char **  perror 
)
protected

Definition at line 657 of file OVR_JSON.cpp.

const char * OVR::JSON::parseString ( const char *  str,
const char **  perror 
)
protected

Definition at line 228 of file OVR_JSON.cpp.

const char * OVR::JSON::parseValue ( const char *  buff,
const char **  perror 
)
protected

Definition at line 453 of file OVR_JSON.cpp.

char * OVR::JSON::PrintArray ( int  depth,
bool  fmt 
)
protected

Definition at line 572 of file OVR_JSON.cpp.

char * OVR::JSON::PrintObject ( int  depth,
bool  fmt 
)
protected

Definition at line 721 of file OVR_JSON.cpp.

char * OVR::JSON::PrintValue ( int  depth,
bool  fmt 
)
protected

Definition at line 503 of file OVR_JSON.cpp.

void OVR::JSON::RemoveLast ( )

Definition at line 970 of file OVR_JSON.cpp.

bool OVR::JSON::Save ( const char *  path)

Definition at line 1162 of file OVR_JSON.cpp.

Field Documentation

List<JSON> OVR::JSON::Children
protected

Definition at line 61 of file OVR_JSON.h.

double OVR::JSON::dValue

Definition at line 67 of file OVR_JSON.h.

String OVR::JSON::Name

Definition at line 65 of file OVR_JSON.h.

JSONItemType OVR::JSON::Type

Definition at line 64 of file OVR_JSON.h.

String OVR::JSON::Value

Definition at line 66 of file OVR_JSON.h.


The documentation for this class was generated from the following files: