diff options
| author | 2018-08-10 20:47:25 -0400 | |
|---|---|---|
| committer | 2018-08-11 22:50:48 -0400 | |
| commit | 62e859c6c7ee3baed499d34e928fce17b8f8be9e (patch) | |
| tree | a52fe5006411708181ccb0ec92000c8702b552bf /src/core | |
| parent | qt: Use custom RawCopy with progress bar for installs (diff) | |
| download | yuzu-62e859c6c7ee3baed499d34e928fce17b8f8be9e.tar.gz yuzu-62e859c6c7ee3baed499d34e928fce17b8f8be9e.tar.xz yuzu-62e859c6c7ee3baed499d34e928fce17b8f8be9e.zip | |
bis_factory: Create NAND dirs if they don't exist
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/file_sys/bis_factory.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/file_sys/bis_factory.cpp b/src/core/file_sys/bis_factory.cpp index 7d0de733b..ae4e33800 100644 --- a/src/core/file_sys/bis_factory.cpp +++ b/src/core/file_sys/bis_factory.cpp | |||
| @@ -6,12 +6,19 @@ | |||
| 6 | 6 | ||
| 7 | namespace FileSys { | 7 | namespace FileSys { |
| 8 | 8 | ||
| 9 | static VirtualDir GetOrCreateDirectory(const VirtualDir& dir, std::string_view path) { | ||
| 10 | const auto res = dir->GetDirectoryRelative(path); | ||
| 11 | if (res == nullptr) | ||
| 12 | return dir->CreateDirectoryRelative(path); | ||
| 13 | return res; | ||
| 14 | } | ||
| 15 | |||
| 9 | BISFactory::BISFactory(VirtualDir nand_root_) | 16 | BISFactory::BISFactory(VirtualDir nand_root_) |
| 10 | : nand_root(std::move(nand_root_)), | 17 | : nand_root(std::move(nand_root_)), |
| 11 | sysnand_cache(std::make_shared<RegisteredCache>( | 18 | sysnand_cache(std::make_shared<RegisteredCache>( |
| 12 | nand_root->GetDirectoryRelative("/system/Contents/registered"))), | 19 | GetOrCreateDirectory(nand_root, "/system/Contents/registered"))), |
| 13 | usrnand_cache(std::make_shared<RegisteredCache>( | 20 | usrnand_cache(std::make_shared<RegisteredCache>( |
| 14 | nand_root->GetDirectoryRelative("/user/Contents/registered"))) {} | 21 | GetOrCreateDirectory(nand_root, "/user/Contents/registered"))) {} |
| 15 | 22 | ||
| 16 | std::shared_ptr<RegisteredCache> BISFactory::GetSystemNANDContents() const { | 23 | std::shared_ptr<RegisteredCache> BISFactory::GetSystemNANDContents() const { |
| 17 | return sysnand_cache; | 24 | return sysnand_cache; |