Flecs v4.0
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
json.h File Reference

JSON parser addon. More...

Go to the source code of this file.

Classes

struct  ecs_from_json_desc_t
 Used with ecs_ptr_from_json(), ecs_entity_from_json(). More...
 
struct  ecs_entity_to_json_desc_t
 Used with ecs_iter_to_json(). More...
 
struct  ecs_iter_to_json_desc_t
 Used with ecs_iter_to_json(). More...
 
struct  ecs_world_to_json_desc_t
 Used with ecs_iter_to_json(). More...
 

Macros

#define FLECS_JSON_H
 
#define ECS_ENTITY_TO_JSON_INIT
 Utility used to initialize JSON entity serializer.
 
#define ECS_ITER_TO_JSON_INIT
 Utility used to initialize JSON iterator serializer.
 

Typedefs

typedef struct ecs_from_json_desc_t ecs_from_json_desc_t
 Used with ecs_ptr_from_json(), ecs_entity_from_json().
 
typedef struct ecs_entity_to_json_desc_t ecs_entity_to_json_desc_t
 Used with ecs_iter_to_json().
 
typedef struct ecs_iter_to_json_desc_t ecs_iter_to_json_desc_t
 Used with ecs_iter_to_json().
 
typedef struct ecs_world_to_json_desc_t ecs_world_to_json_desc_t
 Used with ecs_iter_to_json().
 

Functions

FLECS_API const char * ecs_ptr_from_json (const ecs_world_t *world, ecs_entity_t type, void *ptr, const char *json, const ecs_from_json_desc_t *desc)
 Parse JSON string into value.
 
FLECS_API const char * ecs_entity_from_json (ecs_world_t *world, ecs_entity_t entity, const char *json, const ecs_from_json_desc_t *desc)
 Parse JSON object with multiple component values into entity.
 
FLECS_API const char * ecs_world_from_json (ecs_world_t *world, const char *json, const ecs_from_json_desc_t *desc)
 Parse JSON object with multiple entities into the world.
 
FLECS_API const char * ecs_world_from_json_file (ecs_world_t *world, const char *filename, const ecs_from_json_desc_t *desc)
 Same as ecs_world_from_json(), but loads JSON from file.
 
FLECS_API char * ecs_array_to_json (const ecs_world_t *world, ecs_entity_t type, const void *data, int32_t count)
 Serialize array into JSON string.
 
FLECS_API int ecs_array_to_json_buf (const ecs_world_t *world, ecs_entity_t type, const void *data, int32_t count, ecs_strbuf_t *buf_out)
 Serialize array into JSON string buffer.
 
FLECS_API char * ecs_ptr_to_json (const ecs_world_t *world, ecs_entity_t type, const void *data)
 Serialize value into JSON string.
 
FLECS_API int ecs_ptr_to_json_buf (const ecs_world_t *world, ecs_entity_t type, const void *data, ecs_strbuf_t *buf_out)
 Serialize value into JSON string buffer.
 
FLECS_API char * ecs_type_info_to_json (const ecs_world_t *world, ecs_entity_t type)
 Serialize type info to JSON.
 
FLECS_API int ecs_type_info_to_json_buf (const ecs_world_t *world, ecs_entity_t type, ecs_strbuf_t *buf_out)
 Serialize type info into JSON string buffer.
 
FLECS_API char * ecs_entity_to_json (const ecs_world_t *world, ecs_entity_t entity, const ecs_entity_to_json_desc_t *desc)
 Serialize entity into JSON string.
 
FLECS_API int ecs_entity_to_json_buf (const ecs_world_t *world, ecs_entity_t entity, ecs_strbuf_t *buf_out, const ecs_entity_to_json_desc_t *desc)
 Serialize entity into JSON string buffer.
 
FLECS_API char * ecs_iter_to_json (ecs_iter_t *iter, const ecs_iter_to_json_desc_t *desc)
 Serialize iterator into JSON string.
 
FLECS_API int ecs_iter_to_json_buf (ecs_iter_t *iter, ecs_strbuf_t *buf_out, const ecs_iter_to_json_desc_t *desc)
 Serialize iterator into JSON string buffer.
 
FLECS_API char * ecs_world_to_json (ecs_world_t *world, const ecs_world_to_json_desc_t *desc)
 Serialize world into JSON string.
 
FLECS_API int ecs_world_to_json_buf (ecs_world_t *world, ecs_strbuf_t *buf_out, const ecs_world_to_json_desc_t *desc)
 Serialize world into JSON string buffer.
 

Detailed Description

JSON parser addon.

Parse expression strings into component values. Entity identifiers, enumerations and bitmasks are encoded as strings.

See docs/FlecsRemoteApi.md for a description of the JSON format.

Definition in file json.h.

Macro Definition Documentation

◆ FLECS_JSON_H

#define FLECS_JSON_H

Definition at line 22 of file json.h.