00001
00002 #ifndef _CI_CHAR_TRAITS_H
00003 #define _CI_CHAR_TRAITS_H 1
00004
00005 #include <string>
00006 #include <ctype.h>
00007
00008 namespace bioinfo
00009 {
00010
00019 struct ci_char_traits : public std::char_traits<char>
00020
00021
00022 {
00028 static bool eq( char c1, char c2 ) {
00029 return tolower(c1) == tolower(c2);
00030 }
00031
00037 static bool ne( char c1, char c2 ) {
00038 return tolower(c1) != tolower(c2);
00039 }
00040
00046 static bool lt( char c1, char c2 ) {
00047 return tolower(c1) < tolower(c2);
00048 }
00049
00050 static int compare( const char* s1,
00051 const char* s2,
00052 size_t n ) {
00053 return 0;
00054
00055
00056
00057 }
00058
00059 static const char*
00060 find( const char* s, int n, char a ) {
00061 while( n-- > 0 && tolower(*s) != tolower(a) ) {
00062 ++s;
00063 }
00064 return s;
00065 }
00066 };
00067
00068 };
00069
00070 #endif // _CI_CHAR_TRAITS_H