Back to Adaptive Vision Library website

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

FindFiles


Header: STD.h
Namespace: avl
Module: FoundationLite

Returns files of the input directory.

Syntax

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

Parameters

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

Remarks

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:
Examples:
  • * - 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,

Errors

List of possible exceptions:

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

See Also