AUI Framework
master
Cross-platform module-based framework for developing C++20 desktop applications
ISeekableInputStream.h
1
#pragma once
2
3
#include "IInputStream.h"
4
9
class
ISeekableInputStream
:
public
IInputStream
{
10
public
:
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
};
IInputStream
Represents an input stream.
Definition:
IInputStream.h:26
ISeekableInputStream
Represents an input stream with updating reading position.
Definition:
ISeekableInputStream.h:9
ISeekableInputStream::tell
virtual size_t tell()=0
return current reading position
ISeekableInputStream::fileSize
size_t fileSize()
return size of the stream
Definition:
ISeekableInputStream.h:34
ISeekableInputStream::isEof
virtual bool isEof()=0
returns true if end of stream has been reached
ISeekableInputStream::seek
virtual void seek(std::streamoff offset, std::ios::seekdir seekDir)=0
change reading position, a way of changing depends on seekDir parameter