/*
* This file is part of VoidArchiveTool.
*
* Copyright (C) 2025 Yanczi
*
* Void Archive Toolis free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
*/
#pragma once
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "DataStruct.h"
#include "xxhash.h"
#include "CompressingManager.h"
class ExtractCargo {
public:
ExtractCargo();
virtual ~ExtractCargo();
// Punkt wejścia
bool Extract(const std::string&);
private:
std::filesystem::path cargoFileName;
uint32_t filesLen;
uint64_t tablePosition;
uint8_t filesHeadsOffset;
const uint8_t version;
const std::string signature;
std::vector filesHeads;
std::ifstream cargoFile;
// Sprawdzenie poprawności archiwum
bool CheckCargoFile();
// Wypakowywanie plików
void ExtractingFilesFromCargo();
// Pobieranie nagłówków plików
void LoadFilesTable();
// Sprawdzanie sumy kontrolnej
bool HashValid(const std::vector&, const uint32_t&);
// CRC
uint32_t crc32(const std::vector&);
// Utwórz katalog
void CreateDirections(std::filesystem::path);
};