Sierra Toolkit
Version of the Day
|
#include <string_eastl.h>
Public Types | |
enum | { kAlignment = EASTL_ALIGN_OF(T), kAlignmentOffset = 0 } |
-1 is reserved for 'npos'. It also happens to be slightly beneficial that kMaxSize is a value less than -1, as it helps us deal with potential integer wraparound issues. | |
typedef basic_string< T, Allocator > | this_type |
typedef T | value_type |
typedef T * | pointer |
typedef const T * | const_pointer |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | iterator |
typedef const T * | const_iterator |
typedef eastl::reverse_iterator< iterator > | reverse_iterator |
typedef eastl::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef eastl_size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef Allocator | allocator_type |
Public Member Functions | |
basic_string (const allocator_type &allocator) | |
basic_string (const this_type &x, size_type position, size_type n=npos) | |
basic_string (const value_type *p, size_type n, const allocator_type &allocator=allocator_type(EASTL_DEFAULT_NAME_PREFIX " basic_string")) | |
basic_string (const value_type *p, const allocator_type &allocator=allocator_type(EASTL_DEFAULT_NAME_PREFIX " basic_string")) | |
basic_string (size_type n, value_type c, const allocator_type &allocator=allocator_type(EASTL_DEFAULT_NAME_PREFIX " basic_string")) | |
basic_string (const this_type &x) | |
basic_string (const value_type *pBegin, const value_type *pEnd, const allocator_type &allocator=allocator_type(EASTL_DEFAULT_NAME_PREFIX " basic_string")) | |
basic_string (CtorDoNotInitialize, size_type n, const allocator_type &allocator=allocator_type(EASTL_DEFAULT_NAME_PREFIX " basic_string")) | |
basic_string (CtorSprintf, const value_type *pFormat,...) | |
const allocator_type & | get_allocator () const |
allocator_type & | get_allocator () |
void | set_allocator (const allocator_type &allocator) |
this_type & | operator= (const this_type &x) |
this_type & | operator= (const value_type *p) |
this_type & | operator= (value_type c) |
void | swap (this_type &x) |
basic_string & | assign (const basic_string &x) |
basic_string & | assign (const basic_string &x, size_type position, size_type n) |
basic_string & | assign (const value_type *p, size_type n) |
basic_string & | assign (const value_type *p) |
basic_string & | assign (size_type n, value_type c) |
basic_string & | assign (const value_type *pBegin, const value_type *pEnd) |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
bool | empty () const |
size_type | size () const |
size_type | length () const |
size_type | max_size () const |
size_type | capacity () const |
void | resize (size_type n, value_type c) |
void | resize (size_type n) |
void | reserve (size_type=0) |
void | set_capacity (size_type n=npos) |
void | force_size (size_type n) |
const value_type * | data () const |
const value_type * | c_str () const |
reference | operator[] (size_type n) |
const_reference | operator[] (size_type n) const |
reference | at (size_type n) |
const_reference | at (size_type n) const |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
basic_string & | operator+= (const basic_string &x) |
basic_string & | operator+= (const value_type *p) |
basic_string & | operator+= (value_type c) |
basic_string & | append (const basic_string &x) |
basic_string & | append (const basic_string &x, size_type position, size_type n) |
basic_string & | append (const value_type *p, size_type n) |
basic_string & | append (const value_type *p) |
basic_string & | append (size_type n, value_type c) |
basic_string & | append (const value_type *pBegin, const value_type *pEnd) |
basic_string & | append_sprintf_va_list (const value_type *pFormat, va_list arguments) |
basic_string & | append_sprintf (const value_type *pFormat,...) |
void | push_back (value_type c) |
void | pop_back () |
basic_string & | insert (size_type position, const basic_string &x) |
basic_string & | insert (size_type position, const basic_string &x, size_type beg, size_type n) |
basic_string & | insert (size_type position, const value_type *p, size_type n) |
basic_string & | insert (size_type position, const value_type *p) |
basic_string & | insert (size_type position, size_type n, value_type c) |
iterator | insert (iterator p, value_type c) |
void | insert (iterator p, size_type n, value_type c) |
void | insert (iterator p, const value_type *pBegin, const value_type *pEnd) |
basic_string & | erase (size_type position=0, size_type n=npos) |
iterator | erase (iterator p) |
iterator | erase (iterator pBegin, iterator pEnd) |
reverse_iterator | erase (reverse_iterator position) |
reverse_iterator | erase (reverse_iterator first, reverse_iterator last) |
void | clear () |
void | reset () |
basic_string & | replace (size_type position, size_type n, const basic_string &x) |
basic_string & | replace (size_type pos1, size_type n1, const basic_string &x, size_type pos2, size_type n2) |
basic_string & | replace (size_type position, size_type n1, const value_type *p, size_type n2) |
basic_string & | replace (size_type position, size_type n1, const value_type *p) |
basic_string & | replace (size_type position, size_type n1, size_type n2, value_type c) |
basic_string & | replace (iterator first, iterator last, const basic_string &x) |
basic_string & | replace (iterator first, iterator last, const value_type *p, size_type n) |
basic_string & | replace (iterator first, iterator last, const value_type *p) |
basic_string & | replace (iterator first, iterator last, size_type n, value_type c) |
basic_string & | replace (iterator first, iterator last, const value_type *pBegin, const value_type *pEnd) |
size_type | copy (value_type *p, size_type n, size_type position=0) const |
size_type | find (const basic_string &x, size_type position=0) const |
size_type | find (const value_type *p, size_type position=0) const |
size_type | find (const value_type *p, size_type position, size_type n) const |
size_type | find (value_type c, size_type position=0) const |
size_type | rfind (const basic_string &x, size_type position=npos) const |
size_type | rfind (const value_type *p, size_type position=npos) const |
size_type | rfind (const value_type *p, size_type position, size_type n) const |
size_type | rfind (value_type c, size_type position=npos) const |
size_type | find_first_of (const basic_string &x, size_type position=0) const |
size_type | find_first_of (const value_type *p, size_type position=0) const |
size_type | find_first_of (const value_type *p, size_type position, size_type n) const |
size_type | find_first_of (value_type c, size_type position=0) const |
size_type | find_last_of (const basic_string &x, size_type position=npos) const |
size_type | find_last_of (const value_type *p, size_type position=npos) const |
size_type | find_last_of (const value_type *p, size_type position, size_type n) const |
size_type | find_last_of (value_type c, size_type position=npos) const |
size_type | find_first_not_of (const basic_string &x, size_type position=0) const |
size_type | find_first_not_of (const value_type *p, size_type position=0) const |
size_type | find_first_not_of (const value_type *p, size_type position, size_type n) const |
size_type | find_first_not_of (value_type c, size_type position=0) const |
size_type | find_last_not_of (const basic_string &x, size_type position=npos) const |
size_type | find_last_not_of (const value_type *p, size_type position=npos) const |
size_type | find_last_not_of (const value_type *p, size_type position, size_type n) const |
size_type | find_last_not_of (value_type c, size_type position=npos) const |
basic_string | substr (size_type position=0, size_type n=npos) const |
int | compare (const basic_string &x) const |
int | compare (size_type pos1, size_type n1, const basic_string &x) const |
int | compare (size_type pos1, size_type n1, const basic_string &x, size_type pos2, size_type n2) const |
int | compare (const value_type *p) const |
int | compare (size_type pos1, size_type n1, const value_type *p) const |
int | compare (size_type pos1, size_type n1, const value_type *p, size_type n2) const |
int | comparei (const basic_string &x) const |
int | comparei (const value_type *p) const |
void | make_lower () |
void | make_upper () |
void | ltrim () |
void | rtrim () |
void | trim () |
basic_string | left (size_type n) const |
basic_string | right (size_type n) const |
basic_string & | sprintf_va_list (const value_type *pFormat, va_list arguments) |
basic_string & | sprintf (const value_type *pFormat,...) |
bool | validate () const |
int | validate_iterator (const_iterator i) const |
Static Public Attributes | |
static const size_type | npos = (size_type)-1 |
static const size_type | kMaxSize = (size_type)-2 |
'npos' means non-valid position or simply non-position. | |
Protected Attributes | |
value_type * | mpBegin |
value_type * | mpEnd |
value_type * | mpCapacity |
allocator_type | mAllocator |
Implements a templated string class, somewhat like C++ std::basic_string.
Notes: As of this writing, an insert of a string into itself necessarily triggers a reallocation, even if there is enough capacity in self to handle the increase in size. This is due to the slightly tricky nature of the operation of modifying one's self with one's self, and thus the source and destination are being modified during the operation. It might be useful to rectify this to the extent possible.
Definition at line 272 of file string_eastl.h.