diff --git a/src/nfc.hh b/src/nfc.hh index a7d4154..d485e37 100644 --- a/src/nfc.hh +++ b/src/nfc.hh @@ -31,6 +31,20 @@ protected: }; +/// Common class template to define the same functions for all 3 Unicode Transfer Formats. +template +class UTF +{ +public: + /// parses a sequence of input code units into one Unicode code point and updates the input iterator c. + /// \todo change to iterator templates? + uint32_t parse(const CharT*& c, const CharT* end); + + /// generates a UTF sequence from a given Unicode code point + template + void generate(const char32_t c, OutIter& out); +}; + // scans the char sequences and parses UTF-8 sequences. Detect UTF-8 errors and throws exceptions. uint32_t parseUtf8(const char*& c, const char* end);