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

`visitPaths` overloads

== Synopses

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

Call the specified `visitor` function object for each path in the filesystem matching the specified `pattern`&period; Return the number of paths visited on success, and a negative value otherwise&period; Note that if `visitor` deletes files or directories during the search, `visitor` may subsequently be called with paths which have already been deleted, so must be prepared for this event&period; Also note that there is no guarantee as to the order in which paths will be visited&period; See `findMatchingPaths` for a discussion of how `pattern` is interpreted&period; Also note that `&period;` and `&period;&period;` are never matched by wild cards&period; The parameterized `STRING&lowbar;TYPE` must be one of `bsl&colon;&colon;string`, `std&colon;&colon;string`, `std&colon;&colon;pmr&colon;&colon;string` (if supported), `bsl&colon;&colon;string&lowbar;view`, or `bslstl&colon;&colon;StringRef`&period;


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

[.small]#xref:BloombergLP/bdls/FilesystemUtil/visitPaths-042.adoc[_» more&period;&period;&period;_]#

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;


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

[.small]#xref:BloombergLP/bdls/FilesystemUtil/visitPaths-046.adoc[_» more&period;&period;&period;_]#


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