SubFile.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // Created by Иван_Архипов on 01.11.2017.
  3. //
  4. #ifndef LOTRO_DAT_PATCHER_SUBFILE_H
  5. #define LOTRO_DAT_PATCHER_SUBFILE_H
  6. #include <string>
  7. #include <vector>
  8. #include "yaml-cpp/yaml.h"
  9. extern "C++"
  10. {
  11. namespace LOTRO_DAT
  12. {
  13. class DatFile;
  14. class BinaryData;
  15. class Database;
  16. class SubfileData;
  17. enum FILE_TYPE : int;
  18. class SubFile
  19. {
  20. friend class DatFile;
  21. friend class SubDirectory;
  22. public:
  23. SubFile() = delete;
  24. explicit SubFile(const SubFile &other) = delete;
  25. SubFile &operator =(const SubFile &other);
  26. SubFile(DatFile &dat, const BinaryData &header);
  27. SubFile(DatFile &dat, long long dictionary_offset, long long fragments_count, long long unknown1,
  28. long long file_id, long long file_offset, long long file_size, long long timestamp, long long version,
  29. long long block_size);
  30. virtual ~SubFile() = default;
  31. virtual FILE_TYPE FileType() const;
  32. virtual std::string Extension() const;
  33. virtual SubfileData PrepareForExport(const BinaryData &file_data);
  34. virtual BinaryData MakeForImport(const BinaryData &old_data, const SubfileData &data);
  35. BinaryData MakeHeaderData() const;
  36. long long dictionary_offset() const;
  37. long long unknown1() const;
  38. long long file_id() const;
  39. long long file_offset() const;
  40. long long file_size() const;
  41. long long timestamp() const;
  42. long long version() const;
  43. long long block_size() const;
  44. long long unknown2() const;
  45. bool operator ==(const SubFile &b) const;
  46. bool operator !=(const SubFile &b) const;
  47. long long category;
  48. protected:
  49. DatFile &dat_;
  50. long long dictionary_offset_;
  51. long long unknown1_;
  52. long long file_id_;
  53. long long file_offset_;
  54. long long file_size_;
  55. long long timestamp_;
  56. long long version_;
  57. long long block_size_;
  58. long long unknown2_;
  59. };
  60. }
  61. };
  62. #endif //LOTRO_DAT_PATCHER_SUBFILE_H