SubDirectory.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // Created by Иван_Архипов on 07.11.2017.
  3. //
  4. #ifndef LOTRO_DAT_PATCHER_SUBDIRECTORY_H
  5. #define LOTRO_DAT_PATCHER_SUBDIRECTORY_H
  6. #include <vector>
  7. #include <map>
  8. #include <unordered_map>
  9. #include <unordered_set>
  10. #include "Subfile.h"
  11. extern "C++"
  12. {
  13. namespace LOTRO_DAT
  14. {
  15. enum FILE_TYPE : int;
  16. class DatFile;
  17. class DatException;
  18. class BinaryData;
  19. class Subfile;
  20. class SubDirectory
  21. {
  22. public:
  23. SubDirectory();
  24. SubDirectory(long long offset, DatFile *dat, long long max_subdirs = 63);
  25. ~SubDirectory();
  26. void MakeDictionary(std::map<long long, Subfile*> &dict);
  27. static std::set<long long> visited_subdirectories_;
  28. private:
  29. bool MakeSubDirectories();
  30. bool MakeSubFiles();
  31. Subfile* MakeSubfile(long long dictionary_offset, long long unknown1, long long file_id, long long file_offset,
  32. long long file_size, long long timestamp, long long version, long long block_size, long long unknown2);
  33. FILE_TYPE GetSubfileType(long long file_id, long long file_offset) const;
  34. DatFile *dat_;
  35. long long offset_;
  36. long long max_subdirs_;
  37. std::vector<SubDirectory *> subdirs_;
  38. std::vector<Subfile *> subfiles_;
  39. };
  40. }
  41. };
  42. #endif //LOTRO_DAT_PATCHER_SUBDIRECTORY_H