aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd/serd.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/serd/serd.h')
-rw-r--r--include/serd/serd.h30
1 files changed, 11 insertions, 19 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 68dec4f3..88d3178b 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -231,10 +231,9 @@ typedef enum {
/// Flags indicating certain string properties relevant to serialisation
typedef enum {
- SERD_HAS_NEWLINE = 1u << 0u, ///< Contains line breaks ('\\n' or '\\r')
- SERD_HAS_QUOTE = 1u << 1u, ///< Contains quotes ('"')
- SERD_HAS_DATATYPE = 1u << 2u, ///< Literal node has datatype
- SERD_HAS_LANGUAGE = 1u << 3u ///< Literal node has language
+ SERD_IS_LONG_LITERAL = 1u << 1u, ///< Literal node uses triple quotes
+ SERD_HAS_DATATYPE = 1u << 2u, ///< Literal node has datatype
+ SERD_HAS_LANGUAGE = 1u << 3u, ///< Literal node has language
} SerdNodeFlag;
/// Bitwise OR of SerdNodeFlag values
@@ -387,17 +386,6 @@ const char* SERD_NONNULL
serd_strerror(SerdStatus status);
/**
- Measure a UTF-8 string.
-
- @return Length of `str` in bytes.
- @param str A null-terminated UTF-8 string.
- @param flags (Output) Set to the applicable flags.
-*/
-SERD_API
-size_t
-serd_strlen(const char* SERD_NONNULL str, SerdNodeFlags* SERD_NULLABLE flags);
-
-/**
Decode a base64 string.
This function can be used to deserialise a blob node created with
@@ -790,10 +778,14 @@ serd_node_to_syntax(const SerdNode* SERD_NONNULL node, SerdSyntax syntax);
/**
Create a new "simple" node that is just a string.
- This can be used to create blank, CURIE, or URI nodes from an already
- measured string or slice of a buffer, which avoids a strlen compared to the
- friendly constructors. This may not be used for literals since those must
- be measured to set the SERD_HAS_NEWLINE and SERD_HAS_QUOTE flags.
+ This can be used to create nodes from an already measured string or slice of
+ a buffer, which avoids measuring the string compared to the friendlier
+ constructors. If `type` is #SERD_LITERAL, then this creates a plain
+ literal with no language tag.
+
+ @param type The type of node to create.
+
+ @param string The string contents of the node.
*/
SERD_API
SerdNode* SERD_ALLOCATED