27#include "common/defs.h"
28#include "common/lang/vector.h"
29#include "common/lang/iostream.h"
30#include "common/lang/sstream.h"
31#include "common/lang/set.h"
43void strip(
string &str);
44char *strip(
char *str);
52string size_to_pad_str(
int size,
int pad);
59string &str_to_upper(
string &s);
66string &str_to_lower(
string &s);
74void split_string(
const string &str,
string delim, set<string> &results);
75void split_string(
const string &str,
string delim, vector<string> &results);
76void split_string(
char *str,
char dim, vector<char *> &results,
bool keep_null =
false);
78void merge_string(
string &str,
string delim, vector<string> &result,
size_t result_len = 0);
82void replace(
string &str,
const string &old,
const string &new_str);
87char *bin_to_hex(
const char *s,
const int len,
char *hex_buff);
91char *hex_to_bin(
const char *s,
char *bin_buff,
int *dest_len);
106bool str_to_val(
const string &str, T &val, ios_base &(*radix)(ios_base &) = std::dec);
119void val_to_str(
const T &val,
string &str, ios_base &(*radix)(ios_base &) = std::dec);
126string double_to_str(
double v);
128bool is_blank(
const char *s);
139char *substr(
const char *s,
int n1,
int n2);
145string get_type_name(
const T &val);
148bool str_to_val(
const string &str, T &val, ios_base &(*radix)(ios_base &))
151 istringstream is(str);
152 if (!(is >> radix >> val)) {
160void val_to_str(
const T &val,
string &str, ios_base &(*radix)(ios_base &))
163 strm << radix << val;
168string get_type_name(
const T &val)
171 char *stmp = abi::__cxa_demangle(
typeid(val).name(), 0, 0, &status);