iw4x-client/src/Utils/Compression.hpp

45 lines
746 B
C++
Raw Normal View History

2017-01-20 08:36:52 -05:00
#pragma once
2016-01-09 09:30:13 -05:00
#define CHUNK 16384
#define DEFLATE_ZLIB false
#define DEFLATE_ZSTD true
2016-01-09 09:30:13 -05:00
2016-01-04 18:49:34 -05:00
namespace Utils
{
namespace Compression
{
class Deflate
2016-01-04 18:49:34 -05:00
{
public:
class ZLib
{
public:
static std::string Compress(std::string data);
static std::string Decompress(std::string data);
};
class ZStd
{
public:
2017-07-03 09:07:47 -04:00
static std::string Compress(std::string data, bool safe = true);
static std::string Decompress(std::string data, bool safe = true);
};
class Semaphore
{
public:
Semaphore(bool zstd);
~Semaphore();
private:
int state;
};
private:
static std::mutex Mutex;
static std::string Compress(std::string data);
static std::string Decompress(std::string data);
};
2016-01-04 18:49:34 -05:00
};
}