gwenhywfar 5.12.0
json.h File Reference
#include <gwenhywfar/tree2.h>
Include dependency graph for json.h:

Go to the source code of this file.

Typedefs

typedef struct GWEN_JSON_ELEM GWEN_JSON_ELEM

Enumerations

enum  {
  GWEN_JSON_ELEMTYPE_UNKNOWN =0 , GWEN_JSON_ELEMTYPE_KEY =1 , GWEN_JSON_ELEMTYPE_NULL , GWEN_JSON_ELEMTYPE_BOOL ,
  GWEN_JSON_ELEMTYPE_NUM , GWEN_JSON_ELEMTYPE_STRING , GWEN_JSON_ELEMTYPE_ARRAY , GWEN_JSON_ELEMTYPE_OBJECT
}

Functions

GWENHYWFAR_API GWEN_JSON_ELEMGWEN_JsonElement_FindFirstByTypeAndData (const GWEN_JSON_ELEM *je, int t, const char *s)
GWENHYWFAR_API GWEN_JSON_ELEMGWEN_JsonElement_FindNextByTypeAndData (const GWEN_JSON_ELEM *je, int t, const char *s)
GWENHYWFAR_API void GWEN_JsonElement_free (GWEN_JSON_ELEM *je)
GWENHYWFAR_API const char * GWEN_JsonElement_GetData (const GWEN_JSON_ELEM *je)
GWENHYWFAR_API GWEN_JSON_ELEMGWEN_JsonElement_GetElementByPath (GWEN_JSON_ELEM *je, const char *path, uint32_t flags)
GWENHYWFAR_API int GWEN_JsonElement_GetType (const GWEN_JSON_ELEM *je)
GWENHYWFAR_API GWEN_JSON_ELEMGWEN_JsonElement_new (int t, const char *sData)
GWENHYWFAR_API void GWEN_JsonElement_SetData (GWEN_JSON_ELEM *je, const char *s)
GWENHYWFAR_API void GWEN_JsonElement_SetType (GWEN_JSON_ELEM *je, int t)
 GWEN_TREE2_FUNCTION_LIB_DEFS (GWEN_JSON_ELEM, GWEN_JsonElement, GWENHYWFAR_API)

Typedef Documentation

◆ GWEN_JSON_ELEM

Definition at line 33 of file json.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
GWEN_JSON_ELEMTYPE_UNKNOWN 
GWEN_JSON_ELEMTYPE_KEY 
GWEN_JSON_ELEMTYPE_NULL 
GWEN_JSON_ELEMTYPE_BOOL 
GWEN_JSON_ELEMTYPE_NUM 
GWEN_JSON_ELEMTYPE_STRING 
GWEN_JSON_ELEMTYPE_ARRAY 
GWEN_JSON_ELEMTYPE_OBJECT 

Definition at line 37 of file json.h.

Function Documentation

◆ GWEN_JsonElement_FindFirstByTypeAndData()

GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_FindFirstByTypeAndData ( const GWEN_JSON_ELEM * je,
int t,
const char * s )

Definition at line 112 of file json.c.

References _findByTypeAndData().

Referenced by GWEN_JsonElement_FindByIdxTypeAndData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_JsonElement_FindNextByTypeAndData()

GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_FindNextByTypeAndData ( const GWEN_JSON_ELEM * je,
int t,
const char * s )

Definition at line 122 of file json.c.

References _findByTypeAndData().

Referenced by GWEN_JsonElement_FindByIdxTypeAndData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_JsonElement_free()

GWENHYWFAR_API void GWEN_JsonElement_free ( GWEN_JSON_ELEM * je)

Definition at line 63 of file json.c.

References GWEN_FREE_OBJECT, and GWEN_TREE2_FINI.

Referenced by _readArray(), and _readObject().

Here is the caller graph for this function:

◆ GWEN_JsonElement_GetData()

GWENHYWFAR_API const char * GWEN_JsonElement_GetData ( const GWEN_JSON_ELEM * je)

Definition at line 92 of file json.c.

References NULL.

Referenced by _findByTypeAndData(), and GWEN_JsonElement_DumpToBuffer().

Here is the caller graph for this function:

◆ GWEN_JsonElement_GetElementByPath()

GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_GetElementByPath ( GWEN_JSON_ELEM * je,
const char * path,
uint32_t flags )

Definition at line 147 of file json.c.

References _handlePath(), and GWEN_Path_HandleWithIdx().

Referenced by test_json().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_JsonElement_GetType()

GWENHYWFAR_API int GWEN_JsonElement_GetType ( const GWEN_JSON_ELEM * je)

Definition at line 75 of file json.c.

References GWEN_JSON_ELEMTYPE_UNKNOWN.

Referenced by _findByTypeAndData(), and GWEN_JsonElement_DumpToBuffer().

Here is the caller graph for this function:

◆ GWEN_JsonElement_new()

GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_new ( int t,
const char * sData )

Definition at line 50 of file json.c.

References GWEN_JsonElement_SetData(), GWEN_JsonElement_SetType(), GWEN_NEW_OBJECT, and GWEN_TREE2_INIT.

Referenced by _readArray(), _readObject(), and _readValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_JsonElement_SetData()

GWENHYWFAR_API void GWEN_JsonElement_SetData ( GWEN_JSON_ELEM * je,
const char * s )

Definition at line 101 of file json.c.

References NULL.

Referenced by GWEN_JsonElement_new().

Here is the caller graph for this function:

◆ GWEN_JsonElement_SetType()

GWENHYWFAR_API void GWEN_JsonElement_SetType ( GWEN_JSON_ELEM * je,
int t )

Definition at line 84 of file json.c.

Referenced by GWEN_JsonElement_new().

Here is the caller graph for this function:

◆ GWEN_TREE2_FUNCTION_LIB_DEFS()

GWEN_TREE2_FUNCTION_LIB_DEFS ( GWEN_JSON_ELEM ,
GWEN_JsonElement ,
GWENHYWFAR_API  )

References GWENHYWFAR_API.