SubDirectory.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. extern "C++"
  11. {
  12. namespace LOTRO_DAT
  13. {
  14. enum FILE_TYPE : int;
  15. class DatFile;
  16. class DatException;
  17. class BinaryData;
  18. class Subfile;
  19. class SubDirectory
  20. {
  21. public:
  22. SubDirectory();
  23. SubDirectory(long long offset, DatFile *dat, long long max_subdirs = 63);
  24. ~SubDirectory();
  25. void MakeDictionary(std::unordered_map<long long, Subfile*> &dict);
  26. private:
  27. bool MakeSubDirectories();
  28. bool MakeSubFiles();
  29. Subfile* MakeSubfile(long long dictionary_offset, long long unknown1, long long file_id, long long file_offset,
  30. long long file_size, long long timestamp, long long version, long long block_size, long long unknown2);
  31. FILE_TYPE GetSubfileType(long long file_id, long long file_offset) const;
  32. DatFile *dat_;
  33. long long offset_;
  34. long long max_subdirs_;
  35. std::vector<SubDirectory *> subdirs_;
  36. std::vector<Subfile *> subfiles_;
  37. };
  38. }
  39. };
  40. #endif //LOTRO_DAT_PATCHER_SUBDIRECTORY_H