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.

53 lines
1.0 KiB

  1. /*++
  2. Copyright (C) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. TSTRING.H
  5. Abstract:
  6. Utility string class
  7. History:
  8. a-davj 1-July-97 Created.
  9. --*/
  10. #ifndef _TString_H_
  11. #define _TString_H_
  12. class TString
  13. {
  14. TCHAR *m_pString;
  15. TCHAR m_empty; // something to point at if memory alloc fails.
  16. int m_Size;
  17. void assign(const TCHAR * pSrc);
  18. public:
  19. TString();
  20. TString(const TCHAR *pSrc);
  21. TString& operator =(LPTSTR);
  22. #ifndef UNICODE
  23. TString& operator =(WCHAR *);
  24. #endif
  25. TString& operator =(const TString &);
  26. void Empty();
  27. ~TString() { Empty(); }
  28. TString& operator +=(TCHAR *);
  29. TString& operator +=(TCHAR tAdd);
  30. TCHAR GetAt(int iIndex);
  31. int Find(TCHAR cFind);
  32. operator TCHAR *() { return m_pString; }
  33. int Length() { return lstrlen(m_pString); }
  34. BOOL Equal(TCHAR *pTarget)
  35. { return lstrcmp(m_pString, pTarget) == 0; }
  36. BOOL EqualNoCase(TCHAR *pTarget)
  37. { return lstrcmpi(m_pString, pTarget) == 0; }
  38. };
  39. #endif