Changeset 26 for trunk/src/charsets


Ignore:
Timestamp:
Jan 25, 2008, 4:29:05 AM (11 years ago)
Author:
cameron
Message:

Caseless string functions; encoding names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/charsets/ASCII_EBCDIC.h

    r22 r26  
    209209template<> struct Ord<EBCDIC,'}'> {static uint8_t const value = 0xd0;};
    210210
    211 // CaseFoldBit is the bit that differs between upper and lower
    212 // case versions of the same letter.  Both ASCII and EBCDIC have
    213 // the property that a single case fold bit exists and is the same
    214 // for all letters. 
    215 template <CodeUnit_Base C>
    216 struct CaseFoldBit
    217   {static uint8_t const value = Ord<C, 'a'>::value ^ Ord<C, 'A'>::value;};
     211template <unsigned char _> struct UC2lc {static unsigned char const value = _;};
     212template <> struct UC2lc<'A'> {static unsigned char const value = 'a';};
     213template <> struct UC2lc<'B'> {static unsigned char const value = 'b';};
     214template <> struct UC2lc<'C'> {static unsigned char const value = 'c';};
     215template <> struct UC2lc<'D'> {static unsigned char const value = 'd';};
     216template <> struct UC2lc<'E'> {static unsigned char const value = 'e';};
     217template <> struct UC2lc<'F'> {static unsigned char const value = 'f';};
     218template <> struct UC2lc<'G'> {static unsigned char const value = 'g';};
     219template <> struct UC2lc<'H'> {static unsigned char const value = 'h';};
     220template <> struct UC2lc<'I'> {static unsigned char const value = 'i';};
     221template <> struct UC2lc<'J'> {static unsigned char const value = 'j';};
     222template <> struct UC2lc<'K'> {static unsigned char const value = 'k';};
     223template <> struct UC2lc<'L'> {static unsigned char const value = 'l';};
     224template <> struct UC2lc<'M'> {static unsigned char const value = 'm';};
     225template <> struct UC2lc<'N'> {static unsigned char const value = 'n';};
     226template <> struct UC2lc<'O'> {static unsigned char const value = 'o';};
     227template <> struct UC2lc<'P'> {static unsigned char const value = 'p';};
     228template <> struct UC2lc<'Q'> {static unsigned char const value = 'q';};
     229template <> struct UC2lc<'R'> {static unsigned char const value = 'r';};
     230template <> struct UC2lc<'S'> {static unsigned char const value = 's';};
     231template <> struct UC2lc<'T'> {static unsigned char const value = 't';};
     232template <> struct UC2lc<'U'> {static unsigned char const value = 'u';};
     233template <> struct UC2lc<'V'> {static unsigned char const value = 'v';};
     234template <> struct UC2lc<'W'> {static unsigned char const value = 'w';};
     235template <> struct UC2lc<'X'> {static unsigned char const value = 'x';};
     236template <> struct UC2lc<'Y'> {static unsigned char const value = 'y';};
     237template <> struct UC2lc<'Z'> {static unsigned char const value = 'z';};
     238
     239template <unsigned char _> struct lc2UC {static unsigned char const value = _;};
     240template <> struct lc2UC<'a'> {static unsigned char const value = 'A';};
     241template <> struct lc2UC<'b'> {static unsigned char const value = 'B';};
     242template <> struct lc2UC<'c'> {static unsigned char const value = 'C';};
     243template <> struct lc2UC<'d'> {static unsigned char const value = 'D';};
     244template <> struct lc2UC<'e'> {static unsigned char const value = 'E';};
     245template <> struct lc2UC<'f'> {static unsigned char const value = 'F';};
     246template <> struct lc2UC<'g'> {static unsigned char const value = 'G';};
     247template <> struct lc2UC<'h'> {static unsigned char const value = 'H';};
     248template <> struct lc2UC<'i'> {static unsigned char const value = 'I';};
     249template <> struct lc2UC<'j'> {static unsigned char const value = 'J';};
     250template <> struct lc2UC<'k'> {static unsigned char const value = 'K';};
     251template <> struct lc2UC<'l'> {static unsigned char const value = 'L';};
     252template <> struct lc2UC<'m'> {static unsigned char const value = 'M';};
     253template <> struct lc2UC<'n'> {static unsigned char const value = 'N';};
     254template <> struct lc2UC<'o'> {static unsigned char const value = 'O';};
     255template <> struct lc2UC<'p'> {static unsigned char const value = 'P';};
     256template <> struct lc2UC<'q'> {static unsigned char const value = 'Q';};
     257template <> struct lc2UC<'r'> {static unsigned char const value = 'R';};
     258template <> struct lc2UC<'s'> {static unsigned char const value = 'S';};
     259template <> struct lc2UC<'t'> {static unsigned char const value = 'T';};
     260template <> struct lc2UC<'u'> {static unsigned char const value = 'U';};
     261template <> struct lc2UC<'v'> {static unsigned char const value = 'V';};
     262template <> struct lc2UC<'w'> {static unsigned char const value = 'W';};
     263template <> struct lc2UC<'x'> {static unsigned char const value = 'X';};
     264template <> struct lc2UC<'y'> {static unsigned char const value = 'Y';};
     265template <> struct lc2UC<'z'> {static unsigned char const value = 'Z';};
    218266
    219267#endif
Note: See TracChangeset for help on using the changeset viewer.