Skip to content
Flecs
v4.1
Search
Ctrl K
include
flecs
addons
cpp
mixins
json
entity_view.inl
Go to the documentation of this file.
1
/**
2
* @file addons/cpp/mixins/json/entity_view.inl
3
* @brief JSON entity mixin.
4
*/
5
6
/** Serialize an entity to JSON.
7
*
8
* @memberof flecs::entity_view
9
* @ingroup cpp_addons_json
10
*/
11
flecs::string
to_json
(
const
flecs::entity_to_json_desc_t *desc =
nullptr
)
const
{
12
char
*json =
ecs_entity_to_json
(
world_
,
id_
, desc);
13
return
flecs::string
(json);
14
}
ecs_entity_to_json
FLECS_API char * ecs_entity_to_json(ecs_world_t *world, ecs_entity_t entity, const ecs_entity_to_json_desc_t *desc)
Serialize entity into JSON string.
flecs::entity_view::to_json
flecs::string to_json(const flecs::entity_to_json_desc_t *desc=nullptr) const
Serialize an entity to JSON.
Definition
entity_view.inl:11
flecs::id::id_
flecs::id_t id_
The raw ID value.
Definition
decl.hpp:154
flecs::id::world_
flecs::world_t * world_
World is optional, but guarantees that entity identifiers extracted from the ID are valid.
Definition
decl.hpp:152
flecs::string
Owned string wrapper.
Definition
string.hpp:15
Esc
↑
↓
to navigate
↵
to open
Esc
to close