|
@ -31,6 +31,20 @@ protected: |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// Common class template to define the same functions for all 3 Unicode Transfer Formats.
|
|
|
|
|
|
template<class CharT> |
|
|
|
|
|
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<class OutIter> |
|
|
|
|
|
void generate(const char32_t c, OutIter& out); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
// scans the char sequences and parses UTF-8 sequences. Detect UTF-8 errors and throws exceptions.
|
|
|
// 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); |
|
|
uint32_t parseUtf8(const char*& c, const char* end); |
|
|
|
|
|
|
|
|