2020-01-18 08:37:57 -05:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
2020-09-12 13:32:53 -04:00
|
|
|
class GpIOStream;
|
|
|
|
|
|
2020-01-18 08:37:57 -05:00
|
|
|
namespace PortabilityLayer
|
|
|
|
|
{
|
2020-10-17 22:56:27 -04:00
|
|
|
class DeflateContext
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
static DeflateContext *Create(GpIOStream *stream, int compressionLevel);
|
|
|
|
|
|
|
|
|
|
virtual void Destroy() = 0;
|
|
|
|
|
virtual bool Append(const void *buffer, size_t size) = 0;
|
|
|
|
|
|
|
|
|
|
virtual bool Flush() = 0;
|
2020-10-19 18:51:18 -04:00
|
|
|
|
|
|
|
|
static uint32_t CRC32(uint32_t inputValue, const void *buffer, size_t bufferLength);
|
2020-10-17 22:56:27 -04:00
|
|
|
};
|
|
|
|
|
|
2020-01-18 08:37:57 -05:00
|
|
|
class DeflateCodec
|
|
|
|
|
{
|
|
|
|
|
public:
|
2020-09-12 13:32:53 -04:00
|
|
|
static bool DecompressStream(GpIOStream *stream, size_t inSize, void *outBuffer, size_t outSize);
|
2020-01-18 08:37:57 -05:00
|
|
|
};
|
|
|
|
|
}
|