json.h
Go to the documentation of this file.
/***************************************************************************
copyright : (C) 2023 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Lesser General Public *
* License as published by the Free Software Foundation; either *
* version 2.1 of the License, or (at your option) any later version. *
* *
* This library is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU Lesser General Public *
* License along with this library; if not, write to the Free Software *
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
* MA 02111-1307 USA *
* *
***************************************************************************/
#ifndef GWENHYWFAR_JSON_H
#define GWENHYWFAR_JSON_H
#include <gwenhywfar/tree2.h>
typedef struct GWEN_JSON_ELEM GWEN_JSON_ELEM;
GWEN_TREE2_FUNCTION_LIB_DEFS(GWEN_JSON_ELEM, GWEN_JsonElement, GWENHYWFAR_API);
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
};
GWENHYWFAR_API GWEN_JSON_ELEM *GWEN_JsonElement_new(int t, const char *sData);
GWENHYWFAR_API void GWEN_JsonElement_free(GWEN_JSON_ELEM *je);
GWENHYWFAR_API int GWEN_JsonElement_GetType(const GWEN_JSON_ELEM *je);
GWENHYWFAR_API void GWEN_JsonElement_SetType(GWEN_JSON_ELEM *je, int t);
GWENHYWFAR_API const char *GWEN_JsonElement_GetData(const GWEN_JSON_ELEM *je);
GWENHYWFAR_API void GWEN_JsonElement_SetData(GWEN_JSON_ELEM *je, const char *s);
GWENHYWFAR_API GWEN_JSON_ELEM *GWEN_JsonElement_FindFirstByTypeAndData(const GWEN_JSON_ELEM *je, int t, const char *s);
GWENHYWFAR_API GWEN_JSON_ELEM *GWEN_JsonElement_FindNextByTypeAndData(const GWEN_JSON_ELEM *je, int t, const char *s);
GWENHYWFAR_API GWEN_JSON_ELEM *GWEN_JsonElement_GetElementByPath(GWEN_JSON_ELEM *je, const char *path, uint32_t flags);
#endif
GWENHYWFAR_API
#define GWENHYWFAR_API
Definition gwenhywfarapi.h:67
GWEN_JsonElement_FindNextByTypeAndData
GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_FindNextByTypeAndData(const GWEN_JSON_ELEM *je, int t, const char *s)
GWEN_JsonElement_new
GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_new(int t, const char *sData)
GWEN_JsonElement_GetData
GWENHYWFAR_API const char * GWEN_JsonElement_GetData(const GWEN_JSON_ELEM *je)
GWEN_JsonElement_FindFirstByTypeAndData
GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_FindFirstByTypeAndData(const GWEN_JSON_ELEM *je, int t, const char *s)
GWEN_JsonElement_SetData
GWENHYWFAR_API void GWEN_JsonElement_SetData(GWEN_JSON_ELEM *je, const char *s)
GWEN_JsonElement_GetType
GWENHYWFAR_API int GWEN_JsonElement_GetType(const GWEN_JSON_ELEM *je)
GWEN_JsonElement_free
GWENHYWFAR_API void GWEN_JsonElement_free(GWEN_JSON_ELEM *je)
GWEN_JsonElement_SetType
GWENHYWFAR_API void GWEN_JsonElement_SetType(GWEN_JSON_ELEM *je, int t)
GWEN_JSON_ELEMTYPE_OBJECT
@ GWEN_JSON_ELEMTYPE_OBJECT
Definition json.h:45
GWEN_JSON_ELEMTYPE_STRING
@ GWEN_JSON_ELEMTYPE_STRING
Definition json.h:43
GWEN_JSON_ELEMTYPE_BOOL
@ GWEN_JSON_ELEMTYPE_BOOL
Definition json.h:41
GWEN_JSON_ELEMTYPE_NULL
@ GWEN_JSON_ELEMTYPE_NULL
Definition json.h:40
GWEN_JSON_ELEMTYPE_KEY
@ GWEN_JSON_ELEMTYPE_KEY
Definition json.h:39
GWEN_JSON_ELEMTYPE_ARRAY
@ GWEN_JSON_ELEMTYPE_ARRAY
Definition json.h:44
GWEN_JSON_ELEMTYPE_UNKNOWN
@ GWEN_JSON_ELEMTYPE_UNKNOWN
Definition json.h:38
GWEN_JSON_ELEMTYPE_NUM
@ GWEN_JSON_ELEMTYPE_NUM
Definition json.h:42
GWEN_JSON_ELEM
struct GWEN_JSON_ELEM GWEN_JSON_ELEM
Definition json.h:33
GWEN_JsonElement_GetElementByPath
GWENHYWFAR_API GWEN_JSON_ELEM * GWEN_JsonElement_GetElementByPath(GWEN_JSON_ELEM *je, const char *path, uint32_t flags)
tree2.h
GWEN_TREE2_FUNCTION_LIB_DEFS
#define GWEN_TREE2_FUNCTION_LIB_DEFS(t, pr, decl)
Definition tree2.h:336