stringBuilder.h 539 B

123456789101112131415161718192021222324252627282930
  1. #ifndef NULLSOFT_WINAMP_STRING_BUILDER_HEADER
  2. #define NULLSOFT_WINAMP_STRING_BUILDER_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <wtypes.h>
  7. class StringBuilder
  8. {
  9. public:
  10. StringBuilder();
  11. ~StringBuilder();
  12. public:
  13. HRESULT Allocate(size_t newSize);
  14. void Clear(void);
  15. LPCWSTR Get(void);
  16. HRESULT Set(size_t index, WCHAR value);
  17. HRESULT Append(LPCWSTR pszString);
  18. protected:
  19. LPWSTR buffer;
  20. LPWSTR cursor;
  21. size_t allocated;
  22. size_t remaining;
  23. };
  24. #endif //NULLSOFT_WINAMP_STRING_BUILDER_HEADER