Functions | |
void | lowerCh (char &c) |
void | upperCh (char &c) |
void | transformToLower (std::string &str) |
void | transformToUpper (std::string &str) |
std::string | toLower (const std::string &str) |
std::string | toUpper (const std::string &str) |
int | compare_nocase (const std::string &s, const std::string &s2) |
int | compare_nocase (const std::string &s, const char *s2) |
int | find_nocase (const std::string &s, const std::string &s2) |
int | find_nocase (const std::string &s, const char *s2) |
unsigned int | rwHash (const std::string &str) |
int | compare_nocase (const std::string &s, const std::string &s2) |
int | find_nocase (const std::string &s, const std::string &s2) |
std::string | toLower (const std::string &str) |
std::string | toUpper (const std::string &str) |
unsigned int | rwHash (const std::string &str) |
void bes::String::lowerCh | ( | char & | c | ) | [inline] |
void bes::String::upperCh | ( | char & | c | ) | [inline] |
void bes::String::transformToLower | ( | std::string & | str | ) | [inline] |
void bes::String::transformToUpper | ( | std::string & | str | ) | [inline] |
std::string bes::String::toLower | ( | const std::string & | str | ) |
Definition at line 50 of file String.cxx.
References deljobs::string, and transformToLower().
00050 { 00051 std::string result(str); 00052 transformToLower(result); 00053 return result; 00054 }
std::string bes::String::toUpper | ( | const std::string & | str | ) |
Definition at line 57 of file String.cxx.
References deljobs::string, and transformToUpper().
00057 { 00058 std::string result(str); 00059 transformToUpper(result); 00060 return result; 00061 }
int bes::String::compare_nocase | ( | const std::string & | s, | |
const std::string & | s2 | |||
) |
Definition at line 27 of file String.cxx.
00027 { 00028 std::string::const_iterator p = s.begin(); 00029 std::string::const_iterator p2 = s2.begin(); 00030 00031 while (p != s.end() && p2 != s2.end() ) { 00032 if (toupper(*p) != toupper(*p2)) 00033 return (toupper(*p) < toupper(*p2)) ? -1 : 1; 00034 ++p; 00035 ++p2; 00036 } 00037 return (s2.size() == s.size()) ? 0 : (s.size() < s2.size()) ? -1 : 1; 00038 }
int bes::String::compare_nocase | ( | const std::string & | s, | |
const char * | s2 | |||
) | [inline] |
int bes::String::find_nocase | ( | const std::string & | s, | |
const std::string & | s2 | |||
) |
Definition at line 41 of file String.cxx.
References deljobs::string, and transformToUpper().
Referenced by find_nocase().
00041 { 00042 std::string str1 = s; 00043 transformToUpper(str1); 00044 std::string str2 = s2; 00045 transformToUpper(str2); 00046 return str1.find(str2); 00047 }
int bes::String::find_nocase | ( | const std::string & | s, | |
const char * | s2 | |||
) | [inline] |
Definition at line 63 of file String.h.
References find_nocase(), and deljobs::string.
00063 { 00064 return find_nocase(s,std::string(s2)); 00065 }
unsigned int bes::String::rwHash | ( | const std::string & | str | ) |
Definition at line 64 of file String.cxx.
References genRecEmupikp::i, and showlog::total.
00064 { 00065 const char* data = str.c_str(); 00066 int length = str.size(), total=0; 00067 for ( int i=0; i<length; i++ ) total += data[i]; 00068 return total; 00069 }
int bes::String::compare_nocase | ( | const std::string & | s, | |
const std::string & | s2 | |||
) |
Definition at line 27 of file String.cxx.
00027 { 00028 std::string::const_iterator p = s.begin(); 00029 std::string::const_iterator p2 = s2.begin(); 00030 00031 while (p != s.end() && p2 != s2.end() ) { 00032 if (toupper(*p) != toupper(*p2)) 00033 return (toupper(*p) < toupper(*p2)) ? -1 : 1; 00034 ++p; 00035 ++p2; 00036 } 00037 return (s2.size() == s.size()) ? 0 : (s.size() < s2.size()) ? -1 : 1; 00038 }
int bes::String::find_nocase | ( | const std::string & | s, | |
const std::string & | s2 | |||
) |
Definition at line 41 of file String.cxx.
References deljobs::string, and transformToUpper().
Referenced by find_nocase().
00041 { 00042 std::string str1 = s; 00043 transformToUpper(str1); 00044 std::string str2 = s2; 00045 transformToUpper(str2); 00046 return str1.find(str2); 00047 }
std::string bes::String::toLower | ( | const std::string & | str | ) |
Definition at line 50 of file String.cxx.
References deljobs::string, and transformToLower().
00050 { 00051 std::string result(str); 00052 transformToLower(result); 00053 return result; 00054 }
std::string bes::String::toUpper | ( | const std::string & | str | ) |
Definition at line 57 of file String.cxx.
References deljobs::string, and transformToUpper().
00057 { 00058 std::string result(str); 00059 transformToUpper(result); 00060 return result; 00061 }
unsigned int bes::String::rwHash | ( | const std::string & | str | ) |
Definition at line 64 of file String.cxx.
References genRecEmupikp::i, and showlog::total.
00064 { 00065 const char* data = str.c_str(); 00066 int length = str.size(), total=0; 00067 for ( int i=0; i<length; i++ ) total += data[i]; 00068 return total; 00069 }