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.

47 lines
1.3 KiB

  1. // The StringList class, purely a wrapper for CArray<CString>
  2. // History: a-jsari 10/7/97
  3. //
  4. // Copyright (c) 1998-1999 Microsoft Corporation
  5. #pragma once
  6. #include <afxtempl.h>
  7. /*
  8. * CStringValues - A place to store string values for value display.
  9. *
  10. * History: a-jsari 10/30/97 Initial version
  11. */
  12. class CStringValues {
  13. public:
  14. // 32 should be big enough . . .
  15. CStringValues(int wSize = 32) { SetSize(wSize); }
  16. CStringValues(const CStringValues &strList) { m_arStrings.Copy(strList.m_arStrings); }
  17. ~CStringValues() { }
  18. const CString &operator[](int iList) const { return (m_arStrings.GetData())[iList]; }
  19. CString &operator[](int iList) { return m_arStrings.ElementAt(iList); }
  20. void SetSize(int wSize) { m_arStrings.SetSize(wSize); }
  21. private:
  22. CArray<CString, CString &> m_arStrings;
  23. };
  24. /*
  25. * CDwordValues - A place to store unsigned values for value display
  26. *
  27. * History: a-jsari 12/16/97 Initial version
  28. */
  29. class CDwordValues {
  30. public:
  31. CDwordValues() { }
  32. CDwordValues(const CDwordValues &dwList) { m_arDword.Copy(dwList.m_arDword); }
  33. ~CDwordValues() { }
  34. // const DWORD &operator[](int iList) const { return (m_arDword.GetData())[iList]; }
  35. DWORD &operator[](int iList) { return m_arDword[iList]; }
  36. void SetSize(int wSize) { m_arDword.SetSize(wSize); }
  37. private:
  38. CArray<DWORD, DWORD &> m_arDword;
  39. };