A helper class to manipulate string (token, convert, ...) More...
Static Public Member Functions | |
template<typename T > | |
static T | value_of (const std::string &in, bool *is_ok=0) |
return the value of the given string More... | |
template<typename T > | |
static std::vector< T > | value_of (const std::vector< std::string > &in, bool *is_ok=0) |
return the value of the given vector of string More... | |
template<typename T > | |
static std::string | to_string (const T &t) |
get the string corresponding to the given value More... | |
static std::string | zero_padding (const std::string &input, const int &zero_number=4) |
fill the appropriate number of zero to have the same size More... | |
template<typename T > | |
static std::string | to_string_padded (const T &x, const unsigned int &zero_number=4) |
helper to write padded string from a number easily More... | |
static std::string | to_lower (const std::string &input) |
return the lower case of a string More... | |
static std::string | to_upper (const std::string &input) |
return the upper case of a string More... | |
static std::vector< std::string > | delete_empty (const std::vector< std::string > &in) |
delete the empty space of a vector of string More... | |
static std::pair< std::pair < int, int >, std::pair < std::string, std::string > > | extract_number_part (const std::string &filename) |
extract the last number part of a string and give the number of zeros More... | |
static std::vector< std::string > | load_filename_sequence (const std::string filename, const unsigned int &iteration=1) |
load file sequence More... | |
A helper class to manipulate string (token, convert, ...)
A class to convert a string into value or value into string
|
static |
delete the empty space of a vector of string
|
static |
extract the last number part of a string and give the number of zeros
int | number found (-1 if failed) |
int | number of zeros (-1 if failed) |
string | first part of the word |
string | last part of the word |
ex. my_file_001.dat -> number=1, zeros=2, part_1="my_file_" part_2=".dat"
Referenced by load_filename_sequence().
|
static |
load file sequence
Try to load every filename following the numbers on disk
References extract_number_part(), to_string(), and zero_padding().
|
static |
return the lower case of a string
|
inlinestatic |
get the string corresponding to the given value
example: std::string val=mesh_conv::string_converter::to_string(4.0*78.5);
Referenced by cpe::quad_index::assert_size(), cpe::surface_param::assert_size(), cpe::grid::assert_size(), load_filename_sequence(), and to_string_padded().
|
inlinestatic |
helper to write padded string from a number easily
References to_string(), and zero_padding().
|
static |
return the upper case of a string
|
inlinestatic |
return the value of the given string
example: double val=mesh_conv::string_converter::value_of<double> ("4.54");
|
inlinestatic |
return the value of the given vector of string
|
static |
fill the appropriate number of zero to have the same size
exemple zero_padding("62",5)="00062"
exemple zero_padding("c;7",4)="0x;7"
Referenced by load_filename_sequence(), and to_string_padded().