EuropaTools/include/europa/io/PakWriter.h
modeco80 fae513fdfe Try to optimize things a bit
PakReader won't read everything in ReadData(), it now only reads the header and TOC.

Files now need to be read in separately.

Adds progress bar to europa_pack_extractor.

Moved code around.
2022-09-07 04:07:40 -05:00

40 lines
744 B
C++

//
// 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 {
void Init(structs::PakVersion version);
std::unordered_map<std::string, PakFile>& GetFiles();
/**
* Write the resulting archive to the given output stream.
*/
void Write(std::ostream& os);
private:
structs::PakHeader pakHeader {};
std::unordered_map<std::string, PakFile> archiveFiles;
};
} // namespace europa::io
#endif // EUROPA_IO_PAKWRITER_H