--- smsdaemon/util.cpp 2008/06/10 22:22:19 42 +++ smsdaemon/util.cpp 2008/06/14 08:39:40 78 @@ -7,7 +7,7 @@ #include #include #include - +#include #include #include "util.h" @@ -53,13 +53,16 @@ return str; } - + bool my_isspace(char ch) + { + return (isspace(ch) || ch == 0); + } string str_trim(string str) { - while (str.length() > 0 && isspace(str.at(0))) + while (str.length() > 0 && my_isspace(str.at(0))) str.erase(0,1); - while (str.length() > 0 && isspace(str.at(str.length()-1))) + while (str.length() > 0 && my_isspace(str.at(str.length()-1))) str.erase(str.length()-1,1); return str; } @@ -101,6 +104,34 @@ return retval; } + + string str_toupper(string str) + { + for (unsigned i=0; i