2
0

CStream.h 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. /*
  3. * CStream.h, part of VCMI engine
  4. *
  5. * Authors: listed in file AUTHORS in main folder
  6. *
  7. * License: GNU General Public License v2.0 or later
  8. * Full text of license available in license.txt file, in main folder
  9. *
  10. */
  11. class DLL_LINKAGE CStream : private boost::noncopyable
  12. {
  13. public:
  14. /**
  15. * D-tor.
  16. */
  17. virtual ~CStream() {}
  18. /**
  19. * Seeks to the specified position.
  20. *
  21. * @param position The position from the beginning.
  22. * @return the position actually moved to, -1 on error.
  23. */
  24. virtual si64 seek(si64 position) = 0;
  25. /**
  26. * Gets the current position in the stream.
  27. *
  28. * @return the position.
  29. */
  30. virtual si64 tell() = 0;
  31. /**
  32. * Relative seeks to the specified position.
  33. *
  34. * @param delta The count of bytes to seek from current position.
  35. * @return the count of bytes skipped actually.
  36. */
  37. virtual si64 skip(si64 delta) = 0;
  38. /**
  39. * Gets the length of the stream.
  40. *
  41. * @return the length in bytes
  42. */
  43. virtual si64 getSize() = 0;
  44. };