xtd 0.2.0
Loading...
Searching...
No Matches

◆ enumerate_file_system_infos() [2/2]

xtd::io::directory_info::file_system_info_iterator xtd::io::directory_info::enumerate_file_system_infos ( const xtd::string search_pattern) const

Returns an enumerable collection of file system information that matches a specified search pattern.

Parameters
search_patternThe search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions.
Returns
An xtd::io::directory_info::file_system_info_iterator of file system information objects that matches search_pattern.
Exceptions
xtd::io::directory_not_found_exceptionThe specified path is invalid, such as being on an unmapped drive.
xtd::security::security_exceptionThe caller does not have code access permission to create the directory.
Remarks
search_pattern can be a combination of literal and wildcard characters, but it doesn't support regular expressions. The following wildcard specifiers are permitted in search_pattern.
Wildcard specifier Matches
* (asterisk) Zero or more characters in that position.
 ? (question mark) Zero or one character in that position.
Characters other than the wildcard are literal characters. For example, the string "*t" searches for all names in ending with the letter "t". ". The search_pattern string "s*" searches for all names in path beginning with the letter "s".
The xtd::io::directory_info::enumerate_file_system_infos and xtd::io::directory_info::get_file_system_infos methods differ as follows:
Therefore, when you are working with many files and directories, xtd::io::directory_info::enumerate_file_system_infos can be more efficient.
This method pre-populates the values of the following xtd::io::directory_info properties: