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>2018-11-25 22:12:47 +0100
commitd6f1e256ad3fc59160f5cf60820572cc8b83ec7c (patch)
tree399ac0acb5198b7068c7765ccc90b6667d4d7e4a /serd/serd.h
parent3401e9c9b4d317c5b38e9f4aa48ce016871c9e99 (diff)
downloadserd-d6f1e256ad3fc59160f5cf60820572cc8b83ec7c.tar.gz
serd-d6f1e256ad3fc59160f5cf60820572cc8b83ec7c.tar.bz2
serd-d6f1e256ad3fc59160f5cf60820572cc8b83ec7c.zip
Move syntax name/extension utilities to public API
Diffstat (limited to 'serd/serd.h')
-rw-r--r--serd/serd.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/serd/serd.h b/serd/serd.h
index 4a6ac7a9..139578c0 100644
--- a/serd/serd.h
+++ b/serd/serd.h
@@ -407,6 +407,42 @@ 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);
+
+/**
+ 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
+bool
+serd_syntax_has_graphs(SerdSyntax syntax);
+
+/**
+ @}
@name URI
@{
*/