123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- //
- // Created by Иван_Архипов on 07.11.2017.
- //
- #ifndef LOTRO_DAT_PATCHER_SUBDIRECTORY_H
- #define LOTRO_DAT_PATCHER_SUBDIRECTORY_H
- #include <vector>
- #include <map>
- #include <unordered_map>
- extern "C++"
- {
- namespace LOTRO_DAT
- {
- enum FILE_TYPE : int;
- class DatFile;
- class DatException;
- class BinaryData;
- class Subfile;
- class SubDirectory
- {
- public:
- SubDirectory();
- SubDirectory(long long offset, DatFile *dat, long long max_subdirs = 63);
- void MakeDictionary(std::unordered_map<long long, Subfile*> &dict);
- void UpdateDirectories(std::unordered_map<long long, BinaryData *> &patched_files);
- private:
- void MakeSubDirectories();
- void MakeSubFiles();
- Subfile* MakeSubfile(long long fragments_count, long long unknown1, long long file_id, long long file_offset,
- long long file_size, long long timestamp, long long version, long long block_size);
- FILE_TYPE GetSubfileType(long long file_id, long long file_offset) const;
- DatFile *dat_;
- long long offset_;
- long long max_subdirs_;
- std::vector<SubDirectory> subdirs_;
- std::vector<Subfile *> subfiles_;
- };
- }
- };
- #endif //LOTRO_DAT_PATCHER_SUBDIRECTORY_H
|