A dynamic character string whose interface conforms to STL's std::string. More...
#include "String.hpp"
Classes | |
class | Iterator |
A random access iterator class for String. More... | |
Public Types | |
using | iterator = Iterator< false, true > |
using | const_iterator = Iterator< true, true > |
using | reverse_iterator = Iterator< false, false > |
using | const_reverse_iterator = Iterator< true, false > |
using | value_type = char |
using | pointer = char * |
using | reference = char & |
using | const_reference = char const & |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
Public Member Functions | |
construction / destruction | |
String () | |
String (const String &that) | |
String (const String &that, size_type pos, size_type n=npos()) | |
String (String &&that) | |
String (const char *s) | |
String (const char *s, size_type n) | |
String (size_type n, char c) | |
String (iterator beg, iterator end) | |
String (const_iterator beg, const_iterator end) | |
String (reverse_iterator beg, reverse_iterator end) | |
String (const_reverse_iterator beg, const_reverse_iterator end) | |
~String () | |
assignment, swapping | |
String & | operator= (const String &that) |
String & | operator= (String &&that) |
String & | operator= (const char *that) |
String & | operator= (char c) |
String & | assign (const String &) |
String & | assign (const String &s, size_type pos, size_type n) |
String & | assign (const char *s, size_type n) |
String & | assign (const char *s) |
String & | assign (size_type n, char c) |
String & | assign (iterator beg, iterator end) |
String & | assign (const_iterator beg, const_iterator end) |
String & | assign (reverse_iterator beg, reverse_iterator end) |
String & | assign (const_reverse_iterator beg, const_reverse_iterator end) |
void | swap (String &that) |
iterator traversal | |
forward/reverse, const/non-const | |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
iterator | end () |
const_iterator | end () const |
const_iterator | cend () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
const_reverse_iterator | crbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
const_reverse_iterator | crend () const |
element access | |
reference | at (size_type n) |
const_reference | at (size_type n) const |
reference | operator[] (size_type n) |
const_reference | operator[] (size_type n) const |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
const char * | c_str () const |
const char * | data () const |
size | |
size_type | size () const |
size_type | length () const |
size_type | max_size () const |
size_type | capacity () const |
bool | empty () const |
void | clear () |
void | resize (size_type n, char c=char()) |
append | |
String & | append (const String &s) |
String & | append (const String &s, size_type pos, size_type n) |
String & | append (const char *s) |
String & | append (const char *s, size_type n) |
String & | append (size_type n, char c) |
String & | append (iterator beg, iterator end) |
String & | append (const_iterator beg, const_iterator end) |
String & | append (reverse_iterator beg, reverse_iterator end) |
String & | append (const_reverse_iterator beg, const_reverse_iterator end) |
void | push_back (char c) |
String & | operator+= (const String &s) |
String & | operator+= (const char *s) |
String & | operator+= (char c) |
insert | |
iterator | insert (iterator pos, const char &s) |
void | insert (iterator pos, size_type n, const char &s) |
String & | insert (size_type n, const String &s) |
String & | insert (size_type pos, const String &s, size_type pos1, size_type n) |
String & | insert (size_type pos, const char *s) |
String & | insert (size_type pos, const char *s, size_type n) |
String & | insert (size_type pos, size_type n, char c) |
void | insert (iterator pos, iterator beg, iterator end) |
void | insert (iterator pos, const_iterator beg, const_iterator end) |
void | insert (iterator pos, reverse_iterator beg, reverse_iterator end) |
void | insert (iterator pos, const_reverse_iterator beg, const_reverse_iterator end) |
erase | |
iterator | erase (iterator p) |
iterator | erase (iterator first, iterator last) |
String & | erase (size_type pos=0, size_type n=npos()) |
replace | |
String & | replace (size_type pos, size_type n, const String &s) |
String & | replace (size_type pos, size_type n, const String &s, size_type pos1, size_type n1) |
String & | replace (size_type pos, size_type n, const char *s, size_type n1) |
String & | replace (size_type pos, size_type n, const char *s) |
String & | replace (size_type pos, size_type n, size_type n1, char c) |
String & | replace (iterator first, iterator last, const String &s) |
String & | replace (iterator first, iterator last, const char *s, size_type n) |
String & | replace (iterator first, iterator last, const char *s) |
String & | replace (iterator first, iterator last, size_type n, char c) |
String & | replace (iterator beg1, iterator end1, iterator beg2, iterator end2) |
String & | replace (iterator beg1, iterator end1, const_iterator beg2, const_iterator end2) |
String & | replace (iterator beg1, iterator end1, reverse_iterator beg2, reverse_iterator end2) |
String & | replace (iterator beg1, iterator end1, const_reverse_iterator beg2, const_reverse_iterator end2) |
find | |
forward/reverse | |
size_type | find (const String &s, size_type pos=0) const |
size_type | find (const char *s, size_type pos, size_type n) const |
size_type | find (const char *s, size_type pos=0) const |
size_type | find (char c, size_type pos=0) const |
size_type | rfind (const String &s, size_type pos=npos()) const |
size_type | rfind (const char *s, size_type pos, size_type n) const |
size_type | rfind (const char *s, size_type pos=npos()) const |
size_type | rfind (char c, size_type pos=npos()) const |
size_type | find_first_of (const String &s, size_type pos=0) const |
size_type | find_first_of (const char *s, size_type pos, size_type n) const |
size_type | find_first_of (const char *s, size_type pos=0) const |
size_type | find_first_of (char c, size_type pos=0) const |
size_type | find_first_not_of (const String &s, size_type pos=0) const |
size_type | find_first_not_of (const char *s, size_type pos, size_type n) const |
size_type | find_first_not_of (const char *s, size_type pos=0) const |
size_type | find_first_not_of (char c, size_type pos=0) const |
size_type | find_last_of (const String &s, size_type pos=npos()) const |
size_type | find_last_of (const char *s, size_type pos, size_type n) const |
size_type | find_last_of (const char *s, size_type pos=npos()) const |
size_type | find_last_of (char c, size_type pos=npos()) const |
size_type | find_last_not_of (const String &s, size_type pos=npos()) const |
size_type | find_last_not_of (const char *s, size_type pos, size_type n) const |
size_type | find_last_not_of (const char *s, size_type pos=npos()) const |
size_type | find_last_not_of (char c, size_type pos=npos()) const |
substring | |
String | substr (size_type pos=0, size_type n=npos()) const |
copy to buffer | |
size_type | copy (char *buf, size_type n, size_type pos=0) const |
3-way comparison | |
int | compare (const String &s) const |
int | compare (size_type pos, size_type n, const String &s) const |
int | compare (size_type pos, size_type n, const String &s, size_type pos1, size_type n1) const |
int | compare (const char *s) const |
int | compare (size_type pos, size_type n, const char *s, size_type len=npos()) const |
Static Public Member Functions | |
static const size_type & | npos () |
Related Functions | |
(Note that these are not member functions.) | |
String | operator+ (const String &s1, const String &s2) |
String | operator+ (const char *s1, const String &s2) |
String | operator+ (const String &s1, const char *s2) |
String | operator+ (char c, const String &s2) |
String | operator+ (const String &s1, char c) |
bool | operator== (const String &s1, const String &s2) |
bool | operator== (const char *s1, const String &s2) |
bool | operator== (const String &s1, const char *s2) |
bool | operator!= (const String &s1, const String &s2) |
bool | operator!= (const char *s1, const String &s2) |
bool | operator!= (const String &s1, const char *s2) |
bool | operator< (const String &s1, const String &s2) |
bool | operator< (const char *s1, const String &s2) |
bool | operator< (const String &s1, const char *s2) |
void | swap (String &s1, String &s2) |
A dynamic character string whose interface conforms to STL's std::string.