Proton
1.1.1
Make porting easy from Python to C++11
|
like string in python. More...
Namespaces | |
namespace | proton::detail |
The implementation namespace of proton. |
Classes | |
class | proton::basic_string_< CharT, Traits, Allocator > |
main string template More... |
Typedefs | |
typedef basic_string_< char > | proton::str |
the main string type in proton. | |
typedef basic_string_< wchar_t > | proton::wstr |
the main wstring type in proton. |
Functions | |
template<typename string_list , typename string > | |
void | proton::split (string_list &r, const string &s, string spc="", int null_unite=-1) |
split a string. | |
template<typename string_list > | |
string_list::value_type | proton::join (const char *token, const string_list &r) |
join a list of strings to one string. | |
template<typename string , typename T > | |
string | proton::to_ (T &&n, int base=10) |
convert a number/object to a string. | |
template<typename int_t , typename string > | |
bool | proton::get_int (int_t &r, const string &s, int base=10) |
get integer (including int/long/unsigned and so on) from string. | |
template<typename T , typename C , typename A > | |
basic_string_< T, C, A > | proton::operator+ (const T *s, basic_string_< T, C, A > &t) |
const CharT* + str | |
template<typename C , typename V > | |
basic_string_< C, std::char_traits< C > , smart_allocator< C > > | proton::operator% (const C *f, const V &a) |
const CharT* % V | |
template<typename T , typename C , typename A > | |
basic_string_< T, C, A > | proton::operator* (const basic_string_< T, C, A > &s, size_t n) |
string * n | |
template<typename T , typename C , typename A > | |
basic_string_< T, C, A > | proton::operator* (size_t n, const basic_string_< T, C, A > &s) |
n * string | |
template<typename T , typename C , typename A > | |
basic_string_< T, C, A > & | proton::cast_ (std::basic_string< T, C, A > &x) |
cast to proton::basic_string_<>& from std::basic_string<>&. |
like string in python.
bool proton::get_int | ( | int_t & | r, |
const string & | s, | ||
int | base = 10 |
||
) |
get integer (including int/long/unsigned and so on) from string.
r | the output value |
s | the input string |
base | 10:dec, 16:hex |
Definition at line 178 of file string.hpp.
string_list::value_type proton::join | ( | const char * | token, |
const string_list & | r | ||
) |
join a list of strings to one string.
token | the delimiter |
r | the input string list |
Definition at line 102 of file string.hpp.
void proton::split | ( | string_list & | r, |
const string & | s, | ||
string | spc = "" , |
||
int | null_unite = -1 |
||
) |
split a string.
r | the output string list, supporting clear() and push_back() |
s | the input string |
spc | the delimiters |
null_unite | -1: a.c.t. python depent on token, 0: false, 1: true |
Definition at line 44 of file string.hpp.
string proton::to_ | ( | T && | n, |
int | base = 10 |
||
) |
convert a number/object to a string.
n | the input value |
base | 10:dec, 16:hex |
Definition at line 164 of file string.hpp.