BVB Source Codes

CRYENGINE Show XMLCPB_ZLibCompressor.h Source code

Return Download CRYENGINE: download XMLCPB_ZLibCompressor.h Source code - Download CRYENGINE Source code - Type:.h
  1. // Copyright 2001-2016 Crytek GmbH / Crytek Group. All rights reserved.
  2.  
  3. /*************************************************************************
  4. *************************************************************************/
  5.  
  6. #pragma once
  7. #ifndef XMLCPB_ZLIBCOMPRESSOR_H
  8.         #define XMLCPB_ZLIBCOMPRESSOR_H
  9.  
  10.         #include <CryCore/Platform/IPlatformOS.h>
  11.         #include "../XMLCPB_Common.h"
  12.  
  13. namespace XMLCPB {
  14.  
  15. bool InitializeCompressorThread();
  16. void ShutdownCompressorThread();
  17.  
  18. //////////////////////////////////////////////////////////////////////////
  19.  
  20. struct SZLibBlock
  21. {
  22.         SZLibBlock(class CZLibCompressor* pCompressor);
  23.         ~SZLibBlock();
  24.  
  25.         CZLibCompressor* m_pCompressor;
  26.         uint8*           m_pZLibBuffer;                         // data that is going to be compressed is stored here
  27.         uint32           m_ZLibBufferSizeUsed;                  // how much of m_pZLibBuffer is currently used
  28. };
  29.  
  30. class CZLibCompressor
  31. {
  32. public:
  33.         CZLibCompressor(const char* pFileName);
  34.         ~CZLibCompressor();
  35.  
  36.         void         WriteDataIntoFile(void* pSrc, uint32 numBytes);
  37.         void         AddDataToZLibBuffer(uint8*& pSrc, uint32& numBytes);
  38.         void         CompressAndWriteZLibBufferIntoFile(bool bFlush);
  39.         void         FlushZLibBuffer();
  40.         SFileHeader& GetFileHeader() { return m_fileHeader; }
  41.  
  42. public:
  43.  
  44.         SFileHeader  m_fileHeader;                              // actually a footer
  45.         class CFile* m_pFile;
  46.         SZLibBlock*  m_currentZlibBlock;
  47.         bool         m_bUseZLibCompression;
  48.         bool         m_errorWritingIntoFile;
  49. };
  50.  
  51. }  // end namespace
  52.  
  53. #endif // XMLCPB_ZLIBCOMPRESSOR_H
  54.  
downloadXMLCPB_ZLibCompressor.h Source code - Download CRYENGINE Source code
Related Source Codes/Software:
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top