Torque2D Reference
Loading...
Searching...
No Matches
StringBuffer Class Reference

#include <stringBuffer.h>

Classes

struct  RequestCounts

Public Member Functions

 StringBuffer ()
 StringBuffer (const StringBuffer &copy)
 Copy constructor. Very important.
 StringBuffer (const StringBuffer *in)
 StringBuffer (const UTF8 *in)
 StringBuffer (const UTF16 *in)
 StringBuffer (const UTF8 *in, bool bNoConvert)
 ~StringBuffer ()
void append (const StringBuffer &in)
void append (const UTF8 *in)
void append (const UTF16 *in)
void append (const UTF16 *in, U32 len)
StringBufferoperator= (const StringBuffer &inc)
void insert (const U32 charOffset, const StringBuffer &in)
void insert (const U32 charOffset, const UTF8 *in)
void insert (const U32 charOffset, const UTF16 *in)
void insert (const U32 charOffset, const UTF16 *in, const U32 len)
StringBuffer substring (const U32 start, const U32 len) const
UTF8 * createSubstring8 (const U32 start, const U32 len) const
UTF16 * createSubstring16 (const U32 start, const U32 len) const
void cut (const U32 start, const U32 len)
const UTF16 getChar (const U32 offset) const
void setChar (const U32 offset, UTF16 c)
void set (const StringBuffer *in)
void set (const UTF8 *in)
void set (const UTF16 *in)
void setNoConvert (const UTF8 *in)
const U32 length () const
const U32 getUTF8BufferSizeEstimate () const
void getCopy8 (UTF8 *buff, const U32 buffSize) const
void getCopy (UTF16 *buff, const U32 buffSize) const
UTF8 * createCopy8 () const
UTF16 * createCopy () const
const UTF16 * getPtr () const
const UTF8 * getPtr8 ()

Public Attributes

RequestCountsrc

Detailed Description

Utility class to wrap string manipulation in a representation independent way.

Length does NOT include the null terminator.

Constructor & Destructor Documentation

◆ StringBuffer() [1/6]

◆ StringBuffer() [2/6]

StringBuffer ( const StringBuffer & copy)

Copy constructor. Very important.

◆ StringBuffer() [3/6]

StringBuffer ( const StringBuffer * in)

◆ StringBuffer() [4/6]

StringBuffer ( const UTF8 * in)

◆ StringBuffer() [5/6]

StringBuffer ( const UTF16 * in)

◆ StringBuffer() [6/6]

StringBuffer ( const UTF8 * in,
bool bNoConvert )

◆ ~StringBuffer()

Member Function Documentation

◆ append() [1/4]

void append ( const StringBuffer & in)

◆ append() [2/4]

void append ( const UTF16 * in)

◆ append() [3/4]

void append ( const UTF16 * in,
U32 len )

◆ append() [4/4]

void append ( const UTF8 * in)

◆ createCopy()

UTF16 * createCopy ( ) const

◆ createCopy8()

UTF8 * createCopy8 ( ) const

Get a copy of the contents of the string buffer. You must delete[] the returned copy when you are done with it. This follows the "create rule".

◆ createSubstring16()

UTF16 * createSubstring16 ( const U32 start,
const U32 len ) const

◆ createSubstring8()

UTF8 * createSubstring8 ( const U32 start,
const U32 len ) const

Get a pointer to a substring of length 'len' starting from 'start'. Returns a raw pointer to a unicode string. You must delete[] the returned string when you are done with it. This follows the "create rule".

◆ cut()

void cut ( const U32 start,
const U32 len )

◆ getChar()

const UTF16 getChar ( const U32 offset) const

◆ getCopy()

void getCopy ( UTF16 * buff,
const U32 buffSize ) const

◆ getCopy8()

void getCopy8 ( UTF8 * buff,
const U32 buffSize ) const

◆ getPtr()

const UTF16 * getPtr ( ) const

Get a pointer to the StringBuffer's data store. Use this in situations where you can be sure that the StringBuffer will not be modified out from under you. The win here is, you avoid yet another data copy. Data copy is slow on most modern hardware.

◆ getPtr8()

const UTF8 * getPtr8 ( )

◆ getUTF8BufferSizeEstimate()

const U32 getUTF8BufferSizeEstimate ( ) const
inline

Get an upper bound size estimate for a UTF8 buffer to hold this string.

◆ insert() [1/4]

void insert ( const U32 charOffset,
const StringBuffer & in )

◆ insert() [2/4]

void insert ( const U32 charOffset,
const UTF16 * in )

◆ insert() [3/4]

void insert ( const U32 charOffset,
const UTF16 * in,
const U32 len )

◆ insert() [4/4]

void insert ( const U32 charOffset,
const UTF8 * in )

◆ length()

const U32 length ( ) const
inline

◆ operator=()

StringBuffer & operator= ( const StringBuffer & inc)

◆ set() [1/3]

void set ( const StringBuffer * in)

◆ set() [2/3]

void set ( const UTF16 * in)

◆ set() [3/3]

void set ( const UTF8 * in)

◆ setChar()

void setChar ( const U32 offset,
UTF16 c )

◆ setNoConvert()

void setNoConvert ( const UTF8 * in)

◆ substring()

StringBuffer substring ( const U32 start,
const U32 len ) const

Get a StringBuffer substring of length 'len' starting from 'start'. Returns a new StringBuffer by value;

Member Data Documentation

◆ rc


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