diff options
author | Zach Hilman <zachhilman@gmail.com> | 2018-08-16 23:06:56 +0200 |
---|---|---|
committer | Zach Hilman <zachhilman@gmail.com> | 2018-08-23 17:53:30 +0200 |
commit | 13524578b602a264a3925c5f4a2ce9607541d2fc (patch) | |
tree | 5d30961c9528446156add23e6804514c50de9ff9 | |
parent | qt: Make default row data title name and title id (diff) | |
download | yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar.gz yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar.bz2 yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar.lz yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar.xz yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.tar.zst yuzu-13524578b602a264a3925c5f4a2ce9607541d2fc.zip |
-rw-r--r-- | src/core/file_sys/sdmc_factory.cpp | 12 | ||||
-rw-r--r-- | src/core/file_sys/sdmc_factory.h | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/core/file_sys/sdmc_factory.cpp b/src/core/file_sys/sdmc_factory.cpp index d1acf379f..b14a254c5 100644 --- a/src/core/file_sys/sdmc_factory.cpp +++ b/src/core/file_sys/sdmc_factory.cpp @@ -4,13 +4,23 @@ #include <memory> #include "core/file_sys/sdmc_factory.h" +#include "core/file_sys/xts_archive.h" namespace FileSys { -SDMCFactory::SDMCFactory(VirtualDir dir) : dir(std::move(dir)) {} +SDMCFactory::SDMCFactory(VirtualDir dir_) + : dir(std::move(dir_)), contents(std::make_shared<RegisteredCache>( + GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"), + [](const VirtualFile& file, const NcaID& id) { + return std::make_shared<NAX>(file, id)->GetDecrypted(); + })) {} ResultVal<VirtualDir> SDMCFactory::Open() { return MakeResult<VirtualDir>(dir); } +std::shared_ptr<RegisteredCache> SDMCFactory::GetSDMCContents() const { + return contents; +} + } // namespace FileSys diff --git a/src/core/file_sys/sdmc_factory.h b/src/core/file_sys/sdmc_factory.h index 245060690..bb579472c 100644 --- a/src/core/file_sys/sdmc_factory.h +++ b/src/core/file_sys/sdmc_factory.h @@ -15,9 +15,12 @@ public: explicit SDMCFactory(VirtualDir dir); ResultVal<VirtualDir> Open(); + std::shared_ptr<RegisteredCache> GetSDMCContents() const; private: VirtualDir dir; + + std::shared_ptr<RegisteredCache> contents; }; } // namespace FileSys |