2022-06-11 23:01:27 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2022-12-17 20:14:19 +00:00
|
|
|
File: AuIOAdapterCompression.hpp
|
2022-06-11 23:01:27 +00:00
|
|
|
Date: 2022-6-6
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::IO
|
|
|
|
{
|
|
|
|
struct CompressionStreamReader : IStreamReader
|
|
|
|
{
|
2022-12-17 20:14:19 +00:00
|
|
|
AuSPtr<Compression::ICompressionStream> pCompressionStream;
|
2022-06-11 23:01:27 +00:00
|
|
|
|
|
|
|
CompressionStreamReader(const AuSPtr<Compression::ICompressionStream> &compressionStream);
|
|
|
|
|
|
|
|
EStreamError IsOpen() override;
|
|
|
|
EStreamError Read(const Memory::MemoryViewStreamWrite ¶meters) override;
|
|
|
|
void Close() override;
|
|
|
|
|
2022-12-17 20:14:19 +00:00
|
|
|
bool bErrored_ {};
|
2022-06-11 23:01:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CompressionSeekingReader : ISeekingReader
|
|
|
|
{
|
2022-12-17 20:14:19 +00:00
|
|
|
AuSPtr<Compression::ICompressionStream> pCompressionStream;
|
2022-06-11 23:01:27 +00:00
|
|
|
|
|
|
|
CompressionSeekingReader(const AuSPtr<Compression::ICompressionStream> &compressionStream);
|
|
|
|
|
|
|
|
EStreamError IsOpen() override;
|
|
|
|
EStreamError ArbitraryRead(AuUInt offset, const Memory::MemoryViewStreamWrite ¶meters) override;
|
|
|
|
void Close() override;
|
|
|
|
|
2022-12-17 20:14:19 +00:00
|
|
|
bool bErrored_ {};
|
|
|
|
AuUInt uOffset {};
|
2022-06-11 23:01:27 +00:00
|
|
|
};
|
|
|
|
}
|