From 32e14551a90e85000e41b3f0445d34d58a1431e4 Mon Sep 17 00:00:00 2001 From: Joel Klinghed Date: Wed, 10 Sep 2025 22:12:22 +0200 Subject: Add unicode general category lookup Generate the lookup tables from UnicodeData.txt, do to that, add gen_ugc, which uses csv, buffers, line, io and other modules to do the job. --- src/u.hh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/u.hh') diff --git a/src/u.hh b/src/u.hh index 101dec8..7cf835b 100644 --- a/src/u.hh +++ b/src/u.hh @@ -1,6 +1,8 @@ #ifndef U_HH #define U_HH +#include "ugc.hh" // IWYU pragma: export + namespace u { enum class ReadError : uint8_t { @@ -14,6 +16,22 @@ enum class ReadErrorReplace : uint8_t { Incomplete, // Too few bytes }; +enum class Version : uint8_t { + u6_2_0, + u8_0_0, + u10_0_0, + u11_0_0, + u12_1_0, + u13_0_0, + u14_0_0, + u15_0_0, + u15_1_0, + u16_0_0, + LATEST = u16_0_0, +}; + +GeneralCategory lookup_gc(uint32_t code, Version version = Version::LATEST); + } // namespace u #endif // U_HH -- cgit v1.3