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.

90 lines
2.2 KiB

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