[#mrdocs-forEachFile-03] = xref:mrdocs.adoc[mrdocs]::forEachFile :relfileprefix: ../ :mrdocs: Call a function for each file in a directory. == Synopsis Declared in `<mrdocs/Support/Path.hpp>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:mrdocs/Expected-0a.adoc[Expected<void>] forEachFile( std::string_view dirPath, bool recursive, xref:mrdocs/AnyFileVisitor.adoc[AnyFileVisitor]& visitor); ---- == Description This will iterate all the regular files in a directory and invoke the visitor with the path. == Return Value An error if any occurred. == Parameters [cols="1,4"] |=== | Name| Description | *dirPath* | The path to the directory. | *recursive* | If true, files in subdirectories are also visited, recursively. | *visitor* | The visitor to invoke for each file. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#