LMMS
Loading...
Searching...
No Matches

Functions

SERD_API SerdNode serd_node_from_string (SerdType type, const uint8_t *SERD_NULLABLE str)
SERD_API SerdNode serd_node_from_substring (SerdType type, const uint8_t *SERD_NULLABLE str, size_t len)
SERD_API SerdNode serd_node_new_uri_from_node (const SerdNode *SERD_NONNULL uri_node, const SerdURI *SERD_NULLABLE base, SerdURI *SERD_NULLABLE out)
 Simple wrapper for serd_node_new_uri() to resolve a URI node.
SERD_API SerdNode serd_node_new_uri_from_string (const uint8_t *SERD_NULLABLE str, const SerdURI *SERD_NULLABLE base, SerdURI *SERD_NULLABLE out)
 Simple wrapper for serd_node_new_uri() to resolve a URI string.
SERD_API SerdNode serd_node_new_file_uri (const uint8_t *SERD_NONNULL path, const uint8_t *SERD_NULLABLE hostname, SerdURI *SERD_NULLABLE out, bool escape)
SERD_API SerdNode serd_node_new_uri (const SerdURI *SERD_NONNULL uri, const SerdURI *SERD_NULLABLE base, SerdURI *SERD_NULLABLE out)
SERD_API SerdNode serd_node_new_relative_uri (const SerdURI *SERD_NONNULL uri, const SerdURI *SERD_NULLABLE base, const SerdURI *SERD_NULLABLE root, SerdURI *SERD_NULLABLE out)
SERD_API SerdNode serd_node_new_decimal (double d, unsigned frac_digits)
SERD_API SerdNode serd_node_new_integer (int64_t i)
 Create a new node by serialising i into an xsd:integer string.
SERD_API SerdNode serd_node_new_blob (const void *SERD_NONNULL buf, size_t size, bool wrap_lines)
SERD_API SerdNode serd_node_copy (const SerdNode *SERD_NULLABLE node)
SERD_PURE_API bool serd_node_equals (const SerdNode *SERD_NONNULL a, const SerdNode *SERD_NONNULL b)
 Return true iff a is equal to b.
SERD_API void serd_node_free (SerdNode *SERD_NULLABLE node)

Variables

static const SerdNode SERD_NODE_NULL = {NULL, 0, 0, 0, SERD_NOTHING}

Detailed Description

Function Documentation

◆ serd_node_copy()

SERD_API SerdNode serd_node_copy ( const SerdNode *SERD_NULLABLE node)

Make a deep copy of node.

Returns
a node that the caller must free with serd_node_free().

◆ serd_node_equals()

SERD_PURE_API bool serd_node_equals ( const SerdNode *SERD_NONNULL a,
const SerdNode *SERD_NONNULL b )

Return true iff a is equal to b.

◆ serd_node_free()

SERD_API void serd_node_free ( SerdNode *SERD_NULLABLE node)

Free any data owned by node.

Note that if node is itself dynamically allocated (which is not the case for nodes created internally by serd), it will not be freed.

◆ serd_node_from_string()

SERD_API SerdNode serd_node_from_string ( SerdType type,
const uint8_t *SERD_NULLABLE str )

Make a (shallow) node from str.

This measures, but does not copy, str. No memory is allocated.

◆ serd_node_from_substring()

SERD_API SerdNode serd_node_from_substring ( SerdType type,
const uint8_t *SERD_NULLABLE str,
size_t len )

Make a (shallow) node from a prefix of str.

This measures, but does not copy, str. No memory is allocated. Note that the returned node may not be null terminated.

◆ serd_node_new_blob()

SERD_API SerdNode serd_node_new_blob ( const void *SERD_NONNULL buf,
size_t size,
bool wrap_lines )

Create a node by serialising buf into an xsd:base64Binary string

This function can be used to make a serialisable node out of arbitrary binary data, which can be decoded using serd_base64_decode().

Parameters
bufRaw binary input data.
sizeSize of buf.
wrap_linesWrap lines at 76 characters to conform to RFC 2045.

◆ serd_node_new_decimal()

SERD_API SerdNode serd_node_new_decimal ( double d,
unsigned frac_digits )

Create a new node by serialising d into an xsd:decimal string

The resulting node will always contain a .', start with a digit, and end with a digit (i.e. will have a leading and/or trailing 0' if necessary). It will never be in scientific notation. A maximum of frac_digits digits will be written after the decimal point, but trailing zeros will automatically be omitted (except one if d is a round integer).

Note that about 16 and 8 fractional digits are required to precisely represent a double and float, respectively.

Parameters
dThe value for the new node.
frac_digitsThe maximum number of digits after the decimal place.

◆ serd_node_new_file_uri()

SERD_API SerdNode serd_node_new_file_uri ( const uint8_t *SERD_NONNULL path,
const uint8_t *SERD_NULLABLE hostname,
SerdURI *SERD_NULLABLE out,
bool escape )

Create a new file URI node from a file system path and optional hostname.

Backslashes in Windows paths will be converted and '' will always be percent encoded. If escape is true, all other invalid characters will be percent encoded as well.

If path is relative, hostname is ignored. If out is not NULL, it will be set to the parsed URI.

◆ serd_node_new_integer()

SERD_API SerdNode serd_node_new_integer ( int64_t i)

Create a new node by serialising i into an xsd:integer string.

◆ serd_node_new_relative_uri()

Create a new node by serialising uri into a new relative URI.

Parameters
uriThe URI to serialise.
baseBase URI to make uri relative to, if possible.
rootRoot URI for resolution (see serd_uri_serialise_relative()).
outSet to the parsing of the new URI (i.e. points only to memory owned by the new returned node).

◆ serd_node_new_uri()

Create a new node by serialising uri into a new string.

Parameters
uriThe URI to serialise.
baseBase URI to resolve uri against (or NULL for no resolution).
outSet to the parsing of the new URI (i.e. points only to memory owned by the new returned node).

◆ serd_node_new_uri_from_node()

SERD_API SerdNode serd_node_new_uri_from_node ( const SerdNode *SERD_NONNULL uri_node,
const SerdURI *SERD_NULLABLE base,
SerdURI *SERD_NULLABLE out )

Simple wrapper for serd_node_new_uri() to resolve a URI node.

◆ serd_node_new_uri_from_string()

SERD_API SerdNode serd_node_new_uri_from_string ( const uint8_t *SERD_NULLABLE str,
const SerdURI *SERD_NULLABLE base,
SerdURI *SERD_NULLABLE out )

Simple wrapper for serd_node_new_uri() to resolve a URI string.

Variable Documentation

◆ SERD_NODE_NULL

const SerdNode SERD_NODE_NULL = {NULL, 0, 0, 0, SERD_NOTHING}
static