stringBuilder.h 540 B

12345678910111213141516171819202122232425262728293031
  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