This class can be used as an iterator to find all files and subdirectories within a directory tree.
In the following example, the ProcessFiles function calls a functor object, specified as the processFile function argument, for each file found recursively in the specified dirPath directory. The functor's unique argument is the absolute file path of an existing file.
template <class F>
void ProcessFiles( const String& dirPath, F processFile )
{
for ( File::Find f( dirPath + '/' + '*' ); f.NextItem( info ); )
{
if ( info.
name !=
"." && info.
name !=
".." )
directories << info.
name;
}
{
}
for ( const String& dir : directories )
ProcessFiles( dirPath + '/' + dir );
}
static String FullPath(const String &path)
constexpr bool IsFlagSet(enum_type e) const
Dynamic list of Unicode (UTF-16) strings.
File information structure used by File::Find
String name
File or directory name, including the file name extension.
FileAttributes attributes
Item attributes.
- See also
- FindFileInfo
Definition at line 458 of file File.h.