00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef TALOS_FILE_STRING_HXX
00022
00023
00024
namespace Talos
00025 {
00026
00027
template<
typename T>
00028 string
to_str(
const T& input);
00029
00030
template<
typename T>
00031 std::string
to_str_fill(
const T& input,
int l=2)
00032 {
00033 std::ostringstream output;
00034 output.width(l);
00035 output.fill(
'0');
00036 output << input;
00037
return output.str();
00038 }
00039
00040 string fill(
const string& input,
int l = 2,
char c =
' ',
00041 ios_base& pos(ios_base&) = left)
00042 {
00043 std::ostringstream output;
00044 output.width(l);
00045 output.fill(c);
00046 output << pos << input;
00047
return output.str();
00048 }
00049
00050
template <
class T>
00051
void to_num(
const string& s, T& num);
00052
00053
template <
class T>
00054 T
to_num(
const string& s);
00055
00056
template <
class T>
00057
void convert(
const string& s, T& num);
00058
void convert(
const string& s, string& num);
00059
00060
template <
class T>
00061 T
convert(
const string& s);
00062
00063 string
lower_case(string str);
00064 string
upper_case(string str);
00065
00066
bool is_num(
const string& s);
00067
00068
bool is_integer(
const string& s);
00069
00070
bool is_unsigned_integer(
const string& s);
00071
00072 string
find_replace(string str, string old_str, string new_str =
"");
00073
00074 string
trim(string str, string delimiters =
" \n\t");
00075
00076 string
trim_beg(string str, string delimiters =
" \n\t");
00077
00078 string
trim_end(string str, string delimiters =
" \n\t");
00079
00080
template <
class T>
00081
void split(string str, vector<T>& vect, string delimiters =
" \n\t");
00082 vector<string>
split(string str, string delimiters =
" \n\t");
00083
00084
template <
class T>
00085
void split_markup(string str, vector<T>& elements, vector<bool>& is_markup,
00086 string delimiters =
"$");
00087
00088
template <
class T>
00089
void print(
const vector<T>& v);
00090
00091 }
00092
00093
00094
#define TALOS_FILE_STRING_HXX
00095
#endif