Sierra Toolkit Version of the Day
eastl::basic_string< T, Allocator > Class Template Reference

#include <string_eastl.h>

List of all members.

Public Types

enum  {
  kAlignment = EASTL_ALIGN_OF(T),
  kAlignmentOffset = 0
}
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_typeoperator= (const this_type &x)
this_typeoperator= (const value_type *p)
this_typeoperator= (value_type c)
void swap (this_type &x)
basic_stringassign (const basic_string &x)
basic_stringassign (const basic_string &x, size_type position, size_type n)
basic_stringassign (const value_type *p, size_type n)
basic_stringassign (const value_type *p)
basic_stringassign (size_type n, value_type c)
basic_stringassign (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_stringoperator+= (const basic_string &x)
basic_stringoperator+= (const value_type *p)
basic_stringoperator+= (value_type c)
basic_stringappend (const basic_string &x)
basic_stringappend (const basic_string &x, size_type position, size_type n)
basic_stringappend (const value_type *p, size_type n)
basic_stringappend (const value_type *p)
basic_stringappend (size_type n, value_type c)
basic_stringappend (const value_type *pBegin, const value_type *pEnd)
basic_stringappend_sprintf_va_list (const value_type *pFormat, va_list arguments)
basic_stringappend_sprintf (const value_type *pFormat,...)
void push_back (value_type c)
void pop_back ()
basic_stringinsert (size_type position, const basic_string &x)
basic_stringinsert (size_type position, const basic_string &x, size_type beg, size_type n)
basic_stringinsert (size_type position, const value_type *p, size_type n)
basic_stringinsert (size_type position, const value_type *p)
basic_stringinsert (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_stringerase (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_stringreplace (size_type position, size_type n, const basic_string &x)
basic_stringreplace (size_type pos1, size_type n1, const basic_string &x, size_type pos2, size_type n2)
basic_stringreplace (size_type position, size_type n1, const value_type *p, size_type n2)
basic_stringreplace (size_type position, size_type n1, const value_type *p)
basic_stringreplace (size_type position, size_type n1, size_type n2, value_type c)
basic_stringreplace (iterator first, iterator last, const basic_string &x)
basic_stringreplace (iterator first, iterator last, const value_type *p, size_type n)
basic_stringreplace (iterator first, iterator last, const value_type *p)
basic_stringreplace (iterator first, iterator last, size_type n, value_type c)
basic_stringreplace (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_stringsprintf_va_list (const value_type *pFormat, va_list arguments)
basic_stringsprintf (const value_type *pFormat,...)
bool validate () const
int validate_iterator (const_iterator i) const

Static Public Member Functions

static int compare (const value_type *pBegin1, const value_type *pEnd1, const value_type *pBegin2, const value_type *pEnd2)
static int comparei (const value_type *pBegin1, const value_type *pEnd1, const value_type *pBegin2, const value_type *pEnd2)

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 Member Functions

value_type * DoAllocate (size_type n)
void DoFree (value_type *p, size_type n)
size_type GetNewCapacity (size_type currentCapacity)
void AllocateSelf ()
void AllocateSelf (size_type n)
void DeallocateSelf ()
iterator InsertInternal (iterator p, value_type c)
void RangeInitialize (const value_type *pBegin, const value_type *pEnd)
void RangeInitialize (const value_type *pBegin)
void SizeInitialize (size_type n, value_type c)
void ThrowLengthException () const
void ThrowRangeException () const
void ThrowInvalidArgumentException () const

Static Protected Member Functions

static const value_type * CharTypeStringFindEnd (const value_type *pBegin, const value_type *pEnd, value_type c)
static const value_type * CharTypeStringRFind (const value_type *pRBegin, const value_type *pREnd, const value_type c)
static const value_type * CharTypeStringSearch (const value_type *p1Begin, const value_type *p1End, const value_type *p2Begin, const value_type *p2End)
static const value_type * CharTypeStringRSearch (const value_type *p1Begin, const value_type *p1End, const value_type *p2Begin, const value_type *p2End)
static const value_type * CharTypeStringFindFirstOf (const value_type *p1Begin, const value_type *p1End, const value_type *p2Begin, const value_type *p2End)
static const value_type * CharTypeStringRFindFirstOf (const value_type *p1RBegin, const value_type *p1REnd, const value_type *p2Begin, const value_type *p2End)
static const value_type * CharTypeStringFindFirstNotOf (const value_type *p1Begin, const value_type *p1End, const value_type *p2Begin, const value_type *p2End)
static const value_type * CharTypeStringRFindFirstNotOf (const value_type *p1RBegin, const value_type *p1REnd, const value_type *p2Begin, const value_type *p2End)

Protected Attributes

value_type * mpBegin
value_type * mpEnd
value_type * mpCapacity
allocator_type mAllocator

Detailed Description

template<typename T, typename Allocator = EASTLAllocatorType>
class eastl::basic_string< T, Allocator >

basic_string

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.


Member Enumeration Documentation

template<typename T , typename Allocator = EASTLAllocatorType>
anonymous enum

-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.

Definition at line 299 of file string_eastl.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends