17 return (WCHAR
*)(this+1);
25 CHString(WCHAR ch
, int nRepeat
= 1) throw (CHeap_Exception
);
26 CHString(LPCWSTR lpsz
) throw (CHeap_Exception
);
27 CHString(LPCWSTR lpch
, int nLength
) throw (CHeap_Exception
);
28 CHString(LPCSTR lpsz
) throw (CHeap_Exception
);
29 CHString(const CHString
& stringSrc
);
30 CHString(const unsigned char* lpsz
);
33 BSTR
AllocSysString() const throw (CHeap_Exception
);
34 int Collate(LPCWSTR lpsz
) const;
35 int Compare(LPCWSTR lpsz
) const;
36 int CompareNoCase(LPCWSTR lpsz
) const;
38 int Find(WCHAR ch
) const;
39 int Find(LPCWSTR lpszSub
) const;
40 int FindOneOf(LPCWSTR lpszCharSet
) const;
41 void Format(UINT nFormatID
, ...) throw (CHeap_Exception
);
42 void Format(LPCWSTR lpszFormat
, ...) throw (CHeap_Exception
);
43 void FormatMessageW(UINT nFormatID
, ...) throw (CHeap_Exception
);
44 void FormatMessageW(LPCWSTR lpszFormat
, ...) throw (CHeap_Exception
);
45 void FormatV(LPCWSTR lpszFormat
, va_list argList
);
46 void FreeExtra() throw (CHeap_Exception
);
47 int GetAllocLength() const;
48 WCHAR
GetAt(int nIndex
) const;
49 LPWSTR
GetBuffer(int nMinBufLength
) throw (CHeap_Exception
);
50 LPWSTR
GetBufferSetLength(int nNewLength
) throw (CHeap_Exception
);
51 int GetLength() const;
53 CHString
Left(int nCount
) const throw (CHeap_Exception
);
54 int LoadStringW(UINT nID
) throw (CHeap_Exception
);
56 void MakeLower() throw (CHeap_Exception
);
57 void MakeReverse() throw (CHeap_Exception
);
58 void MakeUpper() throw (CHeap_Exception
);
59 CHString
Mid(int nFirst
) const throw (CHeap_Exception
);
60 CHString
Mid(int nFirst
, int nCount
) const throw (CHeap_Exception
);
61 void ReleaseBuffer(int nNewLength
= -1) throw (CHeap_Exception
);
62 int ReverseFind(WCHAR ch
) const;
63 CHString
Right(int nCount
) const throw (CHeap_Exception
);
64 void SetAt(int nIndex
, WCHAR ch
) throw (CHeap_Exception
);
65 CHString
SpanExcluding(LPCWSTR lpszCharSet
) const throw (CHeap_Exception
);
66 CHString
SpanIncluding(LPCWSTR lpszCharSet
) const throw (CHeap_Exception
);
67 void TrimLeft() throw (CHeap_Exception
);
68 void TrimRight() throw (CHeap_Exception
);
71 const CHString
& operator=(char ch
) throw (CHeap_Exception
);
72 const CHString
& operator=(WCHAR ch
) throw (CHeap_Exception
);
73 const CHString
& operator=(CHString
*p
) throw (CHeap_Exception
);
74 const CHString
& operator=(LPCSTR lpsz
) throw (CHeap_Exception
);
75 const CHString
& operator=(LPCWSTR lpsz
) throw (CHeap_Exception
);
76 const CHString
& operator=(const CHString
& stringSrc
) throw (CHeap_Exception
);
77 const CHString
& operator=(const unsigned char* lpsz
) throw (CHeap_Exception
);
79 const CHString
& operator+=(char ch
) throw (CHeap_Exception
);
80 const CHString
& operator+=(WCHAR ch
) throw (CHeap_Exception
);
81 const CHString
& operator+=(LPCWSTR lpsz
) throw (CHeap_Exception
);
82 const CHString
& operator+=(const CHString
& string
) throw (CHeap_Exception
);
84 WCHAR
operator[](int nIndex
) const;
86 operator LPCWSTR() const;
88 friend CHString WINAPI
operator+(WCHAR ch
, const CHString
& string
) throw (CHeap_Exception
);
89 friend CHString WINAPI
operator+(const CHString
& string
, WCHAR ch
) throw (CHeap_Exception
);
90 friend CHString WINAPI
operator+(const CHString
& string
, LPCWSTR lpsz
) throw (CHeap_Exception
);
91 friend CHString WINAPI
operator+(LPCWSTR lpsz
, const CHString
& string
) throw (CHeap_Exception
);
92 friend CHString WINAPI
operator+(const CHString
& string1
, const CHString
& string2
) throw (CHeap_Exception
);
97 void AllocBeforeWrite(int nLen
) throw (CHeap_Exception
);
98 void AllocBuffer(int nLen
) throw (CHeap_Exception
);
99 void AllocCopy(CHString
& dest
, int nCopyLen
, int nCopyIndex
, int nExtraLen
) const throw (CHeap_Exception
);
100 void AssignCopy(int nSrcLen
, LPCWSTR lpszSrcData
) throw (CHeap_Exception
);
101 void ConcatCopy(int nSrc1Len
, LPCWSTR lpszSrc1Data
, int nSrc2Len
, LPCWSTR lpszSrc2Data
) throw (CHeap_Exception
);
102 void ConcatInPlace(int nSrcLen
, LPCWSTR lpszSrcData
);
103 void CopyBeforeWrite() throw (CHeap_Exception
);
104 CHStringData
* GetData() const;
106 int LoadStringW(UINT nID
, LPWSTR lpszBuf
, UINT nMaxBuf
) throw (CHeap_Exception
);
108 static void WINAPI
Release(CHStringData
* pData
);
109 static int WINAPI
SafeStrlen(LPCWSTR lpsz
);
112 inline BOOL
operator==(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) == 0; }
113 inline BOOL
operator==(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) == 0; }
115 inline BOOL
operator!=(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) != 0; }
116 inline BOOL
operator!=(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) != 0; }
118 inline BOOL
operator<(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) < 0; }
119 inline BOOL
operator<(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) < 0; }
121 inline BOOL
operator>(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) > 0; }
122 inline BOOL
operator>(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) > 0; }
124 inline BOOL
operator<=(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) <= 0; }
125 inline BOOL
operator<=(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) <= 0; }
127 inline BOOL
operator>=(const CHString
& s1
, LPCWSTR s2
) { return s1
.Compare(s2
) >= 0; }
128 inline BOOL
operator>=(const CHString
& s1
, const CHString
& s2
) { return s1
.Compare(s2
) >= 0; }