Flecs: Doc
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
Classes | Typedefs | Functions | Variables
Doc
C API » Addons

Utilities for documenting entities, components and systems. More...

Collaboration diagram for Doc:

## Classes
struct | EcsDocDescription
| Component that stores description. More...

## Typedefs
typedef struct EcsDocDescription | EcsDocDescription
| Component that stores description.

## Functions
FLECS_API const ecs_entity_t | ecs_id (EcsDocDescription)
| Component id for EcsDocDescription.
FLECS_API void | ecs_doc_set_uuid (ecs_world_t *world, ecs_entity_t entity, const char *uuid)
| Add UUID to entity.
FLECS_API void | ecs_doc_set_name (ecs_world_t *world, ecs_entity_t entity, const char *name)
| Add human-readable name to entity.
FLECS_API void | ecs_doc_set_brief (ecs_world_t *world, ecs_entity_t entity, const char *description)
| Add brief description to entity.
FLECS_API void | ecs_doc_set_detail (ecs_world_t *world, ecs_entity_t entity, const char *description)
| Add detailed description to entity.
FLECS_API void | ecs_doc_set_link (ecs_world_t *world, ecs_entity_t entity, const char *link)
| Add link to external documentation to entity.
FLECS_API void | ecs_doc_set_color (ecs_world_t *world, ecs_entity_t entity, const char *color)
| Add color to entity.
FLECS_API const char * | ecs_doc_get_uuid (const ecs_world_t *world, ecs_entity_t entity)
| Get UUID from entity.
FLECS_API const char * | ecs_doc_get_name (const ecs_world_t *world, ecs_entity_t entity)
| Get human readable name from entity.
FLECS_API const char * | ecs_doc_get_brief (const ecs_world_t *world, ecs_entity_t entity)
| Get brief description from entity.
FLECS_API const char * | ecs_doc_get_detail (const ecs_world_t *world, ecs_entity_t entity)
| Get detailed description from entity.
FLECS_API const char * | ecs_doc_get_link (const ecs_world_t *world, ecs_entity_t entity)
| Get link to external documentation from entity.
FLECS_API const char * | ecs_doc_get_color (const ecs_world_t *world, ecs_entity_t entity)
| Get color from entity.
FLECS_API void | FlecsDocImport (ecs_world_t *world)
| Doc module import function.

## Variables
FLECS_API const ecs_entity_t | EcsDocUuid
| Tag for adding a UUID to entities.
FLECS_API const ecs_entity_t | EcsDocBrief
| Tag for adding brief descriptions to entities.
FLECS_API const ecs_entity_t | EcsDocDetail
| Tag for adding detailed descriptions to entities.
FLECS_API const ecs_entity_t | EcsDocLink
| Tag for adding a link to entities.
FLECS_API const ecs_entity_t | EcsDocColor
| Tag for adding a color to entities.

## Detailed Description

Utilities for documenting entities, components and systems.

## Typedef Documentation

## ◆ EcsDocDescription

typedef struct EcsDocDescription EcsDocDescription

Component that stores description.

Used as pair together with the following tags to store entity documentation:

- EcsName
- EcsDocBrief
- EcsDocDetail
- EcsDocLink
- EcsDocColor

## Function Documentation

## ◆ ecs_doc_get_brief()

FLECS_API const char * ecs_doc_get_brief | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get brief description from entity.

Parameters

  world | The world.
  entity | The entity from which to get the description.

Returns
  The description.

See also
  ecs_doc_set_brief()
  flecs::doc::get_brief()
  flecs::entity_view::get_doc_brief()

## ◆ ecs_doc_get_color()

FLECS_API const char * ecs_doc_get_color | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get color from entity.

Parameters

  world | The world.
  entity | The entity from which to get the color.

Returns
  The color.

See also
  ecs_doc_set_color()
  flecs::doc::get_color()
  flecs::entity_view::get_doc_color()

## ◆ ecs_doc_get_detail()

FLECS_API const char * ecs_doc_get_detail | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get detailed description from entity.

Parameters

  world | The world.
  entity | The entity from which to get the description.

Returns
  The description.

See also
  ecs_doc_set_detail()
  flecs::doc::get_detail()
  flecs::entity_view::get_doc_detail()

## ◆ ecs_doc_get_link()

FLECS_API const char * ecs_doc_get_link | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get link to external documentation from entity.

Parameters

  world | The world.
  entity | The entity from which to get the link.

Returns
  The link.

See also
  ecs_doc_set_link()
  flecs::doc::get_link()
  flecs::entity_view::get_doc_link()

## ◆ ecs_doc_get_name()

FLECS_API const char * ecs_doc_get_name | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get human readable name from entity.

If entity does not have an explicit human readable name, this operation will return the entity name.

To test if an entity has a human readable name, use:

ecs_has_pair(world, e, ecs_id(EcsDocDescription), EcsName);
EcsName
const ecs_entity_t EcsName
Tag to indicate name identifier.
ecs_id
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component id for EcsDocDescription.
EcsDocDescription
Component that stores description.
Definition doc.h:67

Or in C++:

e.has<flecs::doc::Description>(flecs::Name);
flecs::doc::Description
EcsDocDescription Description
flecs.doc.Description component
Definition decl.hpp:20

Parameters

  world | The world.
  entity | The entity from which to get the name.

Returns
  The name.

See also
  ecs_doc_set_name()
  flecs::doc::get_name()
  flecs::entity_view::get_doc_name()

## ◆ ecs_doc_get_uuid()

FLECS_API const char * ecs_doc_get_uuid | ( | const ecs_world_t * | world,
|  | ecs_entity_t | entity )

Get UUID from entity.

Parameters

  world | The world.
  entity | The entity from which to get the UUID.

Returns
  The UUID.

See also
  ecs_doc_set_uuid()
  flecs::doc::get_uuid()
  flecs::entity_view::get_doc_uuid()

## ◆ ecs_doc_set_brief()

FLECS_API void ecs_doc_set_brief | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | description )

Add brief description to entity.

Parameters

  world | The world.
  entity | The entity to which to add the description.
  description | The description to add.

See also
  ecs_doc_get_brief()
  flecs::doc::set_brief()
  flecs::entity_builder::set_doc_brief()

## ◆ ecs_doc_set_color()

FLECS_API void ecs_doc_set_color | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | color )

Add color to entity.

UIs can use color as hint to improve visualizing entities.

Parameters

  world | The world.
  entity | The entity to which to add the link.
  color | The color to add.

See also
  ecs_doc_get_color()
  flecs::doc::set_color()
  flecs::entity_builder::set_doc_color()

## ◆ ecs_doc_set_detail()

FLECS_API void ecs_doc_set_detail | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | description )

Add detailed description to entity.

Parameters

  world | The world.
  entity | The entity to which to add the description.
  description | The description to add.

See also
  ecs_doc_get_detail()
  flecs::doc::set_detail()
  flecs::entity_builder::set_doc_detail()

## ◆ ecs_doc_set_link()

FLECS_API void ecs_doc_set_link | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | link )

Add link to external documentation to entity.

Parameters

  world | The world.
  entity | The entity to which to add the link.
  link | The link to add.

See also
  ecs_doc_get_link()
  flecs::doc::set_link()
  flecs::entity_builder::set_doc_link()

## ◆ ecs_doc_set_name()

FLECS_API void ecs_doc_set_name | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | name )

Add human-readable name to entity.

Contrary to entity names, human readable names do not have to be unique and can contain special characters used in the query language like '*'.

Parameters

  world | The world.
  entity | The entity to which to add the name.
  name | The name to add.

See also
  ecs_doc_get_name()
  flecs::doc::set_name()
  flecs::entity_builder::set_doc_name()

## ◆ ecs_doc_set_uuid()

FLECS_API void ecs_doc_set_uuid | ( | ecs_world_t * | world,
|  | ecs_entity_t | entity,
|  | const char * | uuid )

Add UUID to entity.

Associate entity with an (external) UUID.

Parameters

  world | The world.
  entity | The entity to which to add the UUID.
  uuid | The UUID to add.

See also
  ecs_doc_get_uuid()
  flecs::doc::set_uuid()
  flecs::entity_builder::set_doc_uuid()

## ◆ FlecsDocImport()

FLECS_API void FlecsDocImport | ( | ecs_world_t * | world | ) |

Doc module import function.

Usage:

ECS_IMPORT(world, FlecsDoc)
ECS_IMPORT
#define ECS_IMPORT(world, id)
Wrapper around ecs_import().
Definition module.h:119

Parameters

  world | The world.

## Variable Documentation

## ◆ EcsDocBrief

FLECS_API const ecs_entity_t EcsDocBrief
| extern

Tag for adding brief descriptions to entities.

Added to an entity as (EcsDocDescription, EcsBrief) by ecs_doc_set_brief().

## ◆ EcsDocColor

FLECS_API const ecs_entity_t EcsDocColor
| extern

Tag for adding a color to entities.

Added to an entity as (EcsDocDescription, EcsDocColor) by ecs_doc_set_link().

## ◆ EcsDocDetail

FLECS_API const ecs_entity_t EcsDocDetail
| extern

Tag for adding detailed descriptions to entities.

Added to an entity as (EcsDocDescription, EcsDocDetail) by ecs_doc_set_detail().

## ◆ EcsDocLink

FLECS_API const ecs_entity_t EcsDocLink
| extern

Tag for adding a link to entities.

Added to an entity as (EcsDocDescription, EcsDocLink) by ecs_doc_set_link().

## ◆ EcsDocUuid

FLECS_API const ecs_entity_t EcsDocUuid
| extern

Tag for adding a UUID to entities.

Added to an entity as (EcsDocDescription, EcsUuid) by ecs_doc_set_uuid().