mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-13 04:08:06 -05:00
FS: Allow multiple instances of the same archive type to be open at once
This commit is contained in:
@ -180,20 +180,6 @@ public:
|
||||
virtual ~ArchiveBackend() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to open the archive of this type with the specified path
|
||||
* @param path Path to the archive
|
||||
* @return ResultCode of the operation
|
||||
*/
|
||||
virtual ResultCode Open(const Path& path) = 0;
|
||||
|
||||
/**
|
||||
* Deletes the archive contents and then re-creates the base folder
|
||||
* @param path Path to the archive
|
||||
* @return ResultCode of the operation, 0 on success
|
||||
*/
|
||||
virtual ResultCode Format(const Path& path) const = 0;
|
||||
|
||||
/**
|
||||
* Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
|
||||
*/
|
||||
@ -260,4 +246,29 @@ public:
|
||||
virtual std::unique_ptr<DirectoryBackend> OpenDirectory(const Path& path) const = 0;
|
||||
};
|
||||
|
||||
class ArchiveFactory : NonCopyable {
|
||||
public:
|
||||
virtual ~ArchiveFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.)
|
||||
*/
|
||||
virtual std::string GetName() const = 0;
|
||||
|
||||
/**
|
||||
* Tries to open the archive of this type with the specified path
|
||||
* @param path Path to the archive
|
||||
* @return An ArchiveBackend corresponding operating specified archive path.
|
||||
*/
|
||||
virtual ResultVal<std::unique_ptr<ArchiveBackend>> Open(const Path& path) = 0;
|
||||
|
||||
/**
|
||||
* Deletes the archive contents and then re-creates the base folder
|
||||
* @param path Path to the archive
|
||||
* @return ResultCode of the operation, 0 on success
|
||||
*/
|
||||
virtual ResultCode Format(const Path& path) = 0;
|
||||
};
|
||||
|
||||
} // namespace FileSys
|
||||
|
Reference in New Issue
Block a user