4 |
|
|
5 |
#include <string> |
#include <string> |
6 |
#include <vector> |
#include <vector> |
|
#include <cctype> |
|
7 |
|
|
8 |
struct timeval; |
struct timeval; |
9 |
|
|
11 |
{ |
{ |
12 |
std::vector<std::string> str_split(std::string input, std::string delimiter); |
std::vector<std::string> str_split(std::string input, std::string delimiter); |
13 |
void str_dump(const std::string& str); |
void str_dump(const std::string& str); |
14 |
void str_clean(std::string* str, std::string search, std::string replace = ""); |
|
15 |
|
std::string str_replace(std::string str, std::string search, std::string replace = ""); |
16 |
|
std::string str_striptags(std::string str); |
17 |
|
std::string str_trim(std::string str); |
18 |
|
|
19 |
|
std::string str_toupper(std::string str); |
20 |
|
std::string str_tolower(std::string str); |
21 |
|
|
22 |
|
std::string str_formatint(int i); |
23 |
|
|
24 |
|
std::string str_replace_char(std::string str, char search, char replace); |
25 |
|
std::string str_characters(std::string str); |
26 |
|
|
27 |
|
std::string str_gsm2latin(std::string str); |
28 |
|
std::string str_latin2gsm(std::string str); |
29 |
|
|
30 |
std::string readUrl(std::string url, std::string tempfile); |
std::string readUrl(std::string url, std::string tempfile); |
31 |
|
|
32 |
|
std::string iconv_wrapper(std::string _input, std::string to_format, std::string from_format); |
33 |
|
|
34 |
std::string convertToUnicode(std::string); |
std::string convertToUnicode(std::string); |
35 |
|
std::string convertFromUnicode(std::string); |
36 |
|
|
37 |
int uTimeDiff(const timeval& then, const timeval& now); |
int uTimeDiff(const timeval& then, const timeval& now); |
38 |
int mTimeDiff(const timeval& then, const timeval& now); |
int mTimeDiff(const timeval& then, const timeval& now); |
39 |
|
|
40 |
inline void Sleep(unsigned int msec) |
timeval GetTimeOfDay(); |
|
{ |
|
|
for (unsigned int i=0; i<msec; ++i) |
|
|
usleep(1000); |
|
|
} |
|
41 |
|
|
42 |
inline std::string str_tolower(std::string str) |
int my_system(const char* cmd, std::string* response = 0); |
43 |
|
|
44 |
|
std::string readfile(std::string filename); |
45 |
|
|
46 |
|
inline void Sleep(unsigned int msec) |
47 |
{ |
{ |
48 |
for(unsigned int i=0; i<str.size();++i) |
if (msec < 1000) |
49 |
str[i] = tolower(str[i]); |
{ |
50 |
return str; |
usleep(1000*msec); |
51 |
|
} |
52 |
|
else |
53 |
|
{ |
54 |
|
for (unsigned int i=0; i<msec; ++i) |
55 |
|
usleep(1000); |
56 |
|
} |
57 |
} |
} |
58 |
|
|
59 |
} |
} |