diff options
Diffstat (limited to 'replay/compression.h')
| -rw-r--r-- | replay/compression.h | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/replay/compression.h b/replay/compression.h new file mode 100644 index 0000000..4807f23 --- /dev/null +++ b/replay/compression.h @@ -0,0 +1,47 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +//=======================================================================================// + +#ifndef COMPRESSION_H +#define COMPRESSION_H + +//---------------------------------------------------------------------------------------- + +#include "platform.h" + +//---------------------------------------------------------------------------------------- + +class ICompressor +{ +public: + virtual ~ICompressor() {} + virtual bool Compress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0; + virtual bool Decompress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0; + + virtual int GetEstimatedCompressionSize( unsigned int nSourceLen ) = 0; +}; + +//---------------------------------------------------------------------------------------- + +enum CompressorType_t +{ + COMPRESSORTYPE_INVALID = -1, + + COMPRESSORTYPE_LZSS, + COMPRESSORTYPE_BZ2, + + NUM_COMPRESSOR_TYPES +}; + +//---------------------------------------------------------------------------------------- + +extern const char *g_pCompressorTypes[ NUM_COMPRESSOR_TYPES ]; + +//---------------------------------------------------------------------------------------- + +ICompressor *CreateCompressor( CompressorType_t nType ); +const char *GetCompressorNameSafe( CompressorType_t nType ); + +//---------------------------------------------------------------------------------------- + +#endif // COMPRESSION_H |