40 lines
837 B
C++
40 lines
837 B
C++
#ifndef WC3RE_TREFILE_HH__
|
|
#define WC3RE_TREFILE_HH__
|
|
|
|
#include <map>
|
|
#include <string>
|
|
#include <cstdio>
|
|
#include <vector>
|
|
#include <tuple>
|
|
|
|
class TreFile {
|
|
public:
|
|
TreFile(std::string const& filename);
|
|
TreFile(FILE* file, off_t start, off_t length);
|
|
|
|
~TreFile();
|
|
|
|
TreFile(TreFile const& copy) = delete;
|
|
TreFile& operator=(TreFile const& copy) = delete;
|
|
|
|
void dumpName(std::string path, std::string const& name);
|
|
void dumpCRC(std::string path, uint32_t crc);
|
|
void dumpAll(std::string path);
|
|
|
|
void printStructure();
|
|
|
|
private:
|
|
void construct_();
|
|
|
|
void dumpIdx_(std::string const& name, size_t table3Idx);
|
|
|
|
std::map<uint32_t, size_t> table1_;
|
|
std::map<std::string, size_t> table2_;
|
|
std::vector<std::tuple<uint32_t, uint32_t, uint8_t> > table3_;
|
|
FILE* file_;
|
|
off_t start_;
|
|
size_t length_;
|
|
};
|
|
|
|
#endif
|