COutputStream.h 800 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * COutputStream.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CStream.h"
  12. VCMI_LIB_NAMESPACE_BEGIN
  13. /**
  14. * Abstract class which provides method definitions for writing into a stream.
  15. */
  16. class DLL_LINKAGE COutputStream : public virtual CStream
  17. {
  18. public:
  19. /**
  20. * D-tor.
  21. */
  22. virtual ~COutputStream() {}
  23. /**
  24. * Write n bytes from the stream into the data buffer.
  25. *
  26. * @param data A pointer to the destination data array.
  27. * @param size The number of bytes to write.
  28. * @return the number of bytes written actually.
  29. */
  30. virtual si64 write(const ui8 * data, si64 size) = 0;
  31. };
  32. VCMI_LIB_NAMESPACE_END