![]() |
ImFusion SDK 4.3
|
#include <ImFusion/IO/FolderLoader.h>
This class provides a very high level of abstraction for loading data from a directory. More...
This class provides a very high level of abstraction for loading data from a directory.
Public Types | |
enum class | Options { None = 0 , AllowSpawnGUI = 1 << 0 } |
Bitflag enumeration of options to customize the behavior of FolderLoader. More... | |
enum class | Status { Success = 0 , NotFound , NotFolder , MissingAppController , Error , Unknown } |
Known codes indicating the status/result of the last call to load(). More... | |
Public Member Functions | |
OwningDataList | load (const Filesystem::Path &folderPath, ApplicationController *appController, Flags< Options > loadOptions=Options::None) |
Attempts to load the folder at folderPath. | |
OwningDataList | load (const Filesystem::Url &folder, ApplicationController *appController, Flags< Options > loadOptions=Options::None) |
void | setProgress (Progress *progress) |
Progress interface is forwarded to the used IoAlgorithms. | |
FolderLoader::Status | status () |
Get detailed information about the status/result of the most recent call to load(). | |
std::vector< std::unique_ptr< IoAlgorithm > > | usedAlgorithms () |
Retrieve the IoAlgorithm instances used by load(). | |
std::vector< Filesystem::Path > | filesLoadedWithoutAlgorithms () const |
Files loaded without using algorithms, typically workspaces. | |
Additional Inherited Members | |
![]() | |
NotCopyable (NotCopyable &&) noexcept=default | |
NotCopyable & | operator= (NotCopyable &&) noexcept=default |
NotCopyable (const NotCopyable &)=delete | |
NotCopyable & | operator= (const NotCopyable &)=delete |
|
strong |
Bitflag enumeration of options to customize the behavior of FolderLoader.
Enumerator | |
---|---|
None | Use default options. |
AllowSpawnGUI | If set, allow for the loader to spawn a GUI. |
|
strong |
Known codes indicating the status/result of the last call to load().
Enumerator | |
---|---|
Success | Loading was successful. |
NotFound | The specified path does not exist. |
NotFolder | Path exists, but points to something that is not a folder. |
MissingAppController | Contained workspaces, but no ApplicationController was passed. |
Error | Other unknown error occurred when loading. |
Unknown | load() was not called |
OwningDataList load | ( | const Filesystem::Path & | folderPath, |
ApplicationController * | appController, | ||
Flags< Options > | loadOptions = Options::None ) |
Attempts to load the folder at folderPath.
Returns an OwningDataList with the loaded data if successful or an empty Optional on failure. After calling this function you can query details information on the result using status().
folderPath | Path to the file to load on the filesystem. |
appController | Optional pointer to an ApplicationController instance needed to enable workspace loading support. |
loadOptions | Enables you to customize the behavior or configure what file/directory types are accepted. |
|
inline |
Files loaded without using algorithms, typically workspaces.
Paths are relative to the loaded folder.