summaryrefslogtreecommitdiff
path: root/src/u.hh
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2025-10-20 22:01:05 +0200
committerJoel Klinghed <the_jk@spawned.biz>2025-10-21 23:15:29 +0200
commit4dddfd622977f84f0cf41847aec9e728d02bec65 (patch)
tree27bc4ceca8cd18bd3583107b2213368134b931f5 /src/u.hh
parente8dc8edad7cdf194091f0479b70b154e872f57ef (diff)
uri: New module
Decode URI encoded string, validating both hex and that encoded data is valid UTF-8.
Diffstat (limited to 'src/u.hh')
-rw-r--r--src/u.hh21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/u.hh b/src/u.hh
new file mode 100644
index 0000000..439d6dc
--- /dev/null
+++ b/src/u.hh
@@ -0,0 +1,21 @@
+#ifndef U_HH
+#define U_HH
+
+#include <cstdint>
+
+namespace u {
+
+enum class ReadError : uint8_t {
+ Invalid, // Invalid sequence
+ End, // At end (it == end)
+ Incomplete, // Too few bytes
+};
+
+enum class ReadErrorReplace : uint8_t {
+ End, // At end (it == end)
+ Incomplete, // Too few bytes
+};
+
+} // namespace u
+
+#endif // U_HH