Subfile.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. Subfile& operator=(const Subfile &b);
  29. virtual FILE_TYPE FileType() const;
  30. virtual std::string Extension() const;
  31. virtual SubfileData PrepareForExport(const BinaryData &file_data);
  32. virtual BinaryData MakeForImport(const BinaryData &old_data, const SubfileData &data);
  33. BinaryData MakeHeaderData() const;
  34. long long dictionary_offset() 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 unknown2() const;
  43. bool operator ==(const Subfile &b) const;
  44. bool operator !=(const Subfile &b) const;
  45. long long category;
  46. protected:
  47. DatFile *dat_;
  48. long long dictionary_offset_;
  49. long long unknown1_;
  50. long long file_id_;
  51. long long file_offset_;
  52. long long file_size_;
  53. long long timestamp_;
  54. long long version_;
  55. long long block_size_;
  56. long long unknown2_;
  57. };
  58. }
  59. };
  60. #endif //LOTRO_DAT_PATCHER_SUBFILE_H