OnixS CME Drop Copy Handler C++ library  5.6.0
API documentation
String Class Reference

#include <OnixS/CME/DropCopy/String.h>

Public Types

typedef char * iterator
 
typedef const char * ConstIterator
 

Public Member Functions

 String ()
 
 String (const String &other)
 
 String (const StringRef &strRef)
 
 String (const std::string &stdStr)
 
 String (const char *cStr)
 
 String (const char *text, size_t textSize)
 
 ~String ()
 
bool empty () const
 
size_t size () const
 
size_t capacity () const
 
const char * data () const
 
const char * c_str () const
 
iterator begin ()
 
ConstIterator begin () const
 
iterator end ()
 
ConstIterator end () const
 
char & operator[] (size_t index)
 
const char & operator[] (size_t index) const
 
char & at (size_t index)
 
const char & at (size_t index) const
 
void reserve (size_t capacity)
 
void resize (size_t size)
 
void resize (size_t size, char filler)
 
Stringinsert (size_t offset, const char *text, size_t textSize)
 
Stringappend (const char *text, size_t textSize)
 
Stringassign (const char *text, size_t textSize)
 
Stringreplace (size_t offset, size_t count, const char *text, size_t textSize)
 
void erase (size_t offset, size_t count)
 
void clear ()
 
 operator std::string () const
 
bool operator== (const String &other) const
 
bool operator!= (const String &other) const
 
Stringoperator= (const String &other)
 
Stringoperator= (const std::string &other)
 
Stringoperator= (const char *other)
 
Stringoperator= (char other)
 
Stringoperator+= (const String &text)
 
Stringoperator+= (const char *text)
 
Stringoperator+= (const std::string &text)
 
Stringoperator+= (char character)
 

Detailed Description

Definition at line 35 of file String.h.

Member Typedef Documentation

typedef const char* ConstIterator

Read-only access over characters.

Definition at line 42 of file String.h.

typedef char* iterator

Read-write access over characters.

Definition at line 39 of file String.h.

Constructor & Destructor Documentation

String ( )

Initializes empty string.

String ( const String other)

Initializes as copy of another instance.

String ( const StringRef strRef)
explicit

Initializes as copy of what is referred by StringRef instance.

String ( const std::string &  stdStr)
explicit

Initializes as copy of std::string instance.

String ( const char *  cStr)
explicit

Initializes as copy of null-terminated C string.

String ( const char *  text,
size_t  textSize 
)

Initializes from sequence of give size.

~String ( )

Cleans up internal resources.

Member Function Documentation

String& append ( const char *  text,
size_t  textSize 
)

Appends subsequence to the end.

String& assign ( const char *  text,
size_t  textSize 
)

Re-initializes instance with given string.

char & at ( size_t  index)
inline

Provides safe access to the character via its reference located at specified index.

Definition at line 251 of file String.h.

const char & at ( size_t  index) const
inline

Provides safe access to the character via its reference located at specified index.

Definition at line 259 of file String.h.

String::iterator begin ( )
inline

Points to the first element in the sequence.

Definition at line 221 of file String.h.

String::ConstIterator begin ( ) const
inline

Points to the first element in the sequence.

Definition at line 226 of file String.h.

const char * c_str ( ) const
inline

Returns string as C string.

Definition at line 216 of file String.h.

size_t capacity ( ) const
inline

Number of characters that can be put into sequence without reallocating internal store.

Definition at line 206 of file String.h.

void clear ( )

Erases all characters in the string.

const char * data ( ) const
inline

Direct read-only access to buffer which holds the sequence.

Definition at line 211 of file String.h.

bool empty ( ) const
inline

Indicates whether sequence is empty.

Definition at line 196 of file String.h.

String::iterator end ( )
inline

Points to the location succeeding the last element in the sequence.

Definition at line 231 of file String.h.

String::ConstIterator end ( ) const
inline

Points to the location succeeding the last element in the sequence.

Definition at line 236 of file String.h.

void erase ( size_t  offset,
size_t  count 
)

Erases subsequence of specified length at specified position.

String& insert ( size_t  offset,
const char *  text,
size_t  textSize 
)

Inserts subsequence at specified position.

operator std::string ( ) const
inline

Implicit conversion to std::string type.

Definition at line 267 of file String.h.

bool operator!= ( const String other) const

Compares with other instance for inequality.

String & operator+= ( const String text)
inline

Appends other string to the end.

Definition at line 290 of file String.h.

String & operator+= ( const char *  text)
inline

Appends other string to the end.

Definition at line 295 of file String.h.

String & operator+= ( const std::string &  text)
inline

Appends other string to the end.

Definition at line 303 of file String.h.

String & operator+= ( char  character)
inline

Appends other string to the end.

Definition at line 308 of file String.h.

String& operator= ( const String other)

Reinitializes instance as copy of another one.

String & operator= ( const std::string &  other)
inline

Reinitializes instance as copy of another one.

Definition at line 272 of file String.h.

String & operator= ( const char *  other)
inline

Reinitializes instance as copy of another one.

Definition at line 277 of file String.h.

String & operator= ( char  other)
inline

Reinitializes instance as copy of another one.

Definition at line 285 of file String.h.

bool operator== ( const String other) const

Compares with other instance for equality.

char & operator[] ( size_t  index)
inline

Reference to the character located at specified index.

Note
For a performance considerations does NOT check bounds of the character being accessed.

Definition at line 241 of file String.h.

const char & operator[] ( size_t  index) const
inline

Const reference to the character located at specified index.

Note
For a performance considerations does NOT check bounds of the character being accessed.

Definition at line 246 of file String.h.

String& replace ( size_t  offset,
size_t  count,
const char *  text,
size_t  textSize 
)

Replaces subsequence of specified length at specified position with the new subsequence.

void reserve ( size_t  capacity)

Makes internal store to be capable of storing at least specified number of characters without necessity to reallocate it.

void resize ( size_t  size)

Specifies new size for the sequence, appending or erasing elements as required.

void resize ( size_t  size,
char  filler 
)

Specifies new size for the sequence, appending or erasing elements as required.

size_t size ( ) const
inline

Number of characters in the sequence.

Definition at line 201 of file String.h.


The documentation for this class was generated from the following file: