SubDirectory.h 1.3 KB

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