summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/directory_sdmc.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-12-07 23:40:27 +0100
committerarchshift <admin@archshift.com>2014-12-07 23:47:14 +0100
commit20d2ed09502f41519beb435a1300f2a57995c651 (patch)
tree4d58349bdfc1ab122d522780c1d9692832ce9ad0 /src/core/file_sys/directory_sdmc.cpp
parentMerge pull request #250 from Subv/cbranch_2 (diff)
downloadyuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar.gz
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar.bz2
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar.lz
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar.xz
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.tar.zst
yuzu-20d2ed09502f41519beb435a1300f2a57995c651.zip
Diffstat (limited to 'src/core/file_sys/directory_sdmc.cpp')
-rw-r--r--src/core/file_sys/directory_sdmc.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/core/file_sys/directory_sdmc.cpp b/src/core/file_sys/directory_sdmc.cpp
index 60a197ce9..0f156a127 100644
--- a/src/core/file_sys/directory_sdmc.cpp
+++ b/src/core/file_sys/directory_sdmc.cpp
@@ -19,15 +19,22 @@ Directory_SDMC::Directory_SDMC(const Archive_SDMC* archive, const Path& path) {
// TODO(Link Mauve): normalize path into an absolute path without "..", it can currently bypass
// the root directory we set while opening the archive.
// For example, opening /../../usr/bin can give the emulated program your installed programs.
- std::string absolute_path = archive->GetMountPoint() + path.AsString();
- FileUtil::ScanDirectoryTree(absolute_path, directory);
- children_iterator = directory.children.begin();
+ this->path = archive->GetMountPoint() + path.AsString();
+
}
Directory_SDMC::~Directory_SDMC() {
Close();
}
+bool Directory_SDMC::Open() {
+ if (!FileUtil::IsDirectory(path))
+ return false;
+ FileUtil::ScanDirectoryTree(path, directory);
+ children_iterator = directory.children.begin();
+ return true;
+}
+
/**
* List files contained in the directory
* @param count Number of entries to return at once in entries