DiscIO: Add functions CreateDisc and CreateWAD

...in addition to the existing function CreateVolume
(renamed from CreateVolumeFromFilename).

Lets code easily add constraints such as not letting the user
select a WAD file when using the disc changing functionality.
This commit is contained in:
JosJuice 2019-07-14 15:49:42 +02:00
commit 0f5a4b37ee
15 changed files with 91 additions and 54 deletions

View file

@ -581,8 +581,7 @@ class DiscSystemUpdater final : public SystemUpdater
{
public:
DiscSystemUpdater(UpdateCallback update_callback, const std::string& image_path)
: m_update_callback{std::move(update_callback)}, m_volume{DiscIO::CreateVolumeFromFilename(
image_path)}
: m_update_callback{std::move(update_callback)}, m_volume{DiscIO::CreateDisc(image_path)}
{
}
UpdateResult DoDiscUpdate();
@ -621,7 +620,7 @@ private:
std::string_view path);
UpdateCallback m_update_callback;
std::unique_ptr<DiscIO::Volume> m_volume;
std::unique_ptr<DiscIO::VolumeDisc> m_volume;
DiscIO::Partition m_partition;
};