Dynamic string
![]() | ~VarStr ( void ) Destructor |
![]() | VarStr ( size_t capacity = 0, size_t increment = 0 ) Default constructor |
![]() | VarStr ( const char * ) Construct from a string |
![]() | VarStr ( const VarStr& ) Copy constructor |
![]() | () ( size_t index ) const Efficient array operator (const version): no bounds checking |
![]() | () ( size_t index ) Efficient array operator (non-const version): no bounds checking |
![]() | operator [] ( size_t index ) const Bounds-checking array operator (const version): throws sxBoundsError |
![]() | operator [] ( size_t index ) Bounds-checking array operator (non-const version): throws sxBoundsError |
![]() | operator char* () const Char conversion |
![]() | at ( size_t index ) Bounds-adjusting array operator |
![]() | length ( void ) const Returns current occupied length of array |
![]() | append ( const char ) Append method |
![]() | append ( unsigned char *buf, const int len ) Append method for binary data |
![]() | insert ( size_t count, size_t offset = 0, char c = ' ' ) Insert new array elements |
![]() | cut ( size_t count, size_t offset = 0 ) Remove array elements |
![]() | remove ( size_t offset, size_t count = 1 ) Removes the element specified by offset |
![]() | write ( ostream& _out ) const Write out the contents as a binary buffer |
![]() | clear ( void ) clear method |
![]() | data () const return the string itself |
![]() | empty () const return true if string is empty, false if not |
![]() | Assignment/copy operator
| ||||||||||||||||
![]() | Comparison operators
| ||||||||||||||||
![]() | String extension
| ||||||||||||||||
![]() | String extension
| ||||||||||||||||
![]() | Binary string extension, represented by operator "*="
|
Dynamic string. This is a template for a general-purpose dynamic string. The array grows automatically as needed, but reallocation occurs only when the length exceeds the capacity. The capacity is increased in large blocks, the size of which may be optimized. The public data member, increment_, specifies the amount by which the capacity is increased during reallocation. By default, increment_ is zero, which causes the capacity to double upon each reallocation. A non-zero increment_ is simply added to the capacity upon each reallocation. The capacity is extended by this amount or by whatever greater amount is necessary to accommodate the new length of the array.
VarStr( size_t capacity = 0, size_t increment = 0 )
VarStr( const char * )
VarStr( const VarStr& )
char operator ()( size_t index ) const
char& operator ()( size_t index )
char operator []( size_t index ) const
char& operator []( size_t index )
VarStr& operator *= ( const int16 )
VarStr& operator *= ( const uint16 )
VarStr& operator *= ( const int32 )
VarStr& operator *= ( const uint32 )
VarStr& operator *= ( const int64 )
VarStr& operator *= ( const uint64 )
operator char* () const
char& at( size_t index )
size_t length( void ) const
size_t append( const char )
size_t append( unsigned char *buf, const int len )
size_t insert( size_t count, size_t offset = 0, char c = ' ' )
size_t cut( size_t count, size_t offset = 0 )
void remove( size_t offset, size_t count = 1 )
cut(1, length-offset-1)
void write( ostream& _out ) const
void clear( void )
char* data() const
bool empty() const
alphabetic index hierarchy of classes