diff --git a/Include/Aurora/Compression/ICompressionStream.hpp b/Include/Aurora/Compression/ICompressionStream.hpp index bb3a47c4..5ade6751 100644 --- a/Include/Aurora/Compression/ICompressionStream.hpp +++ b/Include/Aurora/Compression/ICompressionStream.hpp @@ -7,6 +7,10 @@ ***/ #pragma once +#include +#include +#include + namespace Aurora::Compression { struct ICompressionStream @@ -88,5 +92,11 @@ namespace Aurora::Compression * @return */ virtual IO::IStreamReader *ToStreamReader() = 0; + + /** + * @brief + * @return + */ + virtual IO::ISeekingReader *ToSeekingStreamReader() = 0; }; } \ No newline at end of file diff --git a/Source/Compression/AuBaseStream.cpp b/Source/Compression/AuBaseStream.cpp index 7fdfd8e0..e4ab7926 100644 --- a/Source/Compression/AuBaseStream.cpp +++ b/Source/Compression/AuBaseStream.cpp @@ -232,4 +232,9 @@ namespace Aurora::Compression { return &this->reader_; } + + IO::ISeekingReader *BaseStream::ToSeekingStreamReader() + { + return &this->reader2_; + } } \ No newline at end of file diff --git a/Source/Compression/AuBaseStream.hpp b/Source/Compression/AuBaseStream.hpp index a06f53eb..19aac8d5 100644 --- a/Source/Compression/AuBaseStream.hpp +++ b/Source/Compression/AuBaseStream.hpp @@ -19,7 +19,8 @@ namespace Aurora::Compression inline BaseStream(AuUInt32 bufferSize = 4096 * 64) : _outbufferOwned(bufferSize, true), uBufferSize_(bufferSize), - reader_(AuUnsafeRaiiToShared(this)) + reader_(AuUnsafeRaiiToShared(this)), + reader2_(AuUnsafeRaiiToShared(this)) { SetBuffer({}); } @@ -55,6 +56,7 @@ namespace Aurora::Compression virtual bool Finish() override; virtual IO::IStreamReader *ToStreamReader() override; + virtual IO::ISeekingReader *ToSeekingStreamReader() override; bool IsValid(); @@ -70,6 +72,7 @@ namespace Aurora::Compression protected: virtual AuStreamReadWrittenPair_t Ingest_s(AuUInt32 dwBytesFromUnprocessedInputSource) = 0; IO::Adapters::CompressionStreamReader reader_; + IO::Adapters::CompressionSeekingReader reader2_; AuSPtr pOutputBuffer_; AuWPtr wpInBuffer_; AuSPtr pOutputBufferInterface_;