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.

86 lines
2.7 KiB

  1. // MultiStrZ.h -- Multiple String, zero-terminated class declaration.
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #if !defined(SLBCSP_MULTISTRZ_H)
  8. #define SLBCSP_MULTISTRZ_H
  9. #include "StdAfx.h"
  10. #include <string>
  11. #include <vector>
  12. // Represents a vector of strings as multiple zero-terminated strings
  13. // (C-style strings) in a data buffer. The last string in the buffer
  14. // terminated with two zeroes.
  15. class MultiStringZ
  16. {
  17. // TO DO: This class is incomplete, no comparison operators,
  18. // appending, clearing, etc.
  19. public:
  20. // Types
  21. // TO DO: What about supporting TCHAR?? Implement class as template?
  22. typedef char CharType;
  23. typedef std::string ValueType;
  24. typedef std::string::size_type SizeType;
  25. typedef CString csValueType;
  26. typedef size_t csSizeType;
  27. // C'tors/D'tors
  28. explicit
  29. MultiStringZ();
  30. explicit
  31. MultiStringZ(std::vector<ValueType> const &rvs);
  32. explicit
  33. MultiStringZ(std::vector<csValueType> const &rvs);
  34. virtual
  35. ~MultiStringZ();
  36. // Operators
  37. // Operations
  38. // Access
  39. CharType const *
  40. Data() const;
  41. SizeType
  42. Length() const;
  43. LPCTSTR
  44. csData() const;
  45. csSizeType
  46. csLength() const;
  47. // Predicates
  48. protected:
  49. // Types
  50. // C'tors/D'tors
  51. // Operators
  52. // Operations
  53. // Access
  54. // Predicates
  55. // Variables
  56. private:
  57. // Types
  58. // C'tors/D'tors
  59. // Operators
  60. // Operations
  61. // Access
  62. // Predicates
  63. // Variables
  64. ValueType m_Buffer;
  65. csValueType m_csBuffer;
  66. };
  67. #endif // SLBCSP_MULTISTRZ_H