1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- //
- // Created by Иван_Архипов on 24.11.2017.
- //
- #ifndef LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
- #define LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
- #include "SubFile.h"
- #include <vector>
- #include <unordered_map>
- namespace LOTRO_DAT {
- class TextSubFile : public SubFile {
- public:
- TextSubFile() = delete;
- explicit TextSubFile(const TextSubFile &other) = delete;
- SubFile &operator =(const TextSubFile &other) = delete;
- TextSubFile(DatFile &dat, long long dictionary_offset, long long fragments_count, long long unknown1,
- long long file_id, long long file_offset, long long file_size, long long timestamp,
- long long version, long long block_size);
- FILE_TYPE FileType() const override;
- std::string Extension() const override;
- SubfileData PrepareForExport(const BinaryData &file_data) override;
- BinaryData MakeForImport(const BinaryData &old_data, const SubfileData &data) override;
- private:
- std::vector<SubfileData> FileFragments;
- private:
- std::vector<std::u16string> MakePieces(const BinaryData &data, long long &offset);
- std::vector<long long> MakeArgumentReferences(const BinaryData &data, long long &offset);
- std::vector<std::vector<BinaryData>> MakeArgumentStrings(const BinaryData &data, long long &offset);
- std::unordered_map<long long, SubfileData> ParsePatchFragments(const SubfileData &data);
- BinaryData BuildPieces(const BinaryData &data, const SubfileData &new_data, long long &offset);
- BinaryData BuildArgumentReferences(const BinaryData &data, const SubfileData &new_data, long long &offset);
- BinaryData BuildArgumentStrings(const BinaryData &data, const SubfileData &new_data, long long &offset);
- BinaryData GetPieceData(const BinaryData &data, long long &offset) const;
- BinaryData GetArgumentReferenceData(const BinaryData &data, long long &offset) const;
- BinaryData GetArgumentStringsData(const BinaryData &data, long long &offset) const;
- };
- };
- #endif //LOTRO_DAT_LIBRARY_TEXTSUBFILE_H
|