Răsfoiți Sursa

sdmc_factory: Add accessor for SDMC PlaceholderCache

Zach Hilman 7 ani în urmă
părinte
comite
0084cceb20
2 a modificat fișierele cu 10 adăugiri și 1 ștergeri
  1. 7 1
      src/core/file_sys/sdmc_factory.cpp
  2. 3 0
      src/core/file_sys/sdmc_factory.h

+ 7 - 1
src/core/file_sys/sdmc_factory.cpp

@@ -14,7 +14,9 @@ SDMCFactory::SDMCFactory(VirtualDir dir_)
                                 GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"),
                                 GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/registered"),
                                 [](const VirtualFile& file, const NcaID& id) {
                                 [](const VirtualFile& file, const NcaID& id) {
                                     return NAX{file, id}.GetDecrypted();
                                     return NAX{file, id}.GetDecrypted();
-                                })) {}
+                                })),
+      placeholder(std::make_unique<PlaceholderCache>(
+          GetOrCreateDirectoryRelative(dir, "/Nintendo/Contents/placehld"))) {}
 
 
 SDMCFactory::~SDMCFactory() = default;
 SDMCFactory::~SDMCFactory() = default;
 
 
@@ -30,4 +32,8 @@ RegisteredCache* SDMCFactory::GetSDMCContents() const {
     return contents.get();
     return contents.get();
 }
 }
 
 
+PlaceholderCache* SDMCFactory::GetSDMCPlaceholder() const {
+    return placeholder.get();
+}
+
 } // namespace FileSys
 } // namespace FileSys

+ 3 - 0
src/core/file_sys/sdmc_factory.h

@@ -11,6 +11,7 @@
 namespace FileSys {
 namespace FileSys {
 
 
 class RegisteredCache;
 class RegisteredCache;
+class PlaceholderCache;
 
 
 /// File system interface to the SDCard archive
 /// File system interface to the SDCard archive
 class SDMCFactory {
 class SDMCFactory {
@@ -23,11 +24,13 @@ public:
     VirtualDir GetSDMCContentDirectory() const;
     VirtualDir GetSDMCContentDirectory() const;
 
 
     RegisteredCache* GetSDMCContents() const;
     RegisteredCache* GetSDMCContents() const;
+    PlaceholderCache* GetSDMCPlaceholder() const;
 
 
 private:
 private:
     VirtualDir dir;
     VirtualDir dir;
 
 
     std::unique_ptr<RegisteredCache> contents;
     std::unique_ptr<RegisteredCache> contents;
+    std::unique_ptr<PlaceholderCache> placeholder;
 };
 };
 
 
 } // namespace FileSys
 } // namespace FileSys