Source code of Windows XP (NT5)
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.

49 lines
833 B

  1. // mystring.h
  2. //
  3. // Programmer: Carmen Sarro
  4. // Copyright (c) Microsoft Corporation, 1997
  5. //
  6. // Microsoft Technical Education
  7. // C++ Programming
  8. // Lab 1
  9. #ifndef MYSTRING_H_
  10. #define MYSTRING_H_
  11. const MAX_LEN = 100;
  12. #if DBG
  13. void TraceMsg(PCWSTR szFormat, ...);
  14. #else
  15. inline void TraceMsg(PCWSTR szFormat, ...) {}
  16. #endif
  17. class MyString
  18. {
  19. private:
  20. int m_len;
  21. wchar_t data[MAX_LEN];
  22. public:
  23. MyString();
  24. MyString(wchar_t *str);
  25. MyString(const MyString &);
  26. const MyString& operator= (PCWSTR lp);
  27. const MyString& operator= (const MyString& MyStr);
  28. BOOLEAN append(const wchar_t* str);
  29. void append(MyString str);
  30. int len();
  31. const wchar_t* wcharptr();
  32. const wchar_t* c_str() const;
  33. void Zero();
  34. void NullTerminate();
  35. };
  36. int compare(MyString first, MyString second);
  37. #endif