Przeniesiono kompresję do osobnej klasy i zoptymalizowano
This commit is contained in:
parent
fd42a5812a
commit
56ac9715fe
6 changed files with 136 additions and 90 deletions
|
|
@ -6,17 +6,11 @@
|
|||
#include <stdexcept>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
#define ZSTD_STATIC_LINKING_ONLY
|
||||
#include <zstd.h>
|
||||
|
||||
#if ZSTD_VERSION_NUMBER < 10400
|
||||
#error "Wymagane zstd >= 1.4.0 dla ZSTD_c_format / ZSTD_f_zstd1_magicless"
|
||||
#endif
|
||||
|
||||
#include "EncryptionManager.h"
|
||||
#include "CompressionManager.h"
|
||||
|
||||
#define BLOCK_SIZE 131072 // 128KB
|
||||
#define COMPRESSION_LEVEL 3
|
||||
|
||||
struct BlockSize
|
||||
{
|
||||
|
|
@ -38,6 +32,7 @@ public:
|
|||
|
||||
private:
|
||||
EncryptionManager eman;
|
||||
CompressionManager cman;
|
||||
std::vector<BlockSize> blockSizes;
|
||||
|
||||
// Przekonwertuj zmienn¹ na ci¹g na vector
|
||||
|
|
@ -59,11 +54,5 @@ private:
|
|||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
// Kompresja
|
||||
std::vector<char> compress_data(const std::vector<char>&);
|
||||
|
||||
// Dekompresja
|
||||
std::vector<char> decompress_data(const std::vector<char>&, const size_t&);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue