20 #ifndef STRING_HELPER_H_
21 #define STRING_HELPER_H_
52 static T
value_of(
const std::string& in,
bool *is_ok=0)
55 std::istringstream is(in);
56 bool _is_ok=bool(is>>obj);
64 static std::vector <T>
value_of(
const std::vector <std::string>& in,
bool *is_ok=0)
71 std::vector <T> obj(N);
75 obj[k]=value_of<T> (in[k],&temp_is_ok);
76 if(is_ok!=0 && temp_is_ok==
false)
89 std::ostringstream oss;
91 return std::string(oss.str());
100 static std::string
zero_padding(
const std::string& input,
const int& zero_number=4);
103 template <
typename T>
108 static std::string
to_lower(
const std::string& input);
110 static std::string
to_upper(
const std::string& input);
113 static std::vector <std::string>
delete_empty(
const std::vector <std::string>& in);
124 static std::pair<std::pair<int,int>,std::pair<std::string,std::string> >
extract_number_part(
const std::string& filename);
130 static std::vector<std::string>
load_filename_sequence(
const std::string filename,
const unsigned int& iteration=1);
149 static std::vector <std::string>
tokenize(
const std::string& str,
const std::string& delimiters=
" ");
163 static file_helper copy(
const std::string& input_filename,
const std::string& output_filename);