CStream.h 987 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * CStream.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. 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. };