DatFile.h 2.1 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. // Dat file names definitions
  19. extern "C++"
  20. {
  21. namespace LOTRO_DAT {
  22. enum FILE_TYPE : int {
  23. TEXT = 0,
  24. JPG = 1,
  25. DDS = 2,
  26. WAV = 3,
  27. OGG = 4,
  28. FONT = 5,
  29. UNKNOWN = 6
  30. };
  31. class DatFile {
  32. friend class DatIO;
  33. friend class DatFileSystem;
  34. friend class DatLocaleManager;
  35. friend class DatPatcher;
  36. friend class DatExporter;
  37. friend class DatBackupManager;
  38. public:
  39. DatFile();
  40. DatFile(const DatFile &other) = delete;
  41. DatFile(DatFile &&other) = default;
  42. DatFile &operator=(const DatFile &other) = delete;
  43. DatFile &operator=(DatFile &&other) = default;
  44. ~DatFile();
  45. DatLocaleManager &getLocaleManager();
  46. DatExporter &getExporter();
  47. DatPatcher &getPatcher();
  48. DatBackupManager &getBackupManager();
  49. DatIO &getIO();
  50. DatFileSystem &getFileSystem();
  51. DatOperationResult<> Initialise(const std::string &filename, long long dat_id);
  52. DatOperationResult<> GatherInformation(const std::string &output_filename);
  53. DatOperationResult<> Deinitialize();
  54. bool Initialized();
  55. private:
  56. std::unique_ptr<DatIO> io_;
  57. std::unique_ptr<DatFileSystem> fileSystem_;
  58. std::unique_ptr<DatLocaleManager> localeManager_;
  59. std::unique_ptr<DatPatcher> patcher_;
  60. std::unique_ptr<DatExporter> exporter_;
  61. std::unique_ptr<DatBackupManager> backupManager_;
  62. bool initialized_;
  63. long long dat_id_;
  64. };
  65. }
  66. }
  67. #endif //LOTRO_DAT_PATCHER_DATFILE_H