Przerobiona metoda tworzenia kontenerów. Błędnie dobiera opcje

This commit is contained in:
yanczi 2025-11-05 03:06:24 +01:00
parent 69089cd2f9
commit 1392b5bbe0
6 changed files with 97 additions and 63 deletions

View file

@ -31,6 +31,7 @@
#include <memory>
#include <string>
#include <xxhash.h>
#include <nlohmann/json.hpp>
#include "DataStruct.h"
#include "Txtpp.h"
@ -45,14 +46,14 @@
#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 KEY_ENCRYPT "ENCRYPT" // Plili które maj¹ byæ zaszyfrowane
#define ALL_FILE ".*" // Wszystkie pliki
struct MethodFlags
struct PathConf
{
bool compressing = false;
bool encryption = false;
std::string path;
int8_t parameter;
};
class CreateCargo {
@ -61,16 +62,14 @@ public:
virtual ~CreateCargo();
// Punk wejœcia do tworzenia archivum
bool Create(const std::string&, bool, bool);
bool Create(const std::string&, int8_t);
private:
bool compressingFlag;
bool filteringFlag;
const std::string signature;
const std::string extension;
const uint8_t version;
MethodFlags methodFlags;
int8_t methodFlags;
std::string catalogPath;
@ -85,6 +84,9 @@ private:
std::vector<std::string> ignoreList;
std::vector<std::string> zipList;
// G³ówna lista plików z parametrami
std::vector<PathConf> filesPaths;
std::ofstream cargo;
uint64_t offset;
@ -135,5 +137,8 @@ private:
// ZnajdŸ wskazany element na liœcie
bool FindOnTheList(const std::vector<std::string>&, const std::string&);
// Przygotuj listê plików do spakowania
void PrepareList(const std::vector<std::string>&, const std::vector<std::string>&, const std::vector<std::string>&);
};