Subfile.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. long long fragments_count() const;
  30. long long unknown1() const;
  31. long long file_id() const;
  32. long long file_offset() const;
  33. long long file_size() const;
  34. long long timestamp() const;
  35. long long version() const;
  36. long long block_size() const;
  37. protected:
  38. DatFile *dat_;
  39. long long fragments_count_;
  40. long long unknown1_;
  41. long long file_id_;
  42. long long file_offset_;
  43. long long file_size_;
  44. long long timestamp_;
  45. long long version_;
  46. long long block_size_;
  47. };
  48. }
  49. };
  50. #endif //LOTRO_DAT_PATCHER_SUBFILE_H