From 8f1192bb2361fcd7907b926e86c41a171ed04ad0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 10 Nov 2020 09:45:15 +0100 Subject: Add serd_new_real_file_uri() --- include/serd/serd.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/serd') diff --git a/include/serd/serd.h b/include/serd/serd.h index a2e767ff..dd165360 100644 --- a/include/serd/serd.h +++ b/include/serd/serd.h @@ -673,6 +673,22 @@ SERD_API SerdNode* SERD_ALLOCATED serd_new_boolean(bool b); +/** + Create a new file URI node for a file that exists on this system. + + This is like serd_new_file_uri() except it resolves and canonicalizes the + path, so the returned node is always a complete file URI with a scheme and + absolute path that does not contain any dot references or links, or NULL if + this is impossible (for example, because the path does not exist). + + This should be used wherever the URI for an existent file is required, for + example to set the base URI of a document. +*/ +SERD_API +SerdNode* SERD_ALLOCATED +serd_new_real_file_uri(const char* SERD_NULLABLE path, + const char* SERD_NULLABLE hostname); + /** Create a new node by serialising `d` into an xsd:decimal string -- cgit v1.2.1