Back to FabImage Library website
You are here: Start » Function Reference » System » File System » EnumerateFiles_Random
Header: | STD.h |
---|---|
Namespace: | fil |
Module: | FoundationLite |
Enumerates the files present in a disk directory sorted randomly.
Syntax
bool fil::EnumerateFiles_Random ( EnumerateFilesState& ioState, const ftl::Directory& inDirectory, const ftl::String& inExtensions, ftl::Optional<int> inSeed, bool inRepeat, bool inProcessSubdirectories, bool inInvert, ftl::File& outFilePath, ftl::String& outFileName, ftl::Optional<bool> outIsFirst = ftl::NIL, ftl::Optional<bool> outIsLast = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
ioState | EnumerateFilesState& | Object used to maintain state of the function. | |
![]() |
inDirectory | const Directory& | Input directory | |
![]() |
inExtensions | const String& | Allowed extensions separated by semicolon | |
![]() |
inSeed | Optional<int> | Random seed used to determine random sorting order | |
![]() |
inRepeat | bool | Determines whether to repeat reading directory after reading all files | |
![]() |
inProcessSubdirectories | bool | Flag indicating whether to enumerate files from the subdirectories or not | |
![]() |
inInvert | bool | Flag indicating whether to enumerate files backwards or not | |
![]() |
outFilePath | File& | Output file path | |
![]() |
outFileName | String& | Output file name | |
![]() |
outIsFirst | Optional<bool> | NIL | Flag indicating the first iteration |
![]() |
outIsLast | Optional<bool> | NIL | Flag indicating the last iteration |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outIsFirst, outIsLast.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Cannot sort by file creation date on Linux. |
DomainError | Directory doesn't exist: Directory path |
DomainError | Empty string is not a valid directory path. |