aboutsummaryrefslogtreecommitdiffstats
path: root/serd/serd.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-05-27 15:32:12 +0200
committerDavid Robillard <d@drobilla.net>2020-06-21 18:12:04 +0200
commite87c35f42daa4e36cb31cc0152a3e5bcf68aa84d (patch)
tree8695450eb1c2730a42e053e903e26d9f72d6e99d /serd/serd.h
parentd32c53f4ef0b4197a82c5c3b836c84d2310f64ee (diff)
downloadserd-e87c35f42daa4e36cb31cc0152a3e5bcf68aa84d.tar.gz
serd-e87c35f42daa4e36cb31cc0152a3e5bcf68aa84d.tar.bz2
serd-e87c35f42daa4e36cb31cc0152a3e5bcf68aa84d.zip
Move syntax name/extension utilities to public API
Diffstat (limited to 'serd/serd.h')
-rw-r--r--serd/serd.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h
index e578a85a..df74fc59 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -398,6 +398,41 @@ typedef size_t (*SerdWriteFunc)(const void* buf,
/**
@}
+ @name Syntax Utilities
+ @{
+*/
+
+/**
+ Get a syntax by name.
+
+ Case-insensitive, supports "Turtle", "NTriples", "NQuads", and "TriG". Zero
+ is returned if the name is not recognized.
+*/
+SERD_API
+SerdSyntax
+serd_syntax_by_name(const char* name);
+
+/**
+ Guess a syntax from a filename.
+
+ This uses the file extension to guess the syntax of a file. Zero is
+ returned if the extension is not recognized.
+*/
+SERD_API
+SerdSyntax
+serd_guess_syntax(const char* filename);
+
+/**
+ Return whether a syntax can represent multiple graphs.
+
+ @return True for SERD_NQUADS and SERD_TRIG, false otherwise.
+*/
+SERD_API
+bool
+serd_syntax_has_graphs(SerdSyntax syntax);
+
+/**
+ @}
@name URI
@{
*/