Windows NT 4.0 source code leak
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.

63 lines
1.6 KiB

4 years ago
  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 1994.
  5. //
  6. // File: szbuffer.h
  7. //
  8. // Contents: simple class for a string buffer that dynamically reallocates
  9. // space for itself as necessary
  10. //
  11. // Classes: CSzBuffer
  12. //
  13. // History: 4-22-96 stevebl Created
  14. //
  15. //----------------------------------------------------------------------------
  16. #ifndef CSZBUFFER
  17. #define CSZBUFFER
  18. //+---------------------------------------------------------------------------
  19. //
  20. // Class: CSzBuffer
  21. //
  22. // Purpose: string buffer that automatically allocates space as needed
  23. //
  24. // Interface: Set -- resets buffer to new string
  25. // Append -- adds string (or number) to end of data
  26. // Prepend -- adds string (or number) to front of data
  27. // GetData -- gets pointer to string buffer
  28. // GetLength -- gets length of string in buffer (in chars)
  29. //
  30. // History: 4-22-96 stevebl Created
  31. //
  32. //----------------------------------------------------------------------------
  33. class CSzBuffer
  34. {
  35. public:
  36. CSzBuffer(const char * sz);
  37. CSzBuffer();
  38. ~CSzBuffer();
  39. void Set(const char * sz);
  40. void Append(const char * sz);
  41. void Prepend(const char * sz);
  42. void Append(const long l);
  43. void Prepend(const long l);
  44. char * GetData();
  45. int GetLength();
  46. operator char *()
  47. {
  48. return GetData();
  49. };
  50. private:
  51. int cchLength;
  52. int cchBufSize;
  53. char * szData;
  54. };
  55. #endif