2022-09-05 20:59:46 -04:00
|
|
|
//
|
|
|
|
// EuropaTools
|
|
|
|
//
|
|
|
|
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
|
|
|
|
//
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef EUROPA_IO_PAKWRITER_H
|
|
|
|
#define EUROPA_IO_PAKWRITER_H
|
|
|
|
|
|
|
|
#include <europa/io/PakFile.h>
|
|
|
|
|
|
|
|
#include <iosfwd>
|
|
|
|
#include <string>
|
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
namespace europa::io {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Writer for package files.
|
|
|
|
*/
|
|
|
|
struct PakWriter {
|
2022-09-07 05:07:40 -04:00
|
|
|
void Init(structs::PakVersion version);
|
2022-09-05 20:59:46 -04:00
|
|
|
|
2022-09-07 05:07:40 -04:00
|
|
|
std::unordered_map<std::string, PakFile>& GetFiles();
|
2022-09-05 20:59:46 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write the resulting archive to the given output stream.
|
|
|
|
*/
|
|
|
|
void Write(std::ostream& os);
|
|
|
|
|
2022-09-07 05:07:40 -04:00
|
|
|
private:
|
|
|
|
structs::PakHeader pakHeader {};
|
|
|
|
std::unordered_map<std::string, PakFile> archiveFiles;
|
2022-09-05 20:59:46 -04:00
|
|
|
};
|
|
|
|
|
2022-09-07 05:07:40 -04:00
|
|
|
} // namespace europa::io
|
2022-09-05 20:59:46 -04:00
|
|
|
|
|
|
|
#endif // EUROPA_IO_PAKWRITER_H
|