MemoryStream.cpp 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. //
  2. // MemoryStream.cpp
  3. //
  4. // $Id: //poco/1.4/Foundation/src/MemoryStream.cpp#1 $
  5. //
  6. // Library: Foundation
  7. // Package: Streams
  8. // Module: MemoryStream
  9. //
  10. // Copyright (c) 2009, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #include "Poco/MemoryStream.h"
  16. namespace Poco {
  17. MemoryIOS::MemoryIOS(char* pBuffer, std::streamsize bufferSize):
  18. _buf(pBuffer, bufferSize)
  19. {
  20. poco_ios_init(&_buf);
  21. }
  22. MemoryIOS::~MemoryIOS()
  23. {
  24. }
  25. MemoryInputStream::MemoryInputStream(const char* pBuffer, std::streamsize bufferSize):
  26. MemoryIOS(const_cast<char*>(pBuffer), bufferSize),
  27. std::istream(&_buf)
  28. {
  29. }
  30. MemoryInputStream::~MemoryInputStream()
  31. {
  32. }
  33. MemoryOutputStream::MemoryOutputStream(char* pBuffer, std::streamsize bufferSize):
  34. MemoryIOS(pBuffer, bufferSize),
  35. std::ostream(&_buf)
  36. {
  37. }
  38. MemoryOutputStream::~MemoryOutputStream()
  39. {
  40. }
  41. } // namespace Poco