diff options
Diffstat (limited to 'src/string_view.h')
-rw-r--r-- | src/string_view.h | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/string_view.h b/src/string_view.h deleted file mode 100644 index cb0f488..0000000 --- a/src/string_view.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef BDL_STRINGVIEW_H | ||
2 | #define BDL_STRINGVIEW_H | ||
3 | |||
4 | #include "common.h" | ||
5 | |||
6 | typedef struct StringView { | ||
7 | char *start; | ||
8 | size_t n; | ||
9 | } StringView; | ||
10 | |||
11 | // Consume a character in the stream. | ||
12 | char sv_next(StringView *sv); | ||
13 | |||
14 | // Rewind a character in the stream. | ||
15 | void sv_rewind(StringView *sv); | ||
16 | |||
17 | // Check what is the current character in the stream. | ||
18 | char sv_peek(const StringView *sv); | ||
19 | |||
20 | // Compare if the arguments are the same. | ||
21 | bool sv_equal(const StringView *a, const StringView *b); | ||
22 | |||
23 | // Write a character to the given output stream. | ||
24 | void sv_write(const StringView *sv); | ||
25 | |||
26 | #define STRING(STR) (StringView){(STR), sizeof(STR) - 1} | ||
27 | |||
28 | #endif // BDL_STRINGVIEW_H | ||