// // Created by Иван_Архипов on 01.11.2017. // #ifndef LOTRO_DAT_PATCHER_SUBFILE_H #define LOTRO_DAT_PATCHER_SUBFILE_H #include extern "C++" { namespace LOTRO_DAT { class DatFile; class BinaryData; class Database; enum EXTENSION { TXT, JPG, DDS, WAV, OGG, FONT, UNKNOWN }; class Subfile { public: Subfile(); Subfile(DatFile *dat, long long unknown0, long long unknown1, long long file_id, long long file_offset, long long size1, long long timestamp, long long version, long long size2); bool ExportFile(const char* filename, Database *db = nullptr) const; bool ExportFileAsTXT(const char *filename, Database *db = nullptr) const; // Need to have special function, // as TXT file consisits of more than 1 file bool PatchFile(); long long unknown0() const; long long unknown1() const; long long file_id() const; long long file_offset() const; long long size1() const; long long timestamp() const; long long version() const; long long size2() const; EXTENSION ext() const; private: long long unknown0_; long long unknown1_; long long file_id_; long long file_offset_; long long size1_; long long timestamp_; long long version_; long long size2_; bool compressed_; DatFile *dat_; EXTENSION ext_; EXTENSION GetExtension() const; std::string ExtensionToString(LOTRO_DAT::EXTENSION ext) const; const BinaryData PrepareAsTXT() const; const BinaryData PrepareAsJPG() const; const BinaryData PrepareAsDDS() const; const BinaryData PrepareAsOGG() const; const BinaryData PrepareAsFont() const; const BinaryData PrepareAsWAV() const; const BinaryData PrepareAsUnk() const; }; } }; #endif //LOTRO_DAT_PATCHER_SUBFILE_H