Subfile.h 1.8 KB

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