Helpers for converting Discord data types to/from JSON.
More...
|
| #define | discord_data_to_json(_symbol, _client, _data, _p_buf, _p_bufsize) |
| | Transform a Discord data type into a JSON string. More...
|
| |
| #define | discord_data_to_jsonb(_symbol, _client, _jb, _data, _p_buf, _p_bufsize) |
| | Transform a Discord data type into a jsonb handle. More...
|
| |
| #define | discord_data_from_json(_symbol, _client, _json, _len, _data) |
| | Parse a JSON string and fill a Discord data type. More...
|
| |
| #define | discord_data_from_jsmnf(_client, _p, _json, _length, _type, _data) |
| | Parse a jsmnf_pair and fill a Discord data type. More...
|
| |
|
| CCORDcode | discord_data_wrap_to_json (const struct reflectc_wrap *member, char *p_buf[], size_t *p_bufsize) |
| | Transform a wrapped Discord data type into a JSON string. More...
|
| |
| CCORDcode | discord_data_wrap_to_jsonb (struct jsonb *jb, const struct reflectc_wrap *member, char *p_buf[], size_t *p_bufsize) |
| | Transform a wrapped Discord data type into a jsonb handle. More...
|
| |
| CCORDcode | discord_data_wrap_from_json (const char *json, size_t len, struct reflectc_wrap *root) |
| | Parse a JSON string and fill a wrapped Discord data type. More...
|
| |
| CCORDcode | discord_data_wrap_from_jsmnf (const struct jsmnf_pair *p, const char *json, size_t length, const struct reflectc_wrap *member) |
| | Parse a jsmnf_pair and fill a wrapped Discord data type. More...
|
| |
Helpers for converting Discord data types to/from JSON.
◆ discord_data_to_json
| #define discord_data_to_json |
( |
|
_symbol, |
|
|
|
_client, |
|
|
|
_data, |
|
|
|
_p_buf, |
|
|
|
_p_bufsize |
|
) |
| |
Value:
CCORDcode discord_data_wrap_to_json(const struct reflectc_wrap *member, char *p_buf[], size_t *p_bufsize)
Transform a wrapped Discord data type into a JSON string.
#define discord_data_wrap_from(_symbol, _client, _data)
Wrap a Discord data type into a reflectc_wrap structure.
Definition: discord.h:480
Transform a Discord data type into a JSON string.
- Parameters
-
| _symbol | the Discord data type symbol (with struct or union) |
| _client | the client created with discord_from_token() |
| _data | the Discord data type to be transformed |
| _p_buf | pointer to the JSON buffer |
| _p_bufsize | pointer to the JSON buffer size |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
- Examples
- components.c.
◆ discord_data_to_jsonb
| #define discord_data_to_jsonb |
( |
|
_symbol, |
|
|
|
_client, |
|
|
|
_jb, |
|
|
|
_data, |
|
|
|
_p_buf, |
|
|
|
_p_bufsize |
|
) |
| |
Value:
_p_bufsize)
CCORDcode discord_data_wrap_to_jsonb(struct jsonb *jb, const struct reflectc_wrap *member, char *p_buf[], size_t *p_bufsize)
Transform a wrapped Discord data type into a jsonb handle.
Transform a Discord data type into a jsonb handle.
- Parameters
-
| _symbol | the Discord data type symbol (with struct or union) |
| _client | the client created with discord_from_token() |
| _jb | the jsonb handle |
| _data | the Discord data type to be transformed |
| _p_buf | pointer to the JSON buffer |
| _p_bufsize | pointer to the JSON buffer size |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_data_from_json
| #define discord_data_from_json |
( |
|
_symbol, |
|
|
|
_client, |
|
|
|
_json, |
|
|
|
_len, |
|
|
|
_data |
|
) |
| |
Value:
CCORDcode discord_data_wrap_from_json(const char *json, size_t len, struct reflectc_wrap *root)
Parse a JSON string and fill a wrapped Discord data type.
Parse a JSON string and fill a Discord data type.
- Parameters
-
| _symbol | the Discord data type symbol (with struct or union) |
| _client | the client created with discord_from_token() |
| _json | the JSON string |
| _len | length of json |
| _data | the Discord data type to be filled |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
- Examples
- components.c, and embed.c.
◆ discord_data_from_jsmnf
| #define discord_data_from_jsmnf |
( |
|
_client, |
|
|
|
_p, |
|
|
|
_json, |
|
|
|
_length, |
|
|
|
_type, |
|
|
|
_data |
|
) |
| |
Value:
CCORDcode discord_data_wrap_from_jsmnf(const struct jsmnf_pair *p, const char *json, size_t length, const struct reflectc_wrap *member)
Parse a jsmnf_pair and fill a wrapped Discord data type.
Parse a jsmnf_pair and fill a Discord data type.
- Parameters
-
| _client | the client created with discord_from_token() |
| _p | the jsmnf_pair |
| _json | the JSON string |
| _length | length of json |
| _type | the Discord data type symbol (without struct/union) |
| _data | the Discord data type to be filled |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_data_wrap_to_json()
| CCORDcode discord_data_wrap_to_json |
( |
const struct reflectc_wrap * |
member, |
|
|
char * |
p_buf[], |
|
|
size_t * |
p_bufsize |
|
) |
| |
Transform a wrapped Discord data type into a JSON string.
- Parameters
-
| member | the wrapped Discord data type |
| p_buf | pointer to the JSON buffer |
| p_bufsize | pointer to the JSON buffer size |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_data_wrap_to_jsonb()
| CCORDcode discord_data_wrap_to_jsonb |
( |
struct jsonb * |
jb, |
|
|
const struct reflectc_wrap * |
member, |
|
|
char * |
p_buf[], |
|
|
size_t * |
p_bufsize |
|
) |
| |
Transform a wrapped Discord data type into a jsonb handle.
- Parameters
-
| jb | the jsonb handle |
| member | the wrapped Discord data type |
| p_buf | pointer to the JSON buffer |
| p_bufsize | pointer to the JSON buffer size |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_data_wrap_from_json()
| CCORDcode discord_data_wrap_from_json |
( |
const char * |
json, |
|
|
size_t |
len, |
|
|
struct reflectc_wrap * |
root |
|
) |
| |
Parse a JSON string and fill a wrapped Discord data type.
- Parameters
-
| json | the JSON string |
| len | length of json |
| root | the root wrapped Discord data type |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary
◆ discord_data_wrap_from_jsmnf()
| CCORDcode discord_data_wrap_from_jsmnf |
( |
const struct jsmnf_pair * |
p, |
|
|
const char * |
json, |
|
|
size_t |
length, |
|
|
const struct reflectc_wrap * |
member |
|
) |
| |
Parse a jsmnf_pair and fill a wrapped Discord data type.
- Parameters
-
| p | the jsmnf_pair |
| json | the JSON string |
| length | length of json |
| member | the wrapped Discord data type |
- Returns
- CCORDcode value for how the operation went, CCORD_OK means nothing out of the ordinary