4#include <Foundation/Basics.h>
5#include <Foundation/Containers/DynamicArray.h>
6#include <Foundation/IO/Stream.h>
8#ifdef BUILDSYSTEM_ENABLE_ZLIB_SUPPORT
14class PL_FOUNDATION_DLL plCompressedStreamReaderZip :
public plStreamReader
17 plCompressedStreamReaderZip();
18 ~plCompressedStreamReaderZip();
24 void SetInputStream(
plStreamReader* pInputStream, plUInt64 uiInputSize);
30 virtual plUInt64
ReadBytes(
void* pReadBuffer, plUInt64 uiBytesToRead)
override;
33 plUInt64 m_uiRemainingInputSize = 0;
34 bool m_bReachedEnd =
false;
37 z_stream_s* m_pZLibStream =
nullptr;
45class PL_FOUNDATION_DLL plCompressedStreamReaderZlib :
public plStreamReader
51 ~plCompressedStreamReaderZlib();
57 virtual plUInt64
ReadBytes(
void* pReadBuffer, plUInt64 uiBytesToRead)
override;
60 bool m_bReachedEnd =
false;
63 z_stream_s* m_pZLibStream =
nullptr;
74class PL_FOUNDATION_DLL plCompressedStreamWriterZlib :
public plStreamWriter
91 plCompressedStreamWriterZlib(
plStreamWriter* pOutputStream, Compression ratio = Compression::Default);
94 ~plCompressedStreamWriterZlib();
99 virtual plResult WriteBytes(
const void* pWriteBuffer, plUInt64 uiBytesToWrite)
override;
110 plUInt64 GetUncompressedSize()
const {
return m_uiUncompressedSize; }
118 plUInt64 GetCompressedSize()
const {
return m_uiCompressedSize; }
127 plUInt64 m_uiUncompressedSize = 0;
128 plUInt64 m_uiCompressedSize = 0;
131 z_stream_s* m_pZLibStream =
nullptr;
Definition DynamicArray.h:81
Interface for binary in (read) streams.
Definition Stream.h:22
virtual plUInt64 ReadBytes(void *pReadBuffer, plUInt64 uiBytesToRead)=0
Reads a raw number of bytes into the read buffer, this is the only method which has to be implemented...
Interface for binary out (write) streams.
Definition Stream.h:107
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54