123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- //
- // Created by Иван_Архипов on 01.11.2017.
- //
- #ifndef LOTRO_DAT_PATCHER_SUBFILE_H
- #define LOTRO_DAT_PATCHER_SUBFILE_H
- #include <string>
- extern "C++"
- {
- namespace LOTRO_DAT
- {
- class DatFile;
- class BinaryData;
- class Database;
- enum FILE_TYPE : int;
- class Subfile
- {
- public:
- Subfile();
- Subfile(DatFile *dat, 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);
- bool ExportFile(const char* filename) const;
- bool ExportFile(Database *db) const;
- bool ExportFileAsTXT(Database *db = nullptr) const;
- bool PatchBinaryFile(const BinaryData &file);
- bool PatchTextFile();
- long long fragments_count() const;
- long long unknown1() const;
- long long file_id() const;
- long long file_offset() const;
- long long file_size() const;
- long long timestamp() const;
- long long version() const;
- long long block_size() const;
- FILE_TYPE ext() const;
-
- private:
- 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_;
- bool compressed_;
- DatFile *dat_;
- FILE_TYPE ext_;
- FILE_TYPE GetExtension() const;
- std::string ExtensionToString(LOTRO_DAT::FILE_TYPE ext) const;
- BinaryData GetFileData(long long offset = 8) const;
- // Export functions block
- const BinaryData PrepareAsJPG() const;
- const BinaryData PrepareAsDDS() const;
- const BinaryData PrepareAsOGG() const;
- const BinaryData PrepareAsFont() const;
- const BinaryData PrepareAsWAV() const;
- const BinaryData PrepareAsUnk() const;
- // Patch functions block
- const BinaryData MakeFromJPG(const BinaryData &file) const;
- const BinaryData MakeFromDDS(const BinaryData &file) const;
- const BinaryData MakeFromOGG(const BinaryData &file) const;
- const BinaryData MakeFromFont(const BinaryData &file) const;
- const BinaryData MakeFromWAV(const BinaryData &file) const;
- const BinaryData MakeFromUnk(const BinaryData &file) const;
- };
- }
- };
- #endif //LOTRO_DAT_PATCHER_SUBFILE_H
|