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.

93 lines
2.0 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. CLSTRING.H
  5. History:
  6. --*/
  7. #ifndef CLSTRING_H
  8. #define CLSTRING_H
  9. #pragma warning(disable : 4275)
  10. class LTAPIENTRY CLString : public CString
  11. {
  12. public:
  13. CLString();
  14. CLString(const CLString& stringSrc);
  15. CLString(TCHAR ch, int nRepeat = 1);
  16. CLString(LPCSTR lpsz);
  17. CLString(LPCTSTR lpch, int nLength);
  18. CLString(const unsigned char* psz);
  19. CLString(HINSTANCE, UINT);
  20. BOOL ReplaceAll(LPCTSTR lpszFind, LPCTSTR lpszReplace, BOOL bMatchCase);
  21. // overloaded assignment
  22. NOTHROW const CLString& operator=(const CString& stringSrc);
  23. NOTHROW const CLString& operator=(TCHAR ch);
  24. #ifdef _UNICODE
  25. NOTHROW const CLString& operator=(char ch);
  26. #endif
  27. NOTHROW const CLString& operator=(LPCSTR lpsz);
  28. NOTHROW const CLString& operator=(const unsigned char* psz);
  29. // string concatenation
  30. NOTHROW const CLString& operator+=(const CString &);
  31. NOTHROW const CLString& operator+=(TCHAR ch);
  32. #ifdef _UNICODE
  33. NOTHROW const CLString& operator+=(char ch);
  34. #endif
  35. NOTHROW const CLString& operator+=(LPCTSTR lpsz);
  36. CLString operator+(const CString &) const;
  37. CLString operator+(LPCTSTR sz) const;
  38. NOTHROW BOOL LoadString(HMODULE, UINT nId);
  39. //
  40. // The following were copied from CString so we can
  41. // 'overload' them.
  42. NOTHROW void Format(LPCTSTR lpszFormat, ...);
  43. NOTHROW void Format(HMODULE, UINT nFormatID, ...);
  44. enum ECRLF
  45. {
  46. eNone = 0,
  47. eCR = 0x0001, // '\r'
  48. eLF = 0x0002, // '\n'
  49. eAll = eCR | eLF
  50. };
  51. void FixCRLF(UINT nCRLF, LPCTSTR pszIndent = NULL);
  52. DEBUGONLY(~CLString());
  53. protected:
  54. private:
  55. DEBUGONLY(static CCounter m_UsageCounter);
  56. //
  57. // Evil! Implicit Unicode conversions!
  58. CLString(LPCWSTR lpsz);
  59. NOTHROW const CLString& operator=(LPCWSTR lpsz);
  60. BSTR AllocSysString() const;
  61. BSTR SetSysString(BSTR* pbstr) const;
  62. };
  63. #pragma warning(default : 4275)
  64. #if !defined(_DEBUG) || defined(IMPLEMENT)
  65. #include "clstring.inl"
  66. #endif
  67. #endif