URI¶
-
struct
SerdURI¶ A parsed URI.
This struct directly refers to chunks in other strings, it does not own any memory itself. Thus, URIs can be parsed and/or resolved against a base URI in-place without allocating memory.
Authority.
-
uint8_t *
serd_file_uri_parse(const uint8_t *uri, uint8_t **hostname)¶ Get the unescaped path and hostname from a file URI.
The returned path and
*hostnamemust be freed withserd_free().- Parameters
uri – A file URI.
hostname – If non-NULL, set to the hostname, if present.
- Returns
The path component of the URI.
-
bool
serd_uri_string_has_scheme(const uint8_t *utf8)¶ Return true iff
utf8starts with a valid URI scheme.
-
SerdStatus
serd_uri_parse(const uint8_t *utf8, SerdURI *out)¶ Parse
utf8, writing result toout
-
void
serd_uri_resolve(const SerdURI *r, const SerdURI *base, SerdURI *t)¶ Set target
tto referencerresolved againstbase.
-
size_t
serd_uri_serialise(const SerdURI *uri, SerdSink sink, void *stream)¶ Serialise
uriwith a series of calls tosink
-
size_t
serd_uri_serialise_relative(const SerdURI *uri, const SerdURI *base, const SerdURI *root, SerdSink sink, void *stream)¶ Serialise
urirelative tobasewith a series of calls tosinkThe
uriis written as a relative URI iff if it a child ofbaseandroot. The optionalrootparameter must be a prefix ofbaseand can be used keep up-references (“../”) within a certain namespace.