archive_extsavedata.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2014 Citra Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. #include "core/file_sys/disk_archive.h"
  7. #include "core/loader/loader.h"
  8. ////////////////////////////////////////////////////////////////////////////////////////////////////
  9. // FileSys namespace
  10. namespace FileSys {
  11. /// File system interface to the ExtSaveData archive
  12. class Archive_ExtSaveData final : public DiskArchive {
  13. public:
  14. Archive_ExtSaveData(const std::string& mount_point);
  15. /**
  16. * Initialize the archive.
  17. * @return true if it initialized successfully
  18. */
  19. bool Initialize();
  20. ResultCode Open(const Path& path) override;
  21. ResultCode Format(const Path& path) const override;
  22. std::string GetName() const override { return "ExtSaveData"; }
  23. const std::string& GetMountPoint() const override {
  24. return concrete_mount_point;
  25. }
  26. protected:
  27. /**
  28. * This holds the full directory path for this archive, it is only set after a successful call to Open,
  29. * this is formed as <base extsavedatapath>/<type>/<high>/<low>.
  30. * See GetExtSaveDataPath for the code that extracts this data from an archive path.
  31. */
  32. std::string concrete_mount_point;
  33. };
  34. } // namespace FileSys