Proton
1.1.1
Make porting easy from Python to C++11
|
main string template More...
#include <proton/string.hpp>
Inherits std::basic_string< Char >.
Public Member Functions | |
template<typename... argT> | |
basic_string_ (argT &&...a) | |
forwarding ctor. | |
basic_string_ (std::initializer_list< CharT > a) | |
initializer_list forwarding ctor. | |
basic_string_ (const basic_string_ &x) | |
copy ctor. | |
basic_string_ (basic_string_ &&x) noexcept | |
move ctor. | |
basic_string_ & | operator= (const basic_string_ &x) |
assign. | |
template<typename argT > | |
basic_string_ & | operator+= (argT &&a) |
+= | |
template<typename argT > | |
basic_string_ | operator+ (argT &&a) |
string + string | |
template<typename V > | |
basic_string_ | operator% (const V &a) |
string % V | |
operator baseT & () | |
cast to std::basic_string<>&. | |
template<typename A1 > | |
operator std::basic_string< CharT, Traits, A1 > () const | |
cast to std::basic_string<>&. | |
CharT & | operator[] (offset_t i) |
[i] in python | |
const CharT & | operator[] (offset_t i) const |
[i] in python | |
basic_string_ | operator() (offset_t i) const |
slice of [i:] | |
basic_string_ | operator() (offset_t i, offset_t j) const |
slice of [i:j] | |
basic_string_ | operator() (offset_t i, offset_t j, size_t k) const |
slice of [i:j:k] | |
size_t | count (const CharT &x) const |
total number of occurences of a char. | |
offset_t | index (const CharT &val) const |
index of the first occurence of a char. | |
basic_string_ | strip (const baseT &spc=detail::vals< CharT >::ws) const |
Return a copy of the string with leading and trailing characters removed. | |
deque_< basic_string_ > | split (const baseT &delim=baseT(), int null_unite=-1) const |
split a string. | |
template<typename string_list > | |
basic_string_ | join (const string_list &r) const |
join a list of strings to one string. | |
template<typename str2 > | |
bool | startswith (str2 &&sub) const |
startswith. | |
template<typename str2 > | |
bool | istartswith (str2 &&sub) const |
case-insensitive startswith. | |
template<typename str2 > | |
bool | endswith (str2 &&sub) const |
endswith. | |
template<typename str2 > | |
bool | iendswith (str2 &&sub) const |
case-insensitive endswith. | |
basic_string_ | lower () const |
return a copy with upper case letters converted to lower case. | |
basic_string_ | upper () const |
return a copy with lower case letters converted to upper case. |
main string template
Definition at line 558 of file string.hpp.
|
inline |
index of the first occurence of a char.
val | the char. |
std::invalid_argument | if there is no such a char. |
Definition at line 768 of file string.hpp.
|
inline |
join a list of strings to one string.
r | the input string list |
Definition at line 851 of file string.hpp.
|
inline |
split a string.
delim | the delimiters |
null_unite | -1: a.c.t. python depent on token, 0: false, 1: true |
Definition at line 798 of file string.hpp.
|
inline |
Return a copy of the string with leading and trailing characters removed.
spc | white space chars |
Definition at line 781 of file string.hpp.