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.

36 lines
1001 B

  1. #ifndef __MULTISTR_H
  2. #define __MULTISTR_H
  3. #include "simarray.h"
  4. #include "simstr.h"
  5. // Must be instantiated with an instance of CSimpleStringBase
  6. template <class T, class M>
  7. class CMultiStringBase : public CSimpleDynamicArray<M>
  8. {
  9. public:
  10. CMultiStringBase( const CMultiStringBase &other )
  11. {
  12. Append(other);
  13. }
  14. CMultiStringBase( const T *pstrMultiString = NULL )
  15. {
  16. for (T *pstrCurrent = const_cast<T*>(pstrMultiString); pstrCurrent && *pstrCurrent; pstrCurrent += M(pstrCurrent).Length() + 1)
  17. Append(pstrCurrent);
  18. }
  19. virtual ~CMultiStringBase(void)
  20. {
  21. }
  22. CMultiStringBase &operator=( const CMultiStringBase &other )
  23. {
  24. Destroy();
  25. Append(other);
  26. return (*this);
  27. }
  28. };
  29. typedef CMultiStringBase<TCHAR,CSimpleString> CMultiString;
  30. typedef CMultiStringBase<WCHAR,CSimpleStringWide> CMultiStringWide;
  31. typedef CMultiStringBase<CHAR,CSimpleStringAnsi> CMultiStringAnsi;
  32. #endif