AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
ISeekableInputStream.h
1#pragma once
2
3#include "IInputStream.h"
4
10public:
11 virtual ~ISeekableInputStream() = default;
12
16 virtual void seek(std::streamoff offset, std::ios::seekdir seekDir) = 0;
17
22 virtual size_t tell() = 0;
23
28 virtual bool isEof() = 0;
29
34 size_t fileSize() {
35 auto current = tell();
36 seek(0, std::ios::end);
37 auto size = tell();
38 seek(current, std::ios::beg);
39 return size;
40 }
41};
Represents an input stream.
Definition IInputStream.h:26
Represents an input stream with updating reading position.
Definition ISeekableInputStream.h:9
virtual size_t tell()=0
return current reading position
size_t fileSize()
return size of the stream
Definition ISeekableInputStream.h:34
virtual bool isEof()=0
returns true if end of stream has been reached
virtual void seek(std::streamoff offset, std::ios::seekdir seekDir)=0
change reading position, a way of changing depends on seekDir parameter