DatFile.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. TEXT = 0,
  25. JPG = 1,
  26. DDS = 2,
  27. WAV = 3,
  28. OGG = 4,
  29. FONT = 5,
  30. UNKNOWN = 6
  31. };
  32. class DatFile {
  33. public:
  34. DatFile();
  35. DatFile(const DatFile &other) = delete;
  36. DatFile(DatFile &&other) = default;
  37. DatFile &operator=(const DatFile &other) = delete;
  38. DatFile &operator=(DatFile &&other) = default;
  39. ~DatFile();
  40. DatLocaleManager &GetLocaleManager();
  41. DatExporter &GetExporter();
  42. DatPatcher &GetPatcher();
  43. DatBackupManager &GetBackupManager();
  44. DatIO &GetIO();
  45. DatFileSystem &GetFileSystem();
  46. DatStatus &GetStatusModule();
  47. DatOperationResult<> Initialise(const std::string &filename, long long dat_id);
  48. DatOperationResult<> GatherInformation(const std::string &output_filename);
  49. DatOperationResult<> Deinitialize();
  50. bool Initialized();
  51. long long GetDatID();
  52. private:
  53. std::unique_ptr<DatIO> io_;
  54. std::unique_ptr<DatFileSystem> fileSystem_;
  55. std::unique_ptr<DatLocaleManager> localeManager_;
  56. std::unique_ptr<DatPatcher> patcher_;
  57. std::unique_ptr<DatExporter> exporter_;
  58. std::unique_ptr<DatBackupManager> backupManager_;
  59. std::unique_ptr<DatStatus> status_;
  60. bool initialized_;
  61. long long dat_id_;
  62. };
  63. }
  64. }
  65. #endif //LOTRO_DAT_PATCHER_DATFILE_H