Browse Source

start to encapsulate the functions in a class, to avoid the prohibition of partial function specialization.

master
roker 2 months ago
parent
commit
f5b13062c3
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      src/nfc.hh

+ 14
- 0
src/nfc.hh View File

@ -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.
uint32_t parseUtf8(const char*& c, const char* end);


Loading…
Cancel
Save