TextSubfile.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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,
  13. long long file_id, long long file_offset, long long file_size, long long timestamp,
  14. long long version, long long block_size);
  15. FILE_TYPE FileType() const override;
  16. std::string Extension() const override;
  17. std::vector<SubfileData> PrepareForExport(const BinaryData &file_data) override;
  18. BinaryData MakeForImport(const BinaryData &old_data, const SubfileData &data) override;
  19. private:
  20. std::vector<std::u16string> MakePieces(const BinaryData &data, long long &offset);
  21. std::vector<long long> MakeArgumentReferences(const BinaryData &data, long long &offset);
  22. std::vector<std::vector<BinaryData>> MakeArgumentStrings(const BinaryData &data, long long &offset);
  23. BinaryData BuildPieces(const BinaryData &data, const SubfileData &new_data, long long &offset);
  24. BinaryData BuildArgumentReferences(const BinaryData &data, const SubfileData &new_data, long long &offset);
  25. BinaryData BuildArgumentStrings(const BinaryData &data, const SubfileData &new_data, long long &offset);
  26. BinaryData GetPieceData(const BinaryData &data, long long &offset) const;
  27. BinaryData GetArgumentReferenceData(const BinaryData &data, long long &offset) const;
  28. BinaryData GetArgumentStringsData(const BinaryData &data, long long &offset) const;
  29. };
  30. };
  31. #endif //LOTRO_DAT_LIBRARY_TEXTSUBFILE_H