Subfile.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // Created by Иван_Архипов on 01.11.2017.
  3. //
  4. #ifndef LOTRO_DAT_PATCHER_SUBFILE_H
  5. #define LOTRO_DAT_PATCHER_SUBFILE_H
  6. #include <string>
  7. extern "C++"
  8. {
  9. namespace LOTRO_DAT
  10. {
  11. class DatFile;
  12. class BinaryData;
  13. class Database;
  14. enum EXTENSION
  15. {
  16. TXT, JPG, DDS, WAV, OGG, FONT, UNKNOWN
  17. };
  18. class Subfile
  19. {
  20. public:
  21. Subfile();
  22. Subfile(DatFile *dat, long long unknown0, long long unknown1, long long file_id, long long file_offset, long long size1,
  23. long long timestamp, long long version, long long size2);
  24. bool ExportFile(const char* filename, Database *db = nullptr) const;
  25. bool ExportFileAsTXT(const char *filename, Database *db = nullptr) const; // Need to have special function,
  26. // as TXT file consisits of more than 1 file
  27. bool PatchFile();
  28. long long unknown0() const;
  29. long long unknown1() const;
  30. long long file_id() const;
  31. long long file_offset() const;
  32. long long size1() const;
  33. long long timestamp() const;
  34. long long version() const;
  35. long long size2() const;
  36. EXTENSION ext() const;
  37. private:
  38. long long unknown0_;
  39. long long unknown1_;
  40. long long file_id_;
  41. long long file_offset_;
  42. long long size1_;
  43. long long timestamp_;
  44. long long version_;
  45. long long size2_;
  46. bool compressed_;
  47. DatFile *dat_;
  48. EXTENSION ext_;
  49. EXTENSION GetExtension() const;
  50. std::string ExtensionToString(LOTRO_DAT::EXTENSION ext) const;
  51. const BinaryData PrepareAsTXT() const;
  52. const BinaryData PrepareAsJPG() const;
  53. const BinaryData PrepareAsDDS() const;
  54. const BinaryData PrepareAsOGG() const;
  55. const BinaryData PrepareAsFont() const;
  56. const BinaryData PrepareAsWAV() const;
  57. const BinaryData PrepareAsUnk() const;
  58. };
  59. }
  60. };
  61. #endif //LOTRO_DAT_PATCHER_SUBFILE_H