node-addon-layer
C API For writing Node modules
|
Functions | |
shim_val_t * | shim_string_new (shim_ctx_t *ctx) |
shim_val_t * | shim_string_new_copy (shim_ctx_t *ctx, const char *data) |
shim_val_t * | shim_string_new_copyn (shim_ctx_t *ctx, const char *data, size_t len) |
size_t | shim_string_length (shim_val_t *val) |
size_t | shim_string_length_utf8 (shim_val_t *val) |
const char * | shim_string_value (shim_val_t *val) |
size_t | shim_string_write_ascii (shim_val_t *val, char *buff, size_t start, size_t len, int32_t options) |
Methods for strings
size_t shim_string_length | ( | shim_val_t * | val) |
Get the length of the string
val | The given string |
size_t shim_string_length_utf8 | ( | shim_val_t * | val) |
Get the UTF-8 encoded length of the string
val | The given string |
shim_val_t* shim_string_new | ( | shim_ctx_t * | ctx) |
Create a new empty string
ctx | Current executing context |
shim_val_t* shim_string_new_copy | ( | shim_ctx_t * | ctx, |
const char * | data | ||
) |
Create a new string and from the null terminated C string
ctx | Current executing context |
data | Source null terminated string |
shim_val_t* shim_string_new_copyn | ( | shim_ctx_t * | ctx, |
const char * | data, | ||
size_t | len | ||
) |
Create a new string of the given length from the existing buffer
ctx | Current executing context |
data | Source string |
len | Length of created string |
const char* shim_string_value | ( | shim_val_t * | val) |
Get the value of the string
val | The given string |
The caller is responsible for free'ing this memory
size_t shim_string_write_ascii | ( | shim_val_t * | val, |
char * | buff, | ||
size_t | start, | ||
size_t | len, | ||
int32_t | options | ||
) |
Write the value of the string to a buffer
val | The given string |
buff | The destination buffer |
start | The starting position to encode |
len | The length of the string to create |
options | The options for how to encode the string |