diff options
author | David Robillard <d@drobilla.net> | 2023-08-30 20:43:05 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (patch) | |
tree | d7be35c7b4b3d466049352f2975e2c88c298f4b8 /include/serd/node.h | |
parent | b13ad41a4d65b577b4db67660a9edf3056bdf7af (diff) | |
download | serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.gz serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.tar.bz2 serd-258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d.zip |
Use ZixStringView directly
Diffstat (limited to 'include/serd/node.h')
-rw-r--r-- | include/serd/node.h | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/include/serd/node.h b/include/serd/node.h index 8dbdbde4..31caad88 100644 --- a/include/serd/node.h +++ b/include/serd/node.h @@ -6,11 +6,11 @@ #include "serd/attributes.h" #include "serd/memory.h" -#include "serd/string_view.h" #include "serd/uri.h" #include "serd/value.h" #include "serd/write_result.h" #include "zix/attributes.h" +#include "zix/string_view.h" #include <stdbool.h> #include <stddef.h> @@ -140,8 +140,8 @@ typedef enum { /// The data for #SERD_NODE_ARGS_TOKEN typedef struct { - SerdNodeType type; - SerdStringView string; + SerdNodeType type; + ZixStringView string; } SerdNodeTokenArgs; /// The data for #SERD_NODE_ARGS_PARSED_URI @@ -151,15 +151,15 @@ typedef struct { /// The data for #SERD_NODE_ARGS_FILE_URI typedef struct { - SerdStringView path; - SerdStringView hostname; + ZixStringView path; + ZixStringView hostname; } SerdNodeFileURIArgs; /// The data for #SERD_NODE_ARGS_LITERAL typedef struct { - SerdStringView string; - SerdNodeFlags flags; - SerdStringView meta; + ZixStringView string; + SerdNodeFlags flags; + ZixStringView meta; } SerdNodeLiteralArgs; /// The data for #SERD_NODE_ARGS_PRIMITIVE @@ -215,7 +215,7 @@ typedef struct { #SERD_IS_LONG flag. */ SERD_CONST_API SerdNodeArgs -serd_a_token(SerdNodeType type, SerdStringView string); +serd_a_token(SerdNodeType type, ZixStringView string); /// A URI node from a parsed URI SERD_CONST_API SerdNodeArgs @@ -223,7 +223,7 @@ serd_a_parsed_uri(SerdURIView uri); /// A file URI node from a path and optional hostname SERD_CONST_API SerdNodeArgs -serd_a_file_uri(SerdStringView path, SerdStringView hostname); +serd_a_file_uri(ZixStringView path, ZixStringView hostname); /** A literal node with an optional datatype or language. @@ -244,11 +244,11 @@ serd_a_file_uri(SerdStringView path, SerdStringView hostname); Otherwise, it is ignored. */ SERD_CONST_API SerdNodeArgs -serd_a_literal(SerdStringView string, SerdNodeFlags flags, SerdStringView meta); +serd_a_literal(ZixStringView string, SerdNodeFlags flags, ZixStringView meta); /// A simple string literal node from a string view ZIX_CONST_FUNC static inline SerdNodeArgs -serd_a_string_view(SerdStringView string) +serd_a_string_view(ZixStringView string) { return serd_a_token(SERD_LITERAL, string); } @@ -257,12 +257,12 @@ serd_a_string_view(SerdStringView string) ZIX_CONST_FUNC static inline SerdNodeArgs serd_a_string(const char* ZIX_NONNULL string) { - return serd_a_string_view(serd_string(string)); + return serd_a_string_view(zix_string(string)); } /// A blank node from a string view ZIX_CONST_FUNC static inline SerdNodeArgs -serd_a_blank(SerdStringView name) +serd_a_blank(ZixStringView name) { return serd_a_token(SERD_BLANK, name); } @@ -271,12 +271,12 @@ serd_a_blank(SerdStringView name) ZIX_CONST_FUNC static inline SerdNodeArgs serd_a_blank_string(const char* ZIX_NONNULL name) { - return serd_a_blank(serd_string(name)); + return serd_a_blank(zix_string(name)); } /// A URI node from a string view ZIX_CONST_FUNC static inline SerdNodeArgs -serd_a_uri(SerdStringView uri) +serd_a_uri(ZixStringView uri) { return serd_a_token(SERD_URI, uri); } @@ -289,7 +289,7 @@ serd_a_uri(SerdStringView uri) ZIX_CONST_FUNC static inline SerdNodeArgs serd_a_uri_string(const char* ZIX_NONNULL uri) { - return serd_a_uri(serd_string(uri)); + return serd_a_uri(zix_string(uri)); } /** @@ -299,7 +299,7 @@ serd_a_uri_string(const char* ZIX_NONNULL uri) @param datatype The absolute URI of the datatype. */ ZIX_CONST_FUNC static inline SerdNodeArgs -serd_a_typed_literal(const SerdStringView string, const SerdStringView datatype) +serd_a_typed_literal(const ZixStringView string, const ZixStringView datatype) { return serd_a_literal(string, SERD_HAS_DATATYPE, datatype); } @@ -311,7 +311,7 @@ serd_a_typed_literal(const SerdStringView string, const SerdStringView datatype) @param language A language tag like "en-ca". */ ZIX_CONST_FUNC static inline SerdNodeArgs -serd_a_plain_literal(const SerdStringView string, const SerdStringView language) +serd_a_plain_literal(const ZixStringView string, const ZixStringView language) { return serd_a_literal(string, SERD_HAS_LANGUAGE, language); } @@ -475,7 +475,7 @@ serd_node_string(const SerdNode* ZIX_NONNULL node); This is a convenience wrapper for serd_node_string() and serd_node_length() that can be used to get both in a single call. */ -SERD_PURE_API SerdStringView +SERD_PURE_API ZixStringView serd_node_string_view(const SerdNode* ZIX_NONNULL node); /** |