Support Forum       G3D Web Page     
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
G3D::G3DString< INTERNAL_SIZE > Class Template Reference

Very fast string class that follows the std::string/std::basic_string interface. More...

Public Types

typedef const char * const_iterator
 
typedef const char * const_pointer
 
typedef const char & const_reference
 
typedef ptrdiff_t difference_type
 
typedef char * iterator
 
typedef char * pointer
 
typedef char & reference
 
typedef size_t size_type
 
typedef std::char_traits< char > traits_type
 
typedef char value_type
 

Public Member Functions

 G3DString ()
 Creates a zero-length string. More...
 
 G3DString (const value_type c)
 
 G3DString (size_t count, const value_type c)
 
 G3DString (G3DString &&s)
 
 G3DString (const G3DString &s)
 
 G3DString (const std::string &s)
 
 G3DString (const value_type *c)
 
 G3DString (const value_type *c, size_t len)
 
 ~G3DString ()
 
G3DStringappend (const G3DString &s, size_t subpos, size_t sublen)
 
G3DStringappend (const G3DString &s)
 
G3DStringappend (size_t n, value_type c)
 
G3DStringappend (const value_type *c, size_t t)
 
G3DStringappend (const value_type *c)
 
G3DStringassign (const G3DString &s)
 
G3DStringassign (const G3DString &s, size_t subpos, size_t sublen)
 
G3DStringassign (const value_type *c, size_t n)
 
G3DStringassign (size_t n, const value_type c)
 
const_reference at (size_t x) const
 
reference at (size_t x)
 
const_reference back () const
 
reference back (size_t x)
 
iterator begin ()
 
const value_typec_str () const
 
size_type capacity () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
int compare (const G3DString &str) const
 
int compare (size_t pos, size_t len, const G3DString &str) const
 
int compare (size_t pos, size_t len, const G3DString &str, size_t subpos, size_t sublen) const
 
int compare (const char *s) const
 
int compare (size_t pos, size_t len, const char *s) const
 
int compare (size_t pos, size_t len, const char *s, size_t n) const
 
const value_typedata () const
 
bool empty () const
 
iterator end ()
 
G3DStringerase (size_t pos=0, size_t len=npos)
 
size_t find (const G3DString &str, size_t pos=0) const
 
size_t find (const char *s, size_t pos=0) const
 
size_t find (const char *s, size_t pos, size_t n) const
 
size_t find (char c, size_t pos=0) const
 
size_t find_first_of (const value_type *s, size_t pos, size_t n) const
 
size_t find_first_of (const G3DString &str, size_t pos=0) const
 
size_t find_first_of (const value_type *s, size_t pos=0) const
 
size_t find_first_of (value_type c, size_t pos=0) const
 
size_t find_last_of (const value_type *s, size_t pos, size_t n) const
 
size_t find_last_of (const G3DString &str, size_t pos=npos) const
 
size_t find_last_of (const value_type *s, size_t pos=npos) const
 
size_t find_last_of (value_type c, size_t pos=npos) const
 
const_reference front () const
 
reference front (size_t x)
 
G3DStringinsert (size_t pos, const G3DString &str, size_t subpos, size_t sublen)
 
G3DStringinsert (size_t pos, const G3DString &str)
 
G3DStringinsert (size_t pos, const value_type *c)
 
size_type length () const
 
size_type max_size () const
 
bool operator!= (const G3DString &s) const
 
bool operator!= (const value_type *c) const
 
G3DString operator+ (const G3DString &s) const
 
G3DString operator+ (const value_type *c) const
 
G3DString operator+ (const value_type c) const
 
G3DStringoperator+= (const G3DString &s)
 
G3DStringoperator+= (const value_type c)
 
G3DStringoperator+= (const value_type *c)
 
bool operator< (const G3DString &s) const
 
G3DStringoperator= (const value_type *c)
 
G3DStringoperator= (const G3DString &s)
 
G3DStringoperator= (G3DString &&s)
 
bool operator== (const G3DString &s) const
 
bool operator== (const value_type *c) const
 
bool operator> (const G3DString &s) const
 
const_reference operator[] (size_t x) const
 
reference operator[] (size_t x)
 
void push_back (value_type c)
 
void reserve (size_t newLength)
 
size_t rfind (const G3DString &str, size_t pos=npos) const
 
size_t rfind (const char *s, size_t pos=npos) const
 
size_t rfind (const char *s, size_t pos, size_t n) const
 
size_t rfind (char c, size_t pos=npos) const
 
size_type size () const
 
G3DString substr (size_t pos=0, size_t len=npos) const
 

Static Public Attributes

static const size_type npos = size_type(-1)
 

Protected Member Functions

value_typealloc (size_t b)
 Total size to allocate, including the terminator. More...
 
void ensureAllocation (size_t newSize, bool copyOldData)
 Ensures that there is enough space for newSize characters in the string (newSize + 1 bytes for the terminator). More...
 
void free (value_type *p) const
 Only frees if the value was not in the const segment or m_buffer. More...
 
bool inBuffer (const char *ptr) const
 
bool inBuffer () const
 
bool inConst () const
 Optimized to assume the invariant holds and only check m_allocated. More...
 
void maybeDeallocate ()
 
void prepareToMutate ()
 
void testInvariants () const
 

Static Protected Member Functions

static size_t chooseAllocationSize (size_t L)
 Choose the number of bytes to allocate to hold a string of length L characters. More...
 
static bool inConst (const char *ptr)
 
static void memcpy (void *dst, const void *src, size_t len)
 
static void memcpyBuffer (void *dst, const void *src)
 Copies from one m_data to another where both are in the m_buffer of the corresponding string and have 16-byte alignment. More...
 

Protected Attributes

size_t m_allocated
 Total size of m_data, including '\0'... More...
 
char m_buffer [INTERNAL_SIZE+MAX_ALIGNMENT_PADDING]
 This inline storage is used when strings are small. More...
 
value_typem_data
 The current value of this string. More...
 
size_t m_length
 Bytes to, but not including, '\0'. More...
 

Detailed Description

template<size_t INTERNAL_SIZE = 32>
class G3D::G3DString< INTERNAL_SIZE >

Very fast string class that follows the std::string/std::basic_string interface.

Assumes 8-byte (64-bit) alignment of the String (G3DString) class, and only corrects by up to 8 bytes to ensure 16-byte SSE alignment. This is the default behavior for compilers generating 64-bit code. If you need to use this class with a 32-bit target or inside of a packed block, then it must be modified with additional padding.

Member Typedef Documentation

◆ const_iterator

template<size_t INTERNAL_SIZE = 32>
typedef const char* G3D::G3DString< INTERNAL_SIZE >::const_iterator

◆ const_pointer

template<size_t INTERNAL_SIZE = 32>
typedef const char* G3D::G3DString< INTERNAL_SIZE >::const_pointer

◆ const_reference

template<size_t INTERNAL_SIZE = 32>
typedef const char& G3D::G3DString< INTERNAL_SIZE >::const_reference

◆ difference_type

template<size_t INTERNAL_SIZE = 32>
typedef ptrdiff_t G3D::G3DString< INTERNAL_SIZE >::difference_type

◆ iterator

template<size_t INTERNAL_SIZE = 32>
typedef char* G3D::G3DString< INTERNAL_SIZE >::iterator

◆ pointer

template<size_t INTERNAL_SIZE = 32>
typedef char* G3D::G3DString< INTERNAL_SIZE >::pointer

◆ reference

template<size_t INTERNAL_SIZE = 32>
typedef char& G3D::G3DString< INTERNAL_SIZE >::reference

◆ size_type

template<size_t INTERNAL_SIZE = 32>
typedef size_t G3D::G3DString< INTERNAL_SIZE >::size_type

◆ traits_type

template<size_t INTERNAL_SIZE = 32>
typedef std::char_traits<char> G3D::G3DString< INTERNAL_SIZE >::traits_type

◆ value_type

template<size_t INTERNAL_SIZE = 32>
typedef char G3D::G3DString< INTERNAL_SIZE >::value_type

Constructor & Destructor Documentation

◆ G3DString() [1/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( )
inline

Creates a zero-length string.

◆ G3DString() [2/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( const value_type  c)
inlineexplicit

◆ G3DString() [3/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( size_t  count,
const value_type  c 
)
inline

◆ G3DString() [4/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( G3DString< INTERNAL_SIZE > &&  s)
inline

◆ G3DString() [5/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( const G3DString< INTERNAL_SIZE > &  s)
inline

◆ G3DString() [6/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( const std::string &  s)
inlineexplicit

◆ G3DString() [7/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( const value_type c)
inline

◆ G3DString() [8/8]

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::G3DString ( const value_type c,
size_t  len 
)
inline
Parameters
lenCopy len characters from c.

◆ ~G3DString()

template<size_t INTERNAL_SIZE = 32>
G3D::G3DString< INTERNAL_SIZE >::~G3DString ( )
inline

Member Function Documentation

◆ alloc()

template<size_t INTERNAL_SIZE = 32>
value_type* G3D::G3DString< INTERNAL_SIZE >::alloc ( size_t  b)
inlineprotected

Total size to allocate, including the terminator.

If b <= INTERNAL_SIZE, allocates INTERNAL_SIZE using m_buffer, otherwise allocates exactly b bytes on the heap.

◆ append() [1/5]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::append ( const G3DString< INTERNAL_SIZE > &  s,
size_t  subpos,
size_t  sublen 
)
inline

◆ append() [2/5]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::append ( const G3DString< INTERNAL_SIZE > &  s)
inline

◆ append() [3/5]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::append ( size_t  n,
value_type  c 
)
inline

◆ append() [4/5]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::append ( const value_type c,
size_t  t 
)
inline

◆ append() [5/5]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::append ( const value_type c)
inline

◆ assign() [1/4]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::assign ( const G3DString< INTERNAL_SIZE > &  s)
inline

◆ assign() [2/4]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::assign ( const G3DString< INTERNAL_SIZE > &  s,
size_t  subpos,
size_t  sublen 
)
inline

◆ assign() [3/4]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::assign ( const value_type c,
size_t  n 
)
inline

◆ assign() [4/4]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::assign ( size_t  n,
const value_type  c 
)
inline

◆ at() [1/2]

template<size_t INTERNAL_SIZE = 32>
const_reference G3D::G3DString< INTERNAL_SIZE >::at ( size_t  x) const
inline

◆ at() [2/2]

template<size_t INTERNAL_SIZE = 32>
reference G3D::G3DString< INTERNAL_SIZE >::at ( size_t  x)
inline

◆ back() [1/2]

template<size_t INTERNAL_SIZE = 32>
const_reference G3D::G3DString< INTERNAL_SIZE >::back ( ) const
inline

◆ back() [2/2]

template<size_t INTERNAL_SIZE = 32>
reference G3D::G3DString< INTERNAL_SIZE >::back ( size_t  x)
inline

◆ begin()

template<size_t INTERNAL_SIZE = 32>
iterator G3D::G3DString< INTERNAL_SIZE >::begin ( )
inline

◆ c_str()

template<size_t INTERNAL_SIZE = 32>
const value_type* G3D::G3DString< INTERNAL_SIZE >::c_str ( ) const
inline

◆ capacity()

template<size_t INTERNAL_SIZE = 32>
size_type G3D::G3DString< INTERNAL_SIZE >::capacity ( ) const
inline

◆ cbegin()

template<size_t INTERNAL_SIZE = 32>
const_iterator G3D::G3DString< INTERNAL_SIZE >::cbegin ( ) const
inline

◆ cend()

template<size_t INTERNAL_SIZE = 32>
const_iterator G3D::G3DString< INTERNAL_SIZE >::cend ( ) const
inline

◆ chooseAllocationSize()

template<size_t INTERNAL_SIZE = 32>
static size_t G3D::G3DString< INTERNAL_SIZE >::chooseAllocationSize ( size_t  L)
inlinestaticprotected

Choose the number of bytes to allocate to hold a string of length L characters.

i.e., allocate one extra byte, and then decide if it should just use the internal buffer. If not in the internal buffer, allocate at least 64 bytes, or 2*L + 1, so that appends can be fast.

◆ clear()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::clear ( )
inline

◆ compare() [1/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( const G3DString< INTERNAL_SIZE > &  str) const
inline

◆ compare() [2/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( size_t  pos,
size_t  len,
const G3DString< INTERNAL_SIZE > &  str 
) const
inline

◆ compare() [3/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( size_t  pos,
size_t  len,
const G3DString< INTERNAL_SIZE > &  str,
size_t  subpos,
size_t  sublen 
) const
inline

◆ compare() [4/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( const char *  s) const
inline

◆ compare() [5/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( size_t  pos,
size_t  len,
const char *  s 
) const
inline

◆ compare() [6/6]

template<size_t INTERNAL_SIZE = 32>
int G3D::G3DString< INTERNAL_SIZE >::compare ( size_t  pos,
size_t  len,
const char *  s,
size_t  n 
) const
inline

◆ data()

template<size_t INTERNAL_SIZE = 32>
const value_type* G3D::G3DString< INTERNAL_SIZE >::data ( ) const
inline

◆ empty()

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::empty ( ) const
inline

◆ end()

template<size_t INTERNAL_SIZE = 32>
iterator G3D::G3DString< INTERNAL_SIZE >::end ( )
inline

◆ ensureAllocation()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::ensureAllocation ( size_t  newSize,
bool  copyOldData 
)
inlineprotected

Ensures that there is enough space for newSize characters in the string (newSize + 1 bytes for the terminator).

◆ erase()

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::erase ( size_t  pos = 0,
size_t  len = npos 
)
inline

◆ find() [1/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find ( const G3DString< INTERNAL_SIZE > &  str,
size_t  pos = 0 
) const
inline

◆ find() [2/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find ( const char *  s,
size_t  pos = 0 
) const
inline

◆ find() [3/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find ( const char *  s,
size_t  pos,
size_t  n 
) const
inline

◆ find() [4/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find ( char  c,
size_t  pos = 0 
) const
inline

◆ find_first_of() [1/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_first_of ( const value_type s,
size_t  pos,
size_t  n 
) const
inline

◆ find_first_of() [2/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_first_of ( const G3DString< INTERNAL_SIZE > &  str,
size_t  pos = 0 
) const
inline

◆ find_first_of() [3/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_first_of ( const value_type s,
size_t  pos = 0 
) const
inline

◆ find_first_of() [4/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_first_of ( value_type  c,
size_t  pos = 0 
) const
inline

◆ find_last_of() [1/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_last_of ( const value_type s,
size_t  pos,
size_t  n 
) const
inline

◆ find_last_of() [2/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_last_of ( const G3DString< INTERNAL_SIZE > &  str,
size_t  pos = npos 
) const
inline

◆ find_last_of() [3/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_last_of ( const value_type s,
size_t  pos = npos 
) const
inline

◆ find_last_of() [4/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::find_last_of ( value_type  c,
size_t  pos = npos 
) const
inline

◆ free()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::free ( value_type p) const
inlineprotected

Only frees if the value was not in the const segment or m_buffer.

◆ front() [1/2]

template<size_t INTERNAL_SIZE = 32>
const_reference G3D::G3DString< INTERNAL_SIZE >::front ( ) const
inline

◆ front() [2/2]

template<size_t INTERNAL_SIZE = 32>
reference G3D::G3DString< INTERNAL_SIZE >::front ( size_t  x)
inline

◆ inBuffer() [1/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::inBuffer ( const char *  ptr) const
inlineprotected

◆ inBuffer() [2/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::inBuffer ( ) const
inlineprotected

◆ inConst() [1/2]

template<size_t INTERNAL_SIZE = 32>
static bool G3D::G3DString< INTERNAL_SIZE >::inConst ( const char *  ptr)
inlinestaticprotected

◆ inConst() [2/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::inConst ( ) const
inlineprotected

Optimized to assume the invariant holds and only check m_allocated.

◆ insert() [1/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::insert ( size_t  pos,
const G3DString< INTERNAL_SIZE > &  str,
size_t  subpos,
size_t  sublen 
)
inline

◆ insert() [2/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::insert ( size_t  pos,
const G3DString< INTERNAL_SIZE > &  str 
)
inline

◆ insert() [3/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::insert ( size_t  pos,
const value_type c 
)
inline

◆ length()

template<size_t INTERNAL_SIZE = 32>
size_type G3D::G3DString< INTERNAL_SIZE >::length ( ) const
inline

◆ max_size()

template<size_t INTERNAL_SIZE = 32>
size_type G3D::G3DString< INTERNAL_SIZE >::max_size ( ) const
inline

◆ maybeDeallocate()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::maybeDeallocate ( )
inlineprotected

◆ memcpy()

template<size_t INTERNAL_SIZE = 32>
static void G3D::G3DString< INTERNAL_SIZE >::memcpy ( void *  dst,
const void *  src,
size_t  len 
)
inlinestaticprotected

◆ memcpyBuffer()

template<size_t INTERNAL_SIZE = 32>
static void G3D::G3DString< INTERNAL_SIZE >::memcpyBuffer ( void *  dst,
const void *  src 
)
inlinestaticprotected

Copies from one m_data to another where both are in the m_buffer of the corresponding string and have 16-byte alignment.

◆ operator!=() [1/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator!= ( const G3DString< INTERNAL_SIZE > &  s) const
inline

◆ operator!=() [2/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator!= ( const value_type c) const
inline

◆ operator+() [1/3]

template<size_t INTERNAL_SIZE = 32>
G3DString G3D::G3DString< INTERNAL_SIZE >::operator+ ( const G3DString< INTERNAL_SIZE > &  s) const
inline

◆ operator+() [2/3]

template<size_t INTERNAL_SIZE = 32>
G3DString G3D::G3DString< INTERNAL_SIZE >::operator+ ( const value_type c) const
inline

◆ operator+() [3/3]

template<size_t INTERNAL_SIZE = 32>
G3DString G3D::G3DString< INTERNAL_SIZE >::operator+ ( const value_type  c) const
inline

◆ operator+=() [1/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator+= ( const G3DString< INTERNAL_SIZE > &  s)
inline

◆ operator+=() [2/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator+= ( const value_type  c)
inline

◆ operator+=() [3/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator+= ( const value_type c)
inline

◆ operator<()

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator< ( const G3DString< INTERNAL_SIZE > &  s) const
inline

◆ operator=() [1/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator= ( const value_type c)
inline

◆ operator=() [2/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator= ( const G3DString< INTERNAL_SIZE > &  s)
inline

◆ operator=() [3/3]

template<size_t INTERNAL_SIZE = 32>
G3DString& G3D::G3DString< INTERNAL_SIZE >::operator= ( G3DString< INTERNAL_SIZE > &&  s)
inline

◆ operator==() [1/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator== ( const G3DString< INTERNAL_SIZE > &  s) const
inline

◆ operator==() [2/2]

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator== ( const value_type c) const
inline

◆ operator>()

template<size_t INTERNAL_SIZE = 32>
bool G3D::G3DString< INTERNAL_SIZE >::operator> ( const G3DString< INTERNAL_SIZE > &  s) const
inline

◆ operator[]() [1/2]

template<size_t INTERNAL_SIZE = 32>
const_reference G3D::G3DString< INTERNAL_SIZE >::operator[] ( size_t  x) const
inline

◆ operator[]() [2/2]

template<size_t INTERNAL_SIZE = 32>
reference G3D::G3DString< INTERNAL_SIZE >::operator[] ( size_t  x)
inline

◆ prepareToMutate()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::prepareToMutate ( )
inlineprotected

◆ push_back()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::push_back ( value_type  c)
inline

◆ reserve()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::reserve ( size_t  newLength)
inline

◆ rfind() [1/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::rfind ( const G3DString< INTERNAL_SIZE > &  str,
size_t  pos = npos 
) const
inline

◆ rfind() [2/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::rfind ( const char *  s,
size_t  pos = npos 
) const
inline

◆ rfind() [3/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::rfind ( const char *  s,
size_t  pos,
size_t  n 
) const
inline

◆ rfind() [4/4]

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::rfind ( char  c,
size_t  pos = npos 
) const
inline

◆ size()

template<size_t INTERNAL_SIZE = 32>
size_type G3D::G3DString< INTERNAL_SIZE >::size ( ) const
inline

◆ substr()

template<size_t INTERNAL_SIZE = 32>
G3DString G3D::G3DString< INTERNAL_SIZE >::substr ( size_t  pos = 0,
size_t  len = npos 
) const
inline

◆ testInvariants()

template<size_t INTERNAL_SIZE = 32>
void G3D::G3DString< INTERNAL_SIZE >::testInvariants ( ) const
inlineprotected

Member Data Documentation

◆ m_allocated

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::m_allocated
protected

Total size of m_data, including '\0'...

or 0 if m_data is in a const segment. If m_data is a pointer into m_buffer, then m_allocated will be INTERNAL_SIZE.

Referenced by G3D::G3DString< INTERNAL_SIZE >::assign().

◆ m_buffer

template<size_t INTERNAL_SIZE = 32>
char G3D::G3DString< INTERNAL_SIZE >::m_buffer[INTERNAL_SIZE+MAX_ALIGNMENT_PADDING]
protected

This inline storage is used when strings are small.

Only INTERNAL_SIZE bytes are used, but m_data may point up to MAX_ALIGNMENT_PADDING bytes into this array to ensure 16-byte (SSE) alignment. Note that the m_buffer array must appear first in the String class to match the allocator's guaranteed 8-byte alignment, reducing the alignment that each instance is required to perform.

◆ m_data

template<size_t INTERNAL_SIZE = 32>
value_type* G3D::G3DString< INTERNAL_SIZE >::m_data
protected

◆ m_length

template<size_t INTERNAL_SIZE = 32>
size_t G3D::G3DString< INTERNAL_SIZE >::m_length
protected

◆ npos

template<size_t INTERNAL_SIZE = 32>
const size_type G3D::G3DString< INTERNAL_SIZE >::npos = size_type(-1)
static

documentation generated on Wed Nov 24 2021 08:01:55 using doxygen 1.8.15