Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

251 lines
3.1 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. CLSTRING.INL
  5. History:
  6. --*/
  7. //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  8. //
  9. // All these methods re-direct to the CString methods.
  10. //
  11. //-----------------------------------------------------------------------------
  12. inline
  13. CLString::CLString()
  14. :
  15. CString()
  16. {
  17. DEBUGONLY(++m_UsageCounter);
  18. }
  19. inline
  20. CLString::CLString(
  21. const CLString &stringSrc)
  22. :
  23. CString(stringSrc)
  24. {
  25. DEBUGONLY(++m_UsageCounter);
  26. }
  27. inline
  28. CLString::CLString(
  29. TCHAR ch,
  30. int nRepeat)
  31. :
  32. CString(ch, nRepeat)
  33. {
  34. DEBUGONLY(++m_UsageCounter);
  35. }
  36. inline
  37. CLString::CLString(
  38. LPCSTR lpsz)
  39. :
  40. CString(lpsz)
  41. {
  42. DEBUGONLY(++m_UsageCounter);
  43. }
  44. inline
  45. CLString::CLString(
  46. LPCTSTR lpch,
  47. int nLength)
  48. :
  49. CString(lpch, nLength)
  50. {
  51. DEBUGONLY(++m_UsageCounter);
  52. }
  53. inline
  54. CLString::CLString(
  55. const unsigned char * psz)
  56. :
  57. CString(psz)
  58. {
  59. DEBUGONLY(++m_UsageCounter);
  60. }
  61. inline
  62. CLString::CLString(
  63. HINSTANCE hDll,
  64. UINT uiStringID)
  65. {
  66. LTVERIFY(LoadString(hDll, uiStringID));
  67. DEBUGONLY(++m_UsageCounter);
  68. }
  69. inline
  70. const CLString &
  71. CLString::operator=(
  72. const CString& stringSrc)
  73. {
  74. CString::operator=(stringSrc);
  75. return *this;
  76. }
  77. inline
  78. const CLString &
  79. CLString::operator=(
  80. TCHAR ch)
  81. {
  82. CString::operator=(ch);
  83. return *this;
  84. }
  85. #ifdef _UNICODE
  86. inline
  87. const CLString &
  88. CLString::operator=(
  89. char ch)
  90. {
  91. CString::operator=(ch);
  92. return *this;
  93. }
  94. #endif // _UNICODE
  95. inline
  96. const CLString &
  97. CLString::operator=(
  98. LPCSTR lpsz)
  99. {
  100. CString::operator=(lpsz);
  101. return *this;
  102. }
  103. inline
  104. const CLString &
  105. CLString::operator=(
  106. const unsigned char * psz)
  107. {
  108. CString::operator=(psz);
  109. return *this;
  110. }
  111. inline
  112. const CLString &
  113. CLString::operator+=(
  114. const CString & string)
  115. {
  116. CString::operator+=(string);
  117. return *this;
  118. }
  119. inline
  120. const CLString &
  121. CLString::operator+=(
  122. TCHAR ch)
  123. {
  124. CString::operator+=(ch);
  125. return *this;
  126. }
  127. #ifdef _UNICODE
  128. inline
  129. const CLString &
  130. CLString::operator+=(
  131. char ch)
  132. {
  133. CString::operator+=(ch);
  134. return *this;
  135. }
  136. #endif // _UNICODE
  137. inline
  138. const CLString &
  139. CLString::operator+=(
  140. LPCTSTR lpsz)
  141. {
  142. CString::operator+=(lpsz);
  143. return *this;
  144. }
  145. inline
  146. CLString
  147. CLString::operator+(
  148. const CString &str)
  149. const
  150. {
  151. return CLString(*this)+=str;
  152. }
  153. inline
  154. CLString
  155. CLString::operator+(
  156. const TCHAR *sz)
  157. const
  158. {
  159. return CLString(*this)+=sz;
  160. }
  161. inline
  162. void
  163. CLString::Format(
  164. LPCTSTR lpszFormat, ...)
  165. {
  166. //
  167. // This stolen from CString::Format()
  168. //
  169. va_list argList;
  170. va_start(argList, lpszFormat);
  171. FormatV(lpszFormat, argList);
  172. va_end(argList);
  173. }
  174. inline
  175. void
  176. CLString::Format(
  177. HMODULE hResourceModule,
  178. UINT nFormatID, ...)
  179. {
  180. CLString strFormat;
  181. strFormat.LoadString(hResourceModule, nFormatID);
  182. va_list argList;
  183. va_start(argList, nFormatID);
  184. FormatV(strFormat, argList);
  185. va_end(argList);
  186. }
  187. #ifdef _DEBUG
  188. inline
  189. CLString::~CLString()
  190. {
  191. DEBUGONLY(--m_UsageCounter);
  192. }
  193. #endif