ImFusion SDK 4.3
FolderLoader Class Reference

#include <ImFusion/IO/FolderLoader.h>

This class provides a very high level of abstraction for loading data from a directory. More...

+ Inheritance diagram for FolderLoader:

Detailed Description

This class provides a very high level of abstraction for loading data from a directory.

See also
FileLoader, FactoryRegistry, IoAlgorithm

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::PathfilesLoadedWithoutAlgorithms () const
 Files loaded without using algorithms, typically workspaces.
 

Additional Inherited Members

- Protected Member Functions inherited from NotCopyable
 NotCopyable (NotCopyable &&) noexcept=default
 
NotCopyableoperator= (NotCopyable &&) noexcept=default
 
 NotCopyable (const NotCopyable &)=delete
 
NotCopyableoperator= (const NotCopyable &)=delete
 

Member Enumeration Documentation

◆ Options

enum class Options
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.

◆ Status

enum class Status
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

Member Function Documentation

◆ load()

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().

Parameters
folderPathPath to the file to load on the filesystem.
appControllerOptional pointer to an ApplicationController instance needed to enable workspace loading support.
loadOptionsEnables you to customize the behavior or configure what file/directory types are accepted.

◆ filesLoadedWithoutAlgorithms()

std::vector< Filesystem::Path > filesLoadedWithoutAlgorithms ( ) const
inline

Files loaded without using algorithms, typically workspaces.

Paths are relative to the loaded folder.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close