14 #ifndef COMMON_UTILS_H
15 #define COMMON_UTILS_H
39 #define ASSA_DIR_SEPARATOR '\\'
40 #define ASSA_DIR_SEPARATOR_S "\\"
41 #define ASSA_IS_DIR_SEPARATOR(c) ((c) == ASSA_DIR_SEPARATOR || (c) == '/')
42 #define ASSA_SEARCHPATH_SEPARATOR ';'
43 #define ASSA_SEARCHPATH_SEPARATOR_S ";"
47 #define ASSA_DIR_SEPARATOR '/'
48 #define ASSA_DIR_SEPARATOR_S "/"
49 #define ASSA_IS_DIR_SEPARATOR(c) ((c) == ASSA_DIR_SEPARATOR)
50 #define ASSA_SEARCHPATH_SEPARATOR ':'
51 #define ASSA_SEARCHPATH_SEPARATOR_S ":"
66 void split (
const char* text_, std::vector<std::string>& vec_);
78 int split_pair (
const string& text_,
char sep_,
string& lhs_,
string& rhs_);
88 int ltrim (std::string& text_,
const std::string& delim_);
99 int rtrim (std::string& text_,
const std::string& delim_);
127 std::string
strenv (
const char* in_);
145 SleepEx (secs_to_sleep_ * 1000, FALSE);
147 ::sleep (secs_to_sleep_);
int split_pair(const string &text_, char sep_, string &lhs_, string &rhs_)
Split input string into two parts separated by the separator character.
void sleep_for_seconds(long secs_to_sleep_)
Portable sleep.
void find_and_replace_char(std::string &text_, char src_, char dest_)
Find and relpace all instances of src_ character with dest_ character in a string text_.
void trim_sides(std::string &text_)
Trim white spaces and tabs from the beginning and the end of the text string.
void split(const char *text_, std::vector< std::string > &vec_)
Split character string into tokens separated by the whitespace character (blank, tab,...
std::string strenv(const char *in_)
Expand the passed string in_ by substituting environment variable names for their values.
std::string get_cwd_name()
Get current working directory.
int ltrim(std::string &text_, const std::string &delim_)
Trim string from the beginning to the left of the delimiter.
int rtrim(std::string &text_, const std::string &delim_)
Trim string from the delimiter to the end of the string.