aboutsummaryrefslogtreecommitdiff
path: root/src/utility.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/utility.h')
-rw-r--r--src/utility.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/utility.h b/src/utility.h
index e185e3e..8aa46a0 100644
--- a/src/utility.h
+++ b/src/utility.h
@@ -20,8 +20,16 @@ enum class CodePoint : std::uint8_t {
FOUR = (UINT8_MAX >> 5), // 00000111
};
-bool match(const std::uint8_t&, CodeUnitType&&);
-void write(char32_t&, const std::uint8_t&, CodePoint&&, const std::uint8_t&);
+inline bool match(std::uint8_t unit, CodeUnitType type) {
+ return unit & static_cast<std::uint8_t>(type);
+}
+
+inline void write(char32_t& point,
+ std::uint8_t unit,
+ CodePoint mask,
+ std::uint8_t offset) {
+ point += (unit & static_cast<std::uint8_t>(mask)) << offset;
+}
}
}