EuropaTools/include/europa/io/PakReader.h

46 lines
753 B
C
Raw Normal View History

2022-09-04 17:11:14 -04:00
//
// EuropaTools
//
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
#ifndef EUROPA_IO_PAKREADER_H
#define EUROPA_IO_PAKREADER_H
#include <europa/io/PakFile.h>
#include <europa/structs/Pak.h>
2022-09-04 17:11:14 -04:00
#include <iosfwd>
#include <string>
#include <unordered_map>
namespace europa::io {
struct PakReader {
explicit PakReader(std::istream& is);
void ReadData();
bool Invalid() const {
return invalid;
}
const std::unordered_map<std::string, PakFile>& GetFiles() const;
2022-09-04 17:11:14 -04:00
private:
std::istream& stream;
bool invalid { false };
2022-09-04 17:11:14 -04:00
structs::PakHeader header {};
2022-09-04 17:11:14 -04:00
std::unordered_map<std::string, PakFile> files;
2022-09-04 17:11:14 -04:00
};
} // namespace europa::io
2022-09-04 17:11:14 -04:00
#endif // EUROPA_IO_PAKREADER_H