aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-01-13 16:13:46 +0100
committerDavid Robillard <d@drobilla.net>2022-01-13 23:03:40 -0500
commitdcff19f69bb5cbd718d507e7af6814b997bc4c3f (patch)
treebe52e8387e6358601d5e2e7fcf094de6e0f98097 /include
parente2b1c1de25366f70db4cd00f1bb61eda513eb74b (diff)
downloadserd-dcff19f69bb5cbd718d507e7af6814b997bc4c3f.tar.gz
serd-dcff19f69bb5cbd718d507e7af6814b997bc4c3f.tar.bz2
serd-dcff19f69bb5cbd718d507e7af6814b997bc4c3f.zip
Simplify literal construction API
Diffstat (limited to 'include')
-rw-r--r--include/serd/serd.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 766844be..1d1ae70a 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -547,16 +547,25 @@ SerdNode* SERD_ALLOCATED
serd_new_string(SerdStringView string);
/**
- Create a new literal node from `str`.
+ Create a new plain literal node from `str` with `lang`.
- Either `datatype_uri` or `lang` can be given, but not both, unless
- `datatype_uri` is rdf:langString in which case it is ignored.
+ A plain literal has no datatype, but may have a language tag. The `lang`
+ may be empty, in which case this is equivalent to `serd_new_string()`.
*/
SERD_API
SerdNode* SERD_ALLOCATED
-serd_new_literal(SerdStringView string,
- SerdStringView datatype_uri,
- SerdStringView lang);
+serd_new_plain_literal(SerdStringView str, SerdStringView lang);
+
+/**
+ Create a new typed literal node from `str`.
+
+ A typed literal has no language tag, but may have a datatype. The
+ `datatype` may be NULL, in which case this is equivalent to
+ `serd_new_string()`.
+*/
+SERD_API
+SerdNode* SERD_ALLOCATED
+serd_new_typed_literal(SerdStringView str, SerdStringView datatype_uri);
/// Create a new blank node
SERD_API