DatPatcher.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // Created by kikab on 04.06.2018.
  3. //
  4. #ifndef LOTRO_DAT_LIBRARY_DATPATCHER_H
  5. #define LOTRO_DAT_LIBRARY_DATPATCHER_H
  6. #include "yaml-cpp/yaml.h"
  7. #include <DatOperationResult.h>
  8. extern "C++"
  9. {
  10. namespace LOTRO_DAT {
  11. class DatFile;
  12. class SubfileData;
  13. class SubFile;
  14. class Database;
  15. class BinaryData;
  16. class DatPatcher {
  17. public:
  18. DatPatcher() = delete;
  19. DatPatcher(const DatPatcher &other) = delete;
  20. DatPatcher& operator=(const DatPatcher &other) = delete;
  21. ~DatPatcher() = default;
  22. explicit DatPatcher(DatFile *datFilePtr);
  23. void Init();
  24. DatOperationResult<> PatchFile(const SubfileData &data);
  25. DatOperationResult<> PatchFile(const char *filename, YAML::Node options);
  26. DatOperationResult<> PatchAllDatabase(Database *db);
  27. void DeInit();
  28. private:
  29. DatOperationResult<> ApplyFilePatch(std::shared_ptr<SubFile> file, BinaryData &data);
  30. private:
  31. DatFile *dat;
  32. };
  33. }
  34. }
  35. #endif //LOTRO_DAT_LIBRARY_DATFILEPATCHER_H