Zcalanie ręczne. Jak git nie chce po dobroci to będzie siłą
This commit is contained in:
parent
690e5278c5
commit
3bf98ba472
22 changed files with 790 additions and 457 deletions
|
|
@ -25,29 +25,30 @@
|
|||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
#include <lz4.h>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <xxhash.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include "DataStruct.h"
|
||||
#include "Txtpp.h"
|
||||
#include "CompressingManager.h"
|
||||
#include "ChunkManager.h"
|
||||
#include "EncryptionManager.h"
|
||||
|
||||
|
||||
#define KEY_ZIP "compress" // Pliki do skompresowania
|
||||
#define KEY_RAW "raw" // Pliki które maj¹ pozostaæ w oryginalnej formie
|
||||
#define KEY_IGNORE "ignore" // Pliki pominiête przy pakowaniu
|
||||
#define KEY_ENCRYPT "encrypt" // Plili które maj¹ byæ zaszyfrowane
|
||||
|
||||
#define ALL_FILE ".*" // Wszystkie pliki
|
||||
|
||||
#define COMPRESSION_LEVEL 12 // Poziom kompresji plików (3 < 12)
|
||||
|
||||
#define KEY_ZIP "COMPRESS" // Pliki do skompresowania
|
||||
#define KEY_RAW "RAW" // Pliki które maj¹ pozostaæ w oryginalnej formie
|
||||
#define KEY_IGNORE "IGNORE" // Pliki pominiête przy pakowaniu
|
||||
#define KEY_CRYPT "CRYPT" // Plili które maj¹ byæ zaszyfrowane
|
||||
|
||||
#define ALL_FILE ".*" // Wszystkie pliki
|
||||
|
||||
struct PathConf
|
||||
{
|
||||
std::string path;
|
||||
int16_t parameter;
|
||||
};
|
||||
|
||||
class CreateCargo {
|
||||
public:
|
||||
|
|
@ -55,14 +56,14 @@ public:
|
|||
virtual ~CreateCargo();
|
||||
|
||||
// Punk wejœcia do tworzenia archivum
|
||||
bool Create(const std::string&, bool, bool);
|
||||
bool Create(const std::string&, const int16_t&);
|
||||
|
||||
private:
|
||||
bool compressingFlag;
|
||||
bool filteringFlag;
|
||||
const std::string signature;
|
||||
const std::string extension;
|
||||
const uint8_t version;
|
||||
const short version;
|
||||
|
||||
short methodFlags;
|
||||
|
||||
|
||||
std::string catalogPath;
|
||||
|
|
@ -71,11 +72,16 @@ private:
|
|||
|
||||
std::vector<std::string> filesList;
|
||||
|
||||
|
||||
EncryptionManager crypt;
|
||||
bool hppKey;
|
||||
|
||||
// listy wyj¹tków
|
||||
std::vector<std::string> ignoreList;
|
||||
std::vector<std::string> zipList;
|
||||
std::vector<std::string> encList;
|
||||
|
||||
// G³ówna lista plików z parametrami
|
||||
std::vector<PathConf> filesPaths;
|
||||
|
||||
|
||||
std::ofstream cargo;
|
||||
|
|
@ -101,20 +107,14 @@ private:
|
|||
// Przygotowanie nag³ówków i plików
|
||||
std::vector<FilesTable> ComputingHeadFiles();
|
||||
|
||||
// Sprawdzanie czy plik znajduje siê na liœcie
|
||||
bool FilteringData(const std::string&);
|
||||
|
||||
// Wczytanie filtrów wyj¹tków
|
||||
void GetFilters(const std::string&);
|
||||
|
||||
// Sprawdza czy plik znajduje siê na liœcie
|
||||
uint8_t CheckFileOnTheList(const std::string&, std::vector<char>&, std::vector<char>&);
|
||||
|
||||
// Kasowanie z listy plików ignorow
|
||||
bool CheckIgnorePath(const std::string&);
|
||||
void computingBytes(const int16_t&, std::vector<char>&, std::vector<char>&);
|
||||
|
||||
// Sprawdzanie rozsze¿eñ plików
|
||||
bool CheckFileExtension(const std::filesystem::path&, const std::vector<std::string>&);
|
||||
bool CheckFileExtension(const std::string&, const std::vector<std::string>&);
|
||||
|
||||
// Zamieñ ca³y ci¹g na du¿e litery
|
||||
std::string UpperString(std::string);
|
||||
|
|
@ -122,12 +122,6 @@ private:
|
|||
// Wygenerój FNV-1a HASH
|
||||
uint64_t fnv64(const std::string& data);
|
||||
|
||||
// CRC
|
||||
uint32_t crc32(const std::vector<char>&);
|
||||
|
||||
// Rozdzielanie paternu od œcie¿ki
|
||||
void ExtPatternAndPathDetection(const std::vector<std::string>&, std::vector<std::string>&, std::vector<std::string>&);
|
||||
|
||||
// ZnajdŸ wskazany element na liœcie
|
||||
bool FindOnTheList(const std::vector<std::string>&, const std::string&);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue