mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
DiscIO: Use Common::Lazy for loading filesystems
This simplifies FileMonitor a lot and also lets us clean up FilesystemPanel.
This commit is contained in:
@ -109,8 +109,7 @@ public:
|
||||
FileSystem(const Volume* volume, const Partition& partition);
|
||||
virtual ~FileSystem();
|
||||
|
||||
// If IsValid is false, GetRoot must not be called. CreateFileSystem
|
||||
// takes care of this automatically, so other code is recommended to use it.
|
||||
// If IsValid is false, GetRoot must not be called.
|
||||
virtual bool IsValid() const = 0;
|
||||
// The object returned by GetRoot and all objects created from it
|
||||
// are only valid for as long as the file system object is valid.
|
||||
@ -126,7 +125,8 @@ protected:
|
||||
const Partition m_partition;
|
||||
};
|
||||
|
||||
// Returns nullptr if a valid file system could not be created
|
||||
std::unique_ptr<FileSystem> CreateFileSystem(const Volume* volume, const Partition& partition);
|
||||
// Calling Volume::GetFileSystem instead of manually constructing a filesystem is recommended,
|
||||
// because it will check IsValid for you, will automatically pick the right type of filesystem,
|
||||
// and will cache the filesystem in case it's needed again later.
|
||||
|
||||
} // namespace
|
||||
|
Reference in New Issue
Block a user