DatFile.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // Created by Иван_Архипов on 31.10.2017.
  3. //
  4. #ifndef LOTRO_DAT_PATCHER_DATFILE_H
  5. #define LOTRO_DAT_PATCHER_DATFILE_H
  6. #ifdef LOTRO_DAT_EXPORTS
  7. #define LOTRO_DAT_API __declspec(dllexport)
  8. #else
  9. #define LOTRO_DAT_API __declspec(dllimport)
  10. #endif
  11. #include <bits/unique_ptr.h>
  12. #include "DatSubsystems/DatBackupManager.h"
  13. #include "DatSubsystems/DatExporter.h"
  14. #include "DatSubsystems/DatFileSystem.h"
  15. #include "DatSubsystems/DatIO.h"
  16. #include "DatSubsystems/DatLocaleManager.h"
  17. #include "DatSubsystems/DatPatcher.h"
  18. #include "DatSubsystems/DatStatus.h"
  19. // Dat file names definitions
  20. extern "C++"
  21. {
  22. namespace LOTRO_DAT {
  23. enum FILE_TYPE : int {
  24. NO_TYPE = 0,
  25. TEXT = 1,
  26. JPG = 2,
  27. DDS = 4,
  28. WAV = 8,
  29. OGG = 16,
  30. FONT = 32,
  31. UNKNOWN = 64
  32. };
  33. class DatFile {
  34. public:
  35. DatFile();
  36. DatFile(const DatFile &other) = delete;
  37. DatFile(DatFile &&other) = default;
  38. DatFile &operator=(const DatFile &other) = delete;
  39. DatFile &operator=(DatFile &&other) = default;
  40. ~DatFile();
  41. DatLocaleManager &GetLocaleManager();
  42. DatExporter &GetExporter();
  43. DatPatcher &GetPatcher();
  44. DatBackupManager &GetBackupManager();
  45. DatIO &GetIO();
  46. DatFileSystem &GetFileSystem();
  47. DatStatus &GetStatusModule();
  48. DatOperationResult<> Initialise(const std::string &filename, long long dat_id);
  49. DatOperationResult<> GatherInformation(const std::string &output_filename);
  50. DatOperationResult<> Deinitialize();
  51. bool Initialized();
  52. long long GetDatID();
  53. private:
  54. std::unique_ptr<DatIO> io_;
  55. std::unique_ptr<DatFileSystem> fileSystem_;
  56. std::unique_ptr<DatLocaleManager> localeManager_;
  57. std::unique_ptr<DatPatcher> patcher_;
  58. std::unique_ptr<DatExporter> exporter_;
  59. std::unique_ptr<DatBackupManager> backupManager_;
  60. std::unique_ptr<DatStatus> status_;
  61. bool initialized_;
  62. long long dat_id_;
  63. };
  64. }
  65. }
  66. #endif //LOTRO_DAT_PATCHER_DATFILE_H