2 #ifndef __ST_HYPERUTILGENERIC_H
3 #define __ST_HYPERUTILGENERIC_H
11 namespace StHyperUtilGeneric
14 std::string toHex(
const std::vector<char>&
data);
15 std::string toHex(
const char* data_,
size_t dataLength);
17 std::string base64_encode(
const char* bytes_to_encode,
size_t in_len);
18 std::string base64_decode(std::string
const& str);
21 std::string toString(T& arg)
23 std::ostringstream os;
29 T fromString(
const std::string& s)
31 std::istringstream stream (s);
39 std::string implode(
const std::vector<T>& v,
const std::string& delim) {
41 std::copy(v.begin(), --v.end(), std::ostream_iterator<T>(o, delim.c_str()));
47 std::string implode_map(
const std::map<std::string, std::string>& arr,
const std::string& key,
const std::string& delimeter);
50 std::string implode_vector(
const std::vector<std::string>& arr,
const std::string& delimeter);
52 std::vector<std::string> explode(
const std::string& str,
const char& delim);
54 void ltrim(std::string& str,
const std::string& chr =
" \n\r\t");
55 void rtrim(std::string& str,
const std::string& chr =
" \n\r\t");
56 void trim(std::string& str,
const std::string& chr =
" \n\r\t");
58 void strtoupper(std::string& str);
59 void strtolower(std::string& str);
61 bool recursiveMkdir(
const std::string& path);
65 #endif // __ST_HYPERUTILGENERIC_H