Bike-X
0.8
|
#include "OVR_JSON.h"
Public Member Functions | |
~JSON () | |
bool | Save (const char *path) |
bool | HasItems () const |
JSON * | GetFirstItem () |
JSON * | GetLastItem () |
unsigned | GetItemCount () const |
JSON * | GetItemByIndex (unsigned i) |
JSON * | GetItemByName (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="") |
JSON * | GetNextItem (JSON *item) |
JSON * | GetPrevItem (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) |
JSON * | Copy () |
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 JSON * | CreateObject () |
static JSON * | CreateNull () |
static JSON * | CreateArray () |
static JSON * | CreateBool (bool b) |
static JSON * | CreateNumber (double num) |
static JSON * | CreateString (const char *s) |
static JSON * | Parse (const char *buff, const char **perror=0) |
static JSON * | ParseBuffer (const char *buff, int len, const char **perror=0) |
static JSON * | Load (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 JSON * | createHelper (JSONItemType itemType, double dval, const char *strVal=0) |
Protected Attributes | |
List< JSON > | Children |
Protected Attributes inherited from OVR::RefCountImplCore | |
volatile int | RefCount |
Definition at line 58 of file OVR_JSON.h.
OVR::JSON::~JSON | ( | ) |
Definition at line 127 of file OVR_JSON.cpp.
|
protected |
Definition at line 122 of file OVR_JSON.cpp.
void OVR::JSON::AddArrayElement | ( | JSON * | item | ) |
Definition at line 1041 of file OVR_JSON.cpp.
|
inline |
Definition at line 134 of file OVR_JSON.h.
|
inline |
Definition at line 135 of file OVR_JSON.h.
|
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.
|
inline |
Definition at line 121 of file OVR_JSON.h.
|
inline |
Definition at line 123 of file OVR_JSON.h.
|
inline |
Definition at line 124 of file OVR_JSON.h.
JSON * OVR::JSON::Copy | ( | ) |
Definition at line 1112 of file OVR_JSON.cpp.
|
inlinestatic |
Definition at line 76 of file OVR_JSON.h.
|
inlinestatic |
Definition at line 77 of file OVR_JSON.h.
|
staticprotected |
Definition at line 981 of file OVR_JSON.cpp.
|
inlinestatic |
Definition at line 75 of file OVR_JSON.h.
|
inlinestatic |
Definition at line 78 of file OVR_JSON.h.
|
inlinestatic |
Definition at line 74 of file OVR_JSON.h.
|
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.
|
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.
|
inline |
Definition at line 101 of file OVR_JSON.h.
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.
Definition at line 116 of file OVR_JSON.h.
Definition at line 1028 of file OVR_JSON.cpp.
|
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.
|
static |
Definition at line 1132 of file OVR_JSON.cpp.
|
static |
Definition at line 413 of file OVR_JSON.cpp.
|
protected |
Definition at line 528 of file OVR_JSON.cpp.
|
static |
Definition at line 436 of file OVR_JSON.cpp.
|
protected |
Definition at line 141 of file OVR_JSON.cpp.
|
protected |
Definition at line 657 of file OVR_JSON.cpp.
|
protected |
Definition at line 228 of file OVR_JSON.cpp.
|
protected |
Definition at line 453 of file OVR_JSON.cpp.
|
protected |
Definition at line 572 of file OVR_JSON.cpp.
|
protected |
Definition at line 721 of file OVR_JSON.cpp.
|
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.
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.