[#BloombergLP-bdls-FilesystemUtil-visitPaths-046]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdls.adoc[bdls]::xref:BloombergLP/bdls/FilesystemUtil.adoc[FilesystemUtil]::visitPaths
:relfileprefix: ../../../
:mrdocs:

Call `visitor` for each filesystem path matching the specified `pattern`&period;

== Synopsis

Declared in `&lt;bdls&lowbar;filesystemutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class STRING&lowbar;TYPE&gt;
static
int
visitPaths(
    STRING&lowbar;TYPE const& pattern,
    xref:bsl/function-0a.adoc[bsl::function&lt;void(char const*)&gt;] const& visitor);
----

== Description

Same as the preceding overload, but accept a `pattern` of the (template parameter) `STRING&lowbar;TYPE`, which must be one of `bsl&colon;&colon;string`, `std&colon;&colon;string`, `std&colon;&colon;pmr&colon;&colon;string` (if supported), `bslstl&colon;&colon;StringRef`, or `bsl&colon;&colon;string&lowbar;view`&period;

== Return Value

the number of paths visited on success, and a negative value otherwise

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pattern*
| glob&hyphen;style pattern of paths to visit
| *visitor*
| functor invoked with each matching path
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
