JSON functions for sds strings.
More...
#include "dist/sds/sds.h"
#include <stdbool.h>
#include <stdio.h>
Go to the source code of this file.
JSON functions for sds strings.
◆ sds_catjson()
| sds sds_catjson |
( |
sds | s, |
|
|
const char * | p, |
|
|
size_t | len ) |
Append to the sds string "s" a quoted json escaped string After the call, the modified sds string is no longer valid and all the references must be substituted with the new pointer returned by the call.
- Parameters
-
| s | sds string |
| p | string to append json escaped |
| len | length of the string to append |
- Returns
- modified sds string
◆ sds_catjson_plain()
| sds sds_catjson_plain |
( |
sds | s, |
|
|
const char * | p, |
|
|
size_t | len ) |
Append to the sds string "s" a json escaped string After the call, the modified sds string is no longer valid and all the references must be substituted with the new pointer returned by the call.
- Parameters
-
| s | sds string |
| p | string to append json escaped |
| len | length of the string to append |
- Returns
- modified sds string
◆ sds_catjsonchar()
| sds sds_catjsonchar |
( |
sds | s, |
|
|
const char | c ) |
Append to the sds string "s" an json escaped character After the call, the modified sds string is no longer valid and all the references must be substituted with the new pointer returned by the call.
- Parameters
-
| s | sds string |
| c | char to escape and append |
- Returns
- modified sds string
◆ sds_json_unescape()
| bool sds_json_unescape |
( |
const char * | src, |
|
|
size_t | slen, |
|
|
sds * | dst ) |
Json unescapes "src" and appends the result to the sds string "dst" "dst" must be a pointer to a allocated sds string.
- Parameters
-
| src | string to unescape |
| slen | string length to unescape |
| dst | pointer to sds string to append the unescaped string |
- Returns
- true on success, false on error