[#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 `<bdls_filesystemutil.h>` Call the specified `visitor` function object for each path in the filesystem matching the specified `pattern`. Return the number of paths visited on success, and a negative value otherwise. 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. Also note that there is no guarantee as to the order in which paths will be visited. See `findMatchingPaths` for a discussion of how `pattern` is interpreted. Also note that `.` and `..` are never matched by wild cards. The parameterized `STRING_TYPE` must be one of `bsl::string`, `std::string`, `std::pmr::string` (if supported), `bsl::string_view`, or `bslstl::StringRef`. [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<void(char const*)>] const& visitor); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/visitPaths-042.adoc[_» more..._]# Same as the preceding overload, but accept a `pattern` of the (template parameter) `STRING_TYPE`, which must be one of `bsl::string`, `std::string`, `std::pmr::string` (if supported), `bslstl::StringRef`, or `bsl::string_view`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class STRING_TYPE> static int xref:BloombergLP/bdls/FilesystemUtil/visitPaths-046.adoc[visitPaths]( STRING_TYPE const& pattern, xref:bsl/function-0a.adoc[bsl::function<void(char const*)>] const& visitor); ---- [.small]#xref:BloombergLP/bdls/FilesystemUtil/visitPaths-046.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#