Back to Adaptive Vision Library website

You are here: Start » Function Reference » System » File System » FindFiles


Header: STD.h
Namespace: avl
Module: FoundationLite

Returns files of the input directory.


void avl::FindFiles
	const atl::Directory& inStartDirectory,
	const atl::String& inMask,
	bool inSubdirs,
	atl::Optional<avl::FileSortingOrder::Type> inSortingOrder,
	atl::Array<atl::File>& outFilePaths,
	atl::Array<atl::String>& outFileNames,
	bool& outFound = atl::Dummy<bool>()


Name Type Default Description
Input value
inStartDirectory const Directory& \".\" Input directory
Input value
inMask const String& \"*\" Wildcard pattern
Input value
inSubdirs bool Read subdirectories
Input value
inSortingOrder Optional<FileSortingOrder::Type> NIL Sorting order
Output value
outFilePaths Array<File>& File paths
Output value
outFileNames Array<String>& File names
Output value
outFound bool& Dummy<bool>()


Working with Find Files
Start with defining a directory path in inStartDirectory port to choose where you want to look for files. To search files in subdirectories set inSubdirs to 'true'.
inMask pattern string
Port inMask specifies wildcard pattern that selects files this filter will operate on. Supported wildcards:
  • * - any string of characters, including no characters
  • ? - exactly one character
You can use any expression like examples below:
  • * - all files,
  • *.jpg - files only with extension .jpg,
  • Filename.* - files with name "Filename" and any extension, including no extension e.g. "Filename."
  • Filename.?? - files with name "Filename" and two letter extension,


List of possible exceptions:

Error type Description
DomainError Given start directory is invalid in FindFiles.
IoError Error opening start directory in FindFiles.

See Also