ScummVM API documentation
Bagel::CBofString Class Reference
Inheritance diagram for Bagel::CBofString:
Bagel::CBofObject

Public Member Functions

 CBofString ()
 
 CBofString (const char *pszBuf)
 
 CBofString (const CBofString &stringSrc)
 
 CBofString (char ch, int nRepeat=1)
 
 CBofString (int nLength)
 
 CBofString (char *pszBuff, int pszBuffLen)
 This modifies the passed source string to null terminate the substring. More...
 
virtual ~CBofString ()
 
int getBufferSize () const
 
int getLength () const
 
bool isEmpty () const
 
void free ()
 
void growTo (int nNewSize)
 
char getAt (int nIndex)
 
char operator[] (int nIndex)
 
 operator const char * () const
 
const char * getBuffer () const
 
int hash () const
 
void copy (const char *pszSourceBuf)
 
const CBofStringoperator= (const CBofString &cStringSrc)
 
const CBofStringoperator= (char ch)
 
const CBofStringoperator= (const char *psz)
 
const CBofStringoperator+= (const CBofString &cString)
 
const CBofStringoperator+= (char ch)
 
const CBofStringoperator+= (const char *psz)
 
int compare (const char *lpsz) const
 
int compareNoCase (const char *lpsz) const
 
CBofString mid (int nFirst, int nCount) const
 
CBofString mid (int nFirst) const
 
CBofString left (int nCount) const
 
CBofString right (int nCount) const
 
void deleteLastChar ()
 
void makeUpper ()
 
int find (const char *lpszSub) const
 
int findNumOccurrences (const char *pszSub)
 
void replaceCharAt (int, char)
 
void replaceChar (char chOld, char chNew)
 
void replaceStr (const char *pszOld, const char *pszNew)
 
char * getBuffer ()
 

Protected Member Functions

void init ()
 
void allocCopy (CBofString &dest, int nCopyLen, int nCopyIndex, int nExtraLen) const
 
void allocBuffer (int nLen)
 
void concatCopy (int nSrc1Len, const char *lpszSrc1Data, int nSrc2Len, const char *lpszSrc2Data, int nAllocLen=0)
 
void concatInPlace (int nSrcLen, const char *lpszSrcData)
 

Static Protected Member Functions

static int safeStrlen (const char *lpsz)
 

Protected Attributes

char * _pszData
 
uint16 _nLength
 
uint16 _nBufferSize
 

Friends

CBofString operator+ (const CBofString &string1, const CBofString &string2)
 
CBofString operator+ (const CBofString &string, char ch)
 
CBofString operator+ (char ch, const CBofString &string)
 
CBofString operator+ (const CBofString &string, const char *lpsz)
 
CBofString operator+ (const char *lpsz, const CBofString &string)
 

Additional Inherited Members

- Static Public Member Functions inherited from Bagel::CBofObject
static bool isValidObject (const CBofObject *pObject)
 

Constructor & Destructor Documentation

◆ CBofString() [1/6]

Bagel::CBofString::CBofString ( )

Default constructor

◆ CBofString() [2/6]

Bagel::CBofString::CBofString ( const char *  pszBuf)

Construct a string from a null terminated string

Parameters
pszBufSource string

◆ CBofString() [3/6]

Bagel::CBofString::CBofString ( const CBofString stringSrc)

Construct a string based on a source string

◆ CBofString() [4/6]

Bagel::CBofString::CBofString ( char  ch,
int  nRepeat = 1 
)

Construct a string with a single character repeated a number of times

Parameters
chCharacter to use
nRepeatNumber of repeats

◆ CBofString() [5/6]

Bagel::CBofString::CBofString ( int  nLength)

Constructs a string, and sets initial buffer size

Parameters
nLengthString length

◆ CBofString() [6/6]

Bagel::CBofString::CBofString ( char *  pszBuff,
int  pszBuffLen 
)

This modifies the passed source string to null terminate the substring.

Construct a string based on a subset of a passed null terminated string

Parameters
pszBuffSource string
pszBuffLenSubstring length

◆ ~CBofString()

virtual Bagel::CBofString::~CBofString ( )
virtual

Destructor

Member Function Documentation

◆ free()

void Bagel::CBofString::free ( )

De-Allocates internal buffer for current CBofString

◆ copy()

void Bagel::CBofString::copy ( const char *  pszSourceBuf)

Copies specified string into current CBofString

Parameters
pszSourceBufBuffer to copy

◆ init()

void Bagel::CBofString::init ( )
protected

initialize current CBofString members

◆ allocCopy()

void Bagel::CBofString::allocCopy ( CBofString dest,
int  nCopyLen,
int  nCopyIndex,
int  nExtraLen 
) const
protected

Allocates specified string into specified destination

◆ allocBuffer()

void Bagel::CBofString::allocBuffer ( int  nLen)
protected

Allocates internal buffer for current CBofString

Parameters
nLenInitial buffer size

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