Changeset 5620 for icGREP/icgrepdevel/icgrep/cc/alphabet.cpp
 Timestamp:
 Aug 28, 2017, 4:00:17 PM (20 months ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

icGREP/icgrepdevel/icgrep/cc/alphabet.cpp
r5279 r5620 12 12 // of the nth character is just the given value n, if it is in range. 13 13 14 UCD::codepoint_t Alphabet::toUnicode( unsigned n){14 UCD::codepoint_t Alphabet::toUnicode(const unsigned n) const { 15 15 UCD::codepoint_t cp = n; 16 16 if (mCharSet.contains(cp)) return cp; … … 21 21 // of a Unicode codepoint is just the given codepoint, if it is in range. 22 22 23 unsigned Alphabet::fromUnicode( UCD::codepoint_t codepoint){23 unsigned Alphabet::fromUnicode(const UCD::codepoint_t codepoint) const { 24 24 if (mCharSet.contains(codepoint)) return codepoint; 25 25 throw std::runtime_error("fromUnicode: codepoint not found in alphabet."); … … 36 36 } 37 37 38 template <class uint_t> UCD::codepoint_t ExtendedASCII<uint_t>::toUnicode( unsigned n){38 template <class uint_t> UCD::codepoint_t ExtendedASCII<uint_t>::toUnicode(const unsigned n) const { 39 39 // The first 128 characters are just ASCII. 40 40 if (n < 128) return n; … … 43 43 } 44 44 45 template <class uint_t> unsigned ExtendedASCII<uint_t>::fromUnicode( UCD::codepoint_t codepoint){45 template <class uint_t> unsigned ExtendedASCII<uint_t>::fromUnicode(const UCD::codepoint_t codepoint) const { 46 46 if (codepoint < 128) return codepoint; 47 47 for (unsigned i = 0; i < 128; i++) {
Note: See TracChangeset
for help on using the changeset viewer.