#include <ext_string.h>
Inheritance diagram for std::ext_string:
Public Member Functions | |
vector< ext_string > | chunk_split (size_type chunklen) const |
Split a string into chunks of size chunklen . | |
size_type | count (const string &str) const |
Count the occurances of str in the string. | |
template<class InputIterator> | |
ext_string (InputIterator first, InputIterator last) | |
Create a string from a range. | |
ext_string (size_type n, value_type c) | |
Create an ext_string with n copies of c . | |
ext_string (const value_type *s, size_type n) | |
Construct an ext_string from a character array and a length. | |
ext_string (const value_type *s) | |
Construct an ext_string from a null-terminated character array. | |
ext_string (const string &s, size_type pos=0, size_type n=npos) | |
Duplicate the STL string copy constructor. | |
ext_string () | |
Default constructor. | |
long int | integer () const |
Convert the string to an integer. | |
bool | is_alnum () const |
Determine if the string is alphanumeric. | |
bool | is_alpha () const |
Determine if the string is alphabetic only. | |
bool | is_lower () const |
Determine if a string is all lower case. | |
bool | is_numeric () const |
Determine if the string is numeric only. | |
bool | is_upper () const |
Determine if a string is all upper case. | |
ext_string | operator * (size_type n) |
Repeat a string n times. | |
ext_string & | replace (value_type needle, value_type c) |
Search of any instances of needle and replace them with c . | |
ext_string & | replace (const string &needle, const string &s) |
Search for any instances of needle and replace them with s . | |
vector< ext_string > | split (const string &separator, size_type limit=npos) const |
Split a string by another string. | |
vector< ext_string > | split (value_type separator, size_type limit=npos) const |
Split a string by a character. | |
vector< ext_string > | split (size_type limit=npos) const |
Split a string by whitespace. | |
ext_string & | swapcase () |
Swap the case of a string. | |
ext_string & | tolower () |
Convert the string to lowercase. | |
ext_string & | toupper () |
Convert the string to uppercase. | |
~ext_string () | |
The destructor. | |
Static Public Member Functions | |
static long int | integer (const string &s) |
Convert a string into an integer. | |
template<class InputIterator> | |
static ext_string | join (value_type glue, InputIterator first, InputIterator last) |
Join a sequence of strings by some glue to create a new string. | |
template<class InputIterator> | |
static ext_string | join (const string &glue, InputIterator first, InputIterator last) |
Join a sequence of strings by some glue to create a new string. |
Definition at line 109 of file ext_string.h.
|
Default constructor. Constructs an empty ext_string ("") Definition at line 117 of file ext_string.h. Referenced by chunk_split(), and split(). |
|
Duplicate the STL string copy constructor.
Definition at line 126 of file ext_string.h. |
|
Construct an ext_string from a null-terminated character array.
Definition at line 133 of file ext_string.h. |
|
Construct an ext_string from a character array and a length.
Definition at line 141 of file ext_string.h. |
|
Create an ext_string with
Definition at line 149 of file ext_string.h. |
|
Create a string from a range.
Definition at line 158 of file ext_string.h. |
|
The destructor.
Definition at line 163 of file ext_string.h. |
|
Split a string into chunks of size Returns a vector of strings. Splits a string into chunks of the given size. The final chunk may not fill its entire allocated number of characters.
Examplestd::ext_string s("abcdefghijk"); std::vector<std::ext_string> v = s.chunk_split(3); std::copy(v.begin(), v.end(), ostream_iterator<std::ext_string>(cout, " ")); abc def ghi jk Definition at line 376 of file ext_string.h. References count(), and ext_string(). |
|
Count the occurances of
Definition at line 570 of file ext_string.h. References count(). Referenced by chunk_split(), and count(). |
|
Convert the string to an integer. Convert the initial portion of the string into a signed integer. Once a non-numeric character is reached, the remainder of the string is ignored and the integer that had been read thus far is returned.
Definition at line 353 of file ext_string.h. |
|
Convert a string into an integer.
Convert the initial portion of a string into a signed integer. Once a non-numeric character is reached, the remainder of
Definition at line 312 of file ext_string.h. |
|
Determine if the string is alphanumeric.
Definition at line 592 of file ext_string.h. |
|
Determine if the string is alphabetic only.
Definition at line 614 of file ext_string.h. |
|
Determine if a string is all lower case.
Definition at line 650 of file ext_string.h. |
|
Determine if the string is numeric only.
Definition at line 632 of file ext_string.h. |
|
Determine if a string is all upper case.
Definition at line 668 of file ext_string.h. |
|
Join a sequence of strings by some glue to create a new string. Glue is not added to the end of the string.
Definition at line 449 of file ext_string.h. References std::basic_string< _CharT, _Traits, _Alloc >::append(), std::basic_string< _CharT, _Traits, _Alloc >::erase(), and std::basic_string< _CharT, _Traits, _Alloc >::length(). |
|
Join a sequence of strings by some glue to create a new string. Glue is not added to the end of the string.
Examplestd::vector<std::ext_string> v; v.push_back("This"); v.push_back("is"); v.push_back("a"); v.push_back("test."); std::cout << std::ext_string::join("|", v.begin(), v.end()) << std::endl; This|is|a|test. Definition at line 428 of file ext_string.h. References std::basic_string< _CharT, _Traits, _Alloc >::append(), std::basic_string< _CharT, _Traits, _Alloc >::erase(), and std::basic_string< _CharT, _Traits, _Alloc >::length(). |
|
Repeat a string
Examplestd::ext_string s("123"); s = s * 3; std::cout << s << std::endl; 123123123 Definition at line 528 of file ext_string.h. References std::basic_string< _CharT, _Traits, _Alloc >::append(). |
|
Search of any instances of
Definition at line 504 of file ext_string.h. |
|
Search for any instances of
Examplestd::ext_string s("This is a test."); s.replace("is", "ere"); std::cout << s << std::endl; There ere a test. Definition at line 480 of file ext_string.h. |
|
Split a string by another string.
Returns a vector of ext_strings, each of which is a substring of the string formed by splitting it on boundaries formed by the string
If The separators are removed from the output
Definition at line 274 of file ext_string.h. References ext_string(). |
|
Split a string by a character.
Returns a vector of ext_strings, each of which is a substring of the string formed by splitting it on boundaries formed by the character
If The separators are removed from the output
Examplestd::ext_string s("This|is|a|test."); std::vector<std::ext_string> v = s.split('|'); std::copy(v.begin(), v.end(), std::ostream_iterator<std::ext_string>(std::cout, "\n")); This is a test. Definition at line 228 of file ext_string.h. References ext_string(). |
|
Split a string by whitespace.
Definition at line 170 of file ext_string.h. References ext_string(). |
|
Swap the case of a string.
Definition at line 686 of file ext_string.h. |
|
Convert the string to lowercase.
Definition at line 543 of file ext_string.h. |
|
Convert the string to uppercase.
Definition at line 557 of file ext_string.h. |