9 |
|
|
10 |
namespace Util |
namespace Util |
11 |
{ |
{ |
12 |
|
//use whitespace |
13 |
|
std::vector<std::string> str_split(std::string input); |
14 |
|
|
15 |
std::vector<std::string> str_split(std::string input, std::string delimiter); |
std::vector<std::string> str_split(std::string input, std::string delimiter); |
16 |
void str_dump(const std::string& str); |
void str_dump(const std::string& str); |
17 |
|
|
30 |
std::string str_gsm2latin(std::string str); |
std::string str_gsm2latin(std::string str); |
31 |
std::string str_latin2gsm(std::string str); |
std::string str_latin2gsm(std::string str); |
32 |
|
|
33 |
std::string readUrl(std::string url, std::string tempfile); |
// Deprecated:: use HttpClient instead |
34 |
|
// std::string readUrl(std::string url, std::string tempfile); |
35 |
|
|
36 |
|
std::string iconv_wrapper(std::string _input, std::string to_format, std::string from_format); |
37 |
|
|
38 |
std::string convertToUnicode(std::string); |
std::string convertToUnicode(std::string); |
39 |
std::string convertFromUnicode(std::string); |
std::string convertFromUnicode(std::string); |
43 |
|
|
44 |
timeval GetTimeOfDay(); |
timeval GetTimeOfDay(); |
45 |
|
|
46 |
int my_system(const char* cmd); |
int my_system(const char* cmd, std::string* response = 0); |
47 |
|
int my_system2(const char* cmd); |
48 |
|
|
49 |
|
std::string readfile(std::string filename); |
50 |
|
|
51 |
inline void Sleep(unsigned int msec) |
inline void Sleep(unsigned int msec) |
52 |
{ |
{ |
53 |
for (unsigned int i=0; i<msec; ++i) |
if (msec < 1000) |
54 |
usleep(1000); |
{ |
55 |
|
usleep(1000*msec); |
56 |
|
} |
57 |
|
else |
58 |
|
{ |
59 |
|
for (unsigned int i=0; i<msec; ++i) |
60 |
|
usleep(1000); |
61 |
|
} |
62 |
} |
} |
63 |
|
|
64 |
} |
} |