TextSubfile.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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 dictionary_offset, 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. ~TextSubfile() override {};
  16. FILE_TYPE FileType() const override;
  17. std::string Extension() const override;
  18. bool PrepareForExport(const BinaryData &file_data, long long &export_size, std::vector<BinaryData> &binary_data,
  19. std::vector<std::u16string> &text_data, std::vector<YAML::Node> &options) override;
  20. BinaryData MakeForImport(const BinaryData &old_data, const BinaryData &binary_data,
  21. const std::u16string &text_data, const YAML::Node &options) override;
  22. private:
  23. std::vector<std::u16string> MakePieces(const BinaryData &data, long long &offset);
  24. std::vector<long long> MakeArgumentReferences(const BinaryData &data, long long &offset);
  25. std::vector<std::vector<BinaryData>> MakeArgumentStrings(const BinaryData &data, long long &offset);
  26. };
  27. };
  28. #endif //LOTRO_DAT_LIBRARY_TEXTSUBFILE_H