diff options
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, |
