vtdata library
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
vtString Class Reference

Public Member Functions

 vtString (const vtString &stringSrc)
 
 vtString (pcchar lpsz)
 
 vtString (const uchar *psz)
 
 vtString (pcchar lpch, int nLength)
 
int GetLength () const
 
bool IsEmpty () const
 
void Clear ()
 
char GetAt (int nIndex) const
 
const char & operator[] (int nIndex) const
 
char & operator[] (int nIndex)
 
void SetAt (int nIndex, char ch)
 
 operator pcchar () const
 
const vtStringoperator= (const vtString &stringSrc)
 
const vtStringoperator= (pcchar lpsz)
 
const vtStringoperator= (const uchar *psz)
 
const vtStringoperator+= (pcchar lpsz)
 
const vtStringoperator+= (const vtString &string)
 
const vtStringoperator+= (char ch)
 
void Concat (pcchar buffer, size_t length)
 
int Compare (pcchar lpsz) const
 
int CompareNoCase (pcchar lpsz) const
 
bool IsNumber () const
 
bool Matches (pcchar lpsz) const
 
vtString Mid (int nFirst, int nCount) const
 
vtString Mid (int nFirst) const
 
vtString Left (int nCount) const
 
vtString Right (int nCount) const
 
void MakeUpper ()
 
void MakeLower ()
 
void MakeReverse ()
 
void TrimRight ()
 
void TrimLeft ()
 
int Find (char ch) const
 
int ReverseFind (char ch) const
 
int Find (char ch, int nStart) const
 
int FindOneOf (pcchar lpszCharSet) const
 
int Find (pcchar szSub) const
 
int Find (pcchar szSub, int nStart) const
 
int Replace (char chOld, char chNew)
 
int Replace (const char *strOld, const char *strNew, bool bReplaceAll=false)
 
int Remove (char chRemove)
 
int Insert (int nIndex, char ch)
 
int Insert (int nIndex, pcchar pstr)
 
int Delete (int nIndex, int nCount=1)
 
void WIN_UNIX_CDECL Format (pcchar lpszFormat,...)
 
void FormatV (pcchar lpszFormat, va_list argList)
 
void FormatForURL (const char *szInput)
 
vtString FormatForURL () const
 
void WIN_UNIX_CDECL FormatMessage (pcchar lpszFormat,...)
 
pchar GetBuffer (int nMinBufLength)
 
void ReleaseBuffer (int nNewLength=-1)
 
pchar GetBufferSetLength (int nNewLength)
 
void FreeExtra ()
 
pchar LockBuffer ()
 
void UnlockBuffer ()
 
wstring2 UTF8ToWideString ()
 
vtString UTF8ToLocal ()
 
int GetAllocLength () const
 

Protected Member Functions

vtStringData * GetData () const
 
void Init ()
 
void AllocCopy (vtString &dest, int nCopyLen, int nCopyIndex, int nExtraLen) const
 
void AllocBuffer (int nLen)
 
void AssignCopy (int nSrcLen, pcchar szSrcData)
 
void ConcatCopy (int nSrc1Len, pcchar szSrc1Data, int nSrc2Len, pcchar szSrc2Data)
 
void ConcatInPlace (int nSrcLen, pcchar szSrcData)
 
void CopyBeforeWrite ()
 
void AllocBeforeWrite (int nLen)
 
void Release ()
 

Static Protected Member Functions

static void Release (vtStringData *pData)
 
static size_t SafeStrlen (pcchar lpsz)
 
static void FreeData (vtStringData *pData)
 

Protected Attributes

pchar m_pchData
 

Friends

vtString operator+ (const vtString &string1, const vtString &string2)
 
vtString operator+ (const vtString &string, char ch)
 
vtString operator+ (char ch, const vtString &string)
 
vtString operator+ (const vtString &string, pcchar lpsz)
 
vtString operator+ (pcchar lpsz, const vtString &string)
 

Detailed Description

This class encapsulates a simple string, much like the 'CString' of MFC, or the 'wxString' of wxWidgets.

Member Function Documentation

vtString vtString::UTF8ToLocal ( )

For a vtString which contains a UTF-8 encoded string, attempt to convert it to a string in the local (current locale) character set.