Subfile.h 1.9 KB

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