summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DiscExtractor.cpp
diff options
context:
space:
mode:
authorLeo Lam <leolino.lam@gmail.com>2017-09-15 19:30:05 +0200
committerGitHub <noreply@github.com>2017-09-15 19:30:05 +0200
commit7cb8d6612c6df51073037b56ebc866f180aecd71 (patch)
tree634e4c4d34472c6f2e49fbd48bebb6bb5f82de63 /Source/Core/DiscIO/DiscExtractor.cpp
parent7caf44c8b5a8a435ad1d9db3b2444db614d329eb (diff)
parentf294599e734f2391db9e74b6454752e75fdf368c (diff)
Merge pull request #5870 from JosJuice/lazy-filesystem
DiscIO: Use Common::Lazy more
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.cpp')
-rw-r--r--Source/Core/DiscIO/DiscExtractor.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/DiscExtractor.cpp b/Source/Core/DiscIO/DiscExtractor.cpp
index 310ca41e9a..e4f52713a5 100644
--- a/Source/Core/DiscIO/DiscExtractor.cpp
+++ b/Source/Core/DiscIO/DiscExtractor.cpp
@@ -61,6 +61,17 @@ u64 ReadFile(const Volume& volume, const Partition& partition, const FileInfo* f
return read_length;
}
+u64 ReadFile(const Volume& volume, const Partition& partition, const std::string& path, u8* buffer,
+ u64 max_buffer_size, u64 offset_in_file)
+{
+ const FileSystem* file_system = volume.GetFileSystem(partition);
+ if (!file_system)
+ return 0;
+
+ return ReadFile(volume, partition, file_system->FindFileInfo(path).get(), buffer, max_buffer_size,
+ offset_in_file);
+}
+
bool ExportData(const Volume& volume, const Partition& partition, u64 offset, u64 size,
const std::string& export_filename)
{
@@ -98,6 +109,16 @@ bool ExportFile(const Volume& volume, const Partition& partition, const FileInfo
export_filename);
}
+bool ExportFile(const Volume& volume, const Partition& partition, const std::string& path,
+ const std::string& export_filename)
+{
+ const FileSystem* file_system = volume.GetFileSystem(partition);
+ if (!file_system)
+ return false;
+
+ return ExportFile(volume, partition, file_system->FindFileInfo(path).get(), export_filename);
+}
+
void ExportDirectory(const Volume& volume, const Partition partition, const FileInfo& directory,
bool recursive, const std::string& filesystem_path,
const std::string& export_folder,