Subfile.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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();
  24. Subfile(DatFile *dat, const BinaryData &header);
  25. Subfile(DatFile *dat, long long dictionary_offset, long long fragments_count, long long unknown1,
  26. long long file_id, long long file_offset, long long file_size, long long timestamp, long long version,
  27. long long block_size);
  28. virtual FILE_TYPE FileType() const;
  29. virtual std::string Extension() const;
  30. virtual SubfileData PrepareForExport(const BinaryData &file_data);
  31. virtual BinaryData MakeForImport(const BinaryData &old_data, const SubfileData &data);
  32. BinaryData MakeHeaderData() const;
  33. long long dictionary_offset() const;
  34. long long fragments_count() const;
  35. long long unknown1() const;
  36. long long file_id() const;
  37. long long file_offset() const;
  38. long long file_size() const;
  39. long long timestamp() const;
  40. long long version() const;
  41. long long block_size() const;
  42. long long category;
  43. protected:
  44. DatFile *dat_;
  45. long long dictionary_offset_;
  46. long long fragments_count_;
  47. long long unknown1_;
  48. long long file_id_;
  49. long long file_offset_;
  50. long long file_size_;
  51. long long timestamp_;
  52. long long version_;
  53. long long block_size_;
  54. };
  55. }
  56. };
  57. #endif //LOTRO_DAT_PATCHER_SUBFILE_H