Zcalanie ręczne. Jak git nie chce po dobroci to będzie siłą

This commit is contained in:
yanczi 2025-11-19 22:01:25 +01:00
parent 690e5278c5
commit 3bf98ba472
22 changed files with 790 additions and 457 deletions

View file

@ -58,7 +58,8 @@ bool ViewCargo::View(const std::string& path)
//Table Header
std::vector<ftxui::Element> headElements;
headElements.push_back(ftxui::text(" Zip ") | ftxui::bold);
headElements.push_back(ftxui::text(" Compressed ") | ftxui::bold);
headElements.push_back(ftxui::text(" Encrypted ") | ftxui::bold);
headElements.push_back(ftxui::text("Nazwa pliku") | ftxui::bold | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 56));
headElements.push_back(ftxui::text("Hash Name") | ftxui::bold | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20));
@ -80,7 +81,7 @@ bool ViewCargo::View(const std::string& path)
bool ViewCargo::CheckCargoFile(const std::string& path)
{
std::vector<char> magic(signature.length());
uint16_t cargoVer = 0;
short cargoVer = 0;
std::ifstream cargo(path, std::ios::binary);
@ -143,10 +144,10 @@ void ViewCargo::GetFileList(const std::string& path)
cargo.read(reinterpret_cast<char*>(&fhTmp.offset), sizeof(fhTmp.offset));
cargo.read(reinterpret_cast<char*>(&fhTmp.size), sizeof(fhTmp.size));
cargo.read(reinterpret_cast<char*>(&fhTmp.crc), sizeof(fhTmp.crc));
cargo.read(reinterpret_cast<char*>(&fhTmp.isZip), sizeof(fhTmp.isZip));
cargo.read(reinterpret_cast<char*>(&fhTmp.flag), sizeof(fhTmp.flag));
//Tworzenie wierszy tabeli
CreateTableRow(fhTmp.nameFile, fhTmp.isZip, fhTmp.hashName);
CreateTableRow(fhTmp.nameFile, fhTmp.flag, fhTmp.hashName);
}
cargo.close();
@ -164,19 +165,35 @@ void ViewCargo::CreateTableRow(const std::string& file, const uint8_t& zip, cons
std::vector<ftxui::Element> cell;
ftxui::Element eZip;
ftxui::Element eEnc;
//Dodawanie check boxa czy plik jest spakowany czy nie
if (zip == 1)
// Ustawianie checkboxów
switch (zip)
{
case 1:
eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan);
}
else
{
eEnc = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White);
break;
case 2:
eZip = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White);
eEnc = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan);
break;
case 3:
eZip = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan);
eEnc = ftxui::text(" [x] ") | ftxui::color(ftxui::Color::Cyan);
break;
default:
eZip = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White);
eEnc = ftxui::text(" [ ] ") | ftxui::color(ftxui::Color::White);
break;
}
//Dodawanie komurek
cell.push_back(eZip);
cell.push_back(eEnc | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 7));
cell.push_back(ftxui::text(file) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 56));
cell.push_back(ftxui::text(ss.str()) | ftxui::size(ftxui::WIDTH, ftxui::EQUAL, 20));