TextSubfile.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // Created by Иван_Архипов on 24.11.2017.
  3. //
  4. #ifndef LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
  5. #define LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
  6. #include "../Subfile.h"
  7. #include <vector>
  8. namespace LOTRO_DAT {
  9. class TextSubfile : public Subfile {
  10. public:
  11. TextSubfile();
  12. TextSubfile(DatFile *dat, long long fragments_count, long long unknown1, long long file_id,
  13. long long file_offset,
  14. long long file_size, long long timestamp, long long version, long long block_size);
  15. FILE_TYPE FileType() const override;
  16. std::string Extension() const override;
  17. bool PrepareForExport(const BinaryData &file_data, long long &export_size, std::vector<BinaryData> &binary_data,
  18. std::vector<std::u16string> &text_data, std::vector<YAML::Node> &options) override;
  19. BinaryData MakeForImport(const BinaryData &old_data, const BinaryData &binary_data,
  20. const std::u16string &text_data, const YAML::Node &options) override;
  21. private:
  22. std::vector<std::u16string> MakePieces(const BinaryData &data, long long &offset);
  23. std::vector<long long> MakeArgumentReferences(const BinaryData &data, long long &offset);
  24. std::vector<std::vector<BinaryData>> MakeArgumentStrings(const BinaryData &data, long long &offset);
  25. };
  26. };
  27. #endif //LOTRO_DAT_LIBRARY_TEXTSUBFILE_H