diff options
| author | bunnei <bunneidev@gmail.com> | 2015-02-10 18:27:16 -0500 |
|---|---|---|
| committer | bunnei <bunneidev@gmail.com> | 2015-02-10 18:27:16 -0500 |
| commit | 27e6e6b3cb2ee1ab3a996c2b4be1d9a3c4e6b75d (patch) | |
| tree | fd8b0290d4a0353c11c0e168200b20b5a89e297c /src/core/file_sys/archive_sdmc.cpp | |
| parent | 67db6aa4ce1f57f7d99406c8924ed41e74d36dbe (diff) | |
| parent | 0d2b6dd6566b6718c806181c1f1c3bcdcede86ae (diff) | |
Merge pull request #540 from yuriks/multi-archives
FS: Allow multiple instances of the same archive type to be open at once
Diffstat (limited to 'src/core/file_sys/archive_sdmc.cpp')
| -rw-r--r-- | src/core/file_sys/archive_sdmc.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 26b03e82f..92b20c7f6 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -6,6 +6,7 @@ #include "common/common_types.h" #include "common/file_util.h" +#include "common/make_unique.h" #include "core/file_sys/archive_sdmc.h" #include "core/file_sys/disk_archive.h" @@ -16,17 +17,17 @@ namespace FileSys { -Archive_SDMC::Archive_SDMC(const std::string& sdmc_directory) : DiskArchive(sdmc_directory) { +ArchiveFactory_SDMC::ArchiveFactory_SDMC(const std::string& sdmc_directory) : sdmc_directory(sdmc_directory) { LOG_INFO(Service_FS, "Directory %s set as SDMC.", sdmc_directory.c_str()); } -bool Archive_SDMC::Initialize() { +bool ArchiveFactory_SDMC::Initialize() { if (!Settings::values.use_virtual_sd) { LOG_WARNING(Service_FS, "SDMC disabled by config."); return false; } - if (!FileUtil::CreateFullPath(mount_point)) { + if (!FileUtil::CreateFullPath(sdmc_directory)) { LOG_ERROR(Service_FS, "Unable to create SDMC path."); return false; } @@ -34,4 +35,14 @@ bool Archive_SDMC::Initialize() { return true; } +ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveFactory_SDMC::Open(const Path& path) { + auto archive = Common::make_unique<DiskArchive>(sdmc_directory); + return MakeResult<std::unique_ptr<ArchiveBackend>>(std::move(archive)); +} + +ResultCode ArchiveFactory_SDMC::Format(const Path& path) { + // This is kind of an undesirable operation, so let's just ignore it. :) + return RESULT_SUCCESS; +} + } // namespace FileSys |
