Flecs: Json
Description: A fast entity component system (ECS) for C & C++

| Flecs v4.0 A fast entity component system (ECS) for C & C++

Loading...
Searching...
No Matches
Typedefs | Functions
Json
C++ API » Addons

Functions for serializing to/from JSON. More...

Collaboration diagram for Json:

## Typedefs
using | flecs::from_json_desc_t = ecs_from_json_desc_t
using | flecs::entity_to_json_desc_t = ecs_entity_to_json_desc_t
using | flecs::iter_to_json_desc_t = ecs_iter_to_json_desc_t

## Functions
const char * | flecs::entity::from_json (const char *json)
| Deserialize entity to JSON.
flecs::string | flecs::entity_view::to_json (const flecs::entity_to_json_desc_t *desc=nullptr) const
| Serialize entity to JSON.
const Self & | flecs::entity_builder< Self >::set_json (flecs::id_t e, const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set component from JSON.
const Self & | flecs::entity_builder< Self >::set_json (flecs::entity_t r, flecs::entity_t t, const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set pair from JSON.
template<typename T >
const Self & | flecs::entity_builder< Self >::set_json (const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set component from JSON.
template<typename R , typename T >
const Self & | flecs::entity_builder< Self >::set_json (const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set pair from JSON.
template<typename R >
const Self & | flecs::entity_builder< Self >::set_json (flecs::entity_t t, const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set pair from JSON.
template<typename T >
const Self & | flecs::entity_builder< Self >::set_json_second (flecs::entity_t r, const char *json, flecs::from_json_desc_t *desc=nullptr) const
| Set pair from JSON.
flecs::string | flecs::iter_iterable< Components >::to_json (flecs::iter_to_json_desc_t *desc=nullptr)
| Serialize iterator result to JSON.
flecs::string | flecs::world::to_json (flecs::entity_t tid, const void *value)
| Serialize untyped value to JSON.
template<typename T >
flecs::string | flecs::world::to_json (const T *value)
| Serialize value to JSON.
flecs::string | flecs::world::to_json ()
| Serialize world to JSON.
const char * | flecs::world::from_json (flecs::entity_t tid, void *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
| Deserialize value from JSON.
template<typename T >
const char * | flecs::world::from_json (T *value, const char *json, flecs::from_json_desc_t *desc=nullptr)
| Deserialize value from JSON.
const char * | flecs::world::from_json (const char *json, flecs::from_json_desc_t *desc=nullptr)
| Deserialize JSON into world.
const char * | flecs::world::from_json_file (const char *json, flecs::from_json_desc_t *desc=nullptr)
| Deserialize JSON file into world.
flecs::string | flecs::iter::to_json (flecs::iter_to_json_desc_t *desc=nullptr)
| Serialize iterator result to JSON.

## Detailed Description

Functions for serializing to/from JSON.

## Typedef Documentation

## ◆ entity_to_json_desc_t

using flecs::entity_to_json_desc_t = ecs_entity_to_json_desc_t

Definition at line 19 of file decl.hpp.

## ◆ from_json_desc_t

using flecs::from_json_desc_t = ecs_from_json_desc_t

Definition at line 18 of file decl.hpp.

## ◆ iter_to_json_desc_t

using flecs::iter_to_json_desc_t = ecs_iter_to_json_desc_t

Definition at line 20 of file decl.hpp.

## Function Documentation

## ◆ from_json() [1/4]

const char * from_json | ( | const char * | json | ) |
| inline

Deserialize entity to JSON.

Definition at line 8 of file entity.hpp.

## ◆ from_json() [2/4]

const char * from_json | ( | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr )
| inline

Deserialize JSON into world.

Definition at line 62 of file world.hpp.

## ◆ from_json() [3/4]

const char * from_json | ( | flecs::entity_t | tid,
|  | void * | value,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr )
| inline

Deserialize value from JSON.

Definition at line 42 of file world.hpp.

## ◆ from_json() [4/4]

template<typename T >

const char * from_json | ( | T * | value,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr )
| inline

Deserialize value from JSON.

Definition at line 52 of file world.hpp.

## ◆ from_json_file()

const char * from_json_file | ( | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr )
| inline

Deserialize JSON file into world.

Definition at line 71 of file world.hpp.

## ◆ set_json() [1/5]

template<typename Self >
template<typename T >

const Self & set_json | ( | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set component from JSON.

Definition at line 51 of file builder.hpp.

## ◆ set_json() [2/5]

template<typename Self >
template<typename R , typename T >

const Self & set_json | ( | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set pair from JSON.

Definition at line 64 of file builder.hpp.

## ◆ set_json() [3/5]

template<typename Self >

const Self & set_json | ( | flecs::entity_t | r,
|  | flecs::entity_t | t,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set pair from JSON.

Definition at line 36 of file builder.hpp.

## ◆ set_json() [4/5]

template<typename Self >
template<typename R >

const Self & set_json | ( | flecs::entity_t | t,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set pair from JSON.

Definition at line 80 of file builder.hpp.

## ◆ set_json() [5/5]

template<typename Self >

const Self & set_json | ( | flecs::id_t | e,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set component from JSON.

Definition at line 12 of file builder.hpp.

## ◆ set_json_second()

template<typename Self >
template<typename T >

const Self & set_json_second | ( | flecs::entity_t | r,
|  | const char * | json,
|  | flecs::from_json_desc_t * | desc = nullptr ) const
| inline

Set pair from JSON.

Definition at line 96 of file builder.hpp.

## ◆ to_json() [1/6]

flecs::string to_json | ( | const flecs::entity_to_json_desc_t * | desc = nullptr | ) | const
| inline

Serialize entity to JSON.

Definition at line 12 of file entity_view.hpp.

## ◆ to_json() [2/6]

flecs::string to_json | ( | flecs::iter_to_json_desc_t * | desc = nullptr | ) |

Serialize iterator result to JSON.

Definition at line 11 of file iterable.inl.

## ◆ to_json() [3/6]

template<typename ... Components>

flecs::string to_json | ( | flecs::iter_to_json_desc_t * | desc = nullptr | ) |
| inline

Serialize iterator result to JSON.

Definition at line 12 of file iterable.hpp.

## ◆ to_json() [4/6]

flecs::string to_json | ( |  | ) |
| inline

Serialize world to JSON.

Definition at line 33 of file world.hpp.

## ◆ to_json() [5/6]

template<typename T >

flecs::string to_json | ( | const T * | value | ) |
| inline

Serialize value to JSON.

Definition at line 23 of file world.hpp.

## ◆ to_json() [6/6]

flecs::string to_json | ( | flecs::entity_t | tid,
|  | const void * | value )
| inline

Serialize untyped value to JSON.

Definition at line 12 of file world.hpp.