--- smsdaemon/util.h 2008/06/10 20:25:15 38 +++ smsdaemon/Util.h 2008/12/17 23:43:26 193 @@ -4,12 +4,14 @@ #include #include -#include struct timeval; namespace Util { + //use whitespace + std::vector str_split(std::string input); + std::vector str_split(std::string input, std::string delimiter); void str_dump(const std::string& str); @@ -17,26 +19,45 @@ std::string str_striptags(std::string str); std::string str_trim(std::string str); + std::string str_toupper(std::string str); + std::string str_tolower(std::string str); + + std::string str_formatint(int i); + + std::string str_replace_char(std::string str, char search, char replace); std::string str_characters(std::string str); - std::string readUrl(std::string url, std::string tempfile); + std::string str_gsm2latin(std::string str); + std::string str_latin2gsm(std::string str); + +// Deprecated:: use HttpClient instead +// std::string readUrl(std::string url, std::string tempfile); + + std::string iconv_wrapper(std::string _input, std::string to_format, std::string from_format); std::string convertToUnicode(std::string); + std::string convertFromUnicode(std::string); int uTimeDiff(const timeval& then, const timeval& now); int mTimeDiff(const timeval& then, const timeval& now); - inline void Sleep(unsigned int msec) - { - for (unsigned int i=0; i