diff options
| author | JosJuice <josjuice@gmail.com> | 2017-08-02 18:16:56 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2017-09-15 18:57:05 +0200 |
| commit | 38304da947c6b593ef94449894dc018aac633344 (patch) | |
| tree | d6d79c531ef8363a302487ec70bd9d859fcb9c35 /Source/Core/DiscIO/DiscExtractor.cpp | |
| parent | 0d078219358b04266206ea1e2622396db7724136 (diff) | |
DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us
clean up FilesystemPanel.
Diffstat (limited to 'Source/Core/DiscIO/DiscExtractor.cpp')
| -rw-r--r-- | Source/Core/DiscIO/DiscExtractor.cpp | 21 |
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, |
