Subfile.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. enum FILE_TYPE : int;
  17. class Subfile
  18. {
  19. public:
  20. Subfile();
  21. Subfile(DatFile *dat, long long fragments_count, long long unknown1, long long file_id, long long file_offset,
  22. long long file_size, long long timestamp, long long version, long long block_size);
  23. virtual FILE_TYPE FileType() const;
  24. virtual std::string Extension() const;
  25. virtual bool PrepareForExport(const BinaryData &file_data, long long &export_size, std::vector<BinaryData> &binary_data,
  26. std::vector<std::u16string> &text_data, std::vector<YAML::Node> &options);
  27. virtual BinaryData MakeForImport(const BinaryData &old_data, const BinaryData &binary_data,
  28. const std::u16string &text_data, const YAML::Node &options);
  29. BinaryData MakeHeaderData();
  30. long long fragments_count() const;
  31. long long unknown1() const;
  32. long long file_id() const;
  33. long long file_offset() const;
  34. long long file_size() const;
  35. long long timestamp() const;
  36. long long version() const;
  37. long long block_size() const;
  38. protected:
  39. DatFile *dat_;
  40. long long fragments_count_;
  41. long long unknown1_;
  42. long long file_id_;
  43. long long file_offset_;
  44. long long file_size_;
  45. long long timestamp_;
  46. long long version_;
  47. long long block_size_;
  48. };
  49. }
  50. };
  51. #endif //LOTRO_DAT_PATCHER_SUBFILE_H