aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-10 09:45:15 +0100
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:06 -0500
commit8f1192bb2361fcd7907b926e86c41a171ed04ad0 (patch)
treefdaeb65c1210c09128b890cd452b7940644e49a4 /include
parent79367b620492ac941f41c61adbffc29867ac0998 (diff)
downloadserd-8f1192bb2361fcd7907b926e86c41a171ed04ad0.tar.gz
serd-8f1192bb2361fcd7907b926e86c41a171ed04ad0.tar.bz2
serd-8f1192bb2361fcd7907b926e86c41a171ed04ad0.zip
Add serd_new_real_file_uri()
Diffstat (limited to 'include')
-rw-r--r--include/serd/serd.h16
1 files changed, 16 insertions, 0 deletions
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
@@ -674,6 +674,22 @@ 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
The resulting node will always contain a `.', start with a digit, and end