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.

55 lines
1.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1997 - 1997
  6. //
  7. // File: zstr.h
  8. //
  9. //--------------------------------------------------------------------------
  10. //
  11. // ZSTR.H: String management
  12. //
  13. #ifndef _ZSTR_H_
  14. #define _ZSTR_H_
  15. #include <string> // STL string class
  16. #include "basics.h"
  17. ////////////////////////////////////////////////////////////////////
  18. // class ZSTR
  19. //
  20. // simple string providing normally expected function
  21. ////////////////////////////////////////////////////////////////////
  22. class ZSTR : public string
  23. {
  24. public:
  25. ZSTR ( SZC szc = NULL )
  26. : string(szc == NULL ? "" : szc)
  27. {}
  28. SZC Szc() const
  29. { return c_str(); }
  30. inline operator SZC () const
  31. { return Szc(); }
  32. void Reset ()
  33. { resize(0); }
  34. ZSTR & operator = ( SZC szc )
  35. {
  36. Reset();
  37. string::operator=(szc);
  38. return *this;
  39. }
  40. void FormatAppend ( SZC szcFmt, ... );
  41. void Format ( SZC szcFmt, ... );
  42. void Vsprintf ( SZC szcFmt, va_list valist );
  43. };
  44. DEFINEV(ZSTR);
  45. DEFINEV(VZSTR);
  46. // end of ZSTR.H
  47. #endif