LMMS
Loading...
Searching...
No Matches
String Utilities

Functions

SERD_CONST_API const uint8_t *SERD_NONNULL serd_strerror (SerdStatus status)
 Return a string describing a status code.
SERD_API size_t serd_strlen (const uint8_t *SERD_NONNULL str, size_t *SERD_NULLABLE n_bytes, SerdNodeFlags *SERD_NULLABLE flags)
SERD_API double serd_strtod (const char *SERD_NONNULL str, char *SERD_NONNULL *SERD_NULLABLE endptr)
SERD_API void *SERD_ALLOCATED serd_base64_decode (const uint8_t *SERD_NONNULL str, size_t len, size_t *SERD_NONNULL size)

Detailed Description

Function Documentation

◆ serd_base64_decode()

SERD_API void *SERD_ALLOCATED serd_base64_decode ( const uint8_t *SERD_NONNULL str,
size_t len,
size_t *SERD_NONNULL size )

Decode a base64 string.

This function can be used to deserialise a blob node created with serd_node_new_blob().

Parameters
strBase64 string to decode.
lenThe length of str.
sizeSet to the size of the returned blob in bytes.
Returns
A newly allocated blob which must be freed with serd_free().

◆ serd_strerror()

Return a string describing a status code.

◆ serd_strlen()

SERD_API size_t serd_strlen ( const uint8_t *SERD_NONNULL str,
size_t *SERD_NULLABLE n_bytes,
SerdNodeFlags *SERD_NULLABLE flags )

Measure a UTF-8 string.

Returns
Length of str in characters (except NULL).
Parameters
strA null-terminated UTF-8 string.
n_bytes(Output) Set to the size of str in bytes (except NULL).
flags(Output) Set to the applicable flags.

◆ serd_strtod()

SERD_API double serd_strtod ( const char *SERD_NONNULL str,
char *SERD_NONNULL *SERD_NULLABLE endptr )

Parse a string to a double.

The API of this function is identical to the standard C strtod function, except this function is locale-independent and always matches the lexical format used in the Turtle grammar (the decimal point is always ".").