Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. //=======================================================================================//
  4. #ifndef COMPRESSION_H
  5. #define COMPRESSION_H
  6. //----------------------------------------------------------------------------------------
  7. #include "platform.h"
  8. //----------------------------------------------------------------------------------------
  9. class ICompressor
  10. {
  11. public:
  12. virtual ~ICompressor() {}
  13. virtual bool Compress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0;
  14. virtual bool Decompress( char *pDest, unsigned int *pDestLen, const char *pSource, unsigned int nSourceLen ) = 0;
  15. virtual int GetEstimatedCompressionSize( unsigned int nSourceLen ) = 0;
  16. };
  17. //----------------------------------------------------------------------------------------
  18. enum CompressorType_t
  19. {
  20. COMPRESSORTYPE_INVALID = -1,
  21. COMPRESSORTYPE_LZSS,
  22. COMPRESSORTYPE_BZ2,
  23. NUM_COMPRESSOR_TYPES
  24. };
  25. //----------------------------------------------------------------------------------------
  26. extern const char *g_pCompressorTypes[ NUM_COMPRESSOR_TYPES ];
  27. //----------------------------------------------------------------------------------------
  28. ICompressor *CreateCompressor( CompressorType_t nType );
  29. const char *GetCompressorNameSafe( CompressorType_t nType );
  30. //----------------------------------------------------------------------------------------
  31. #endif // COMPRESSION_H