29 Input/output library [input.output]

29.11 File systems [filesystems]

29.11.12 Class directory_­iterator [fs.class.directory.iterator]

29.11.12.1 Members [fs.dir.itr.members]

directory_iterator() noexcept;
Effects: Constructs the end iterator.
explicit directory_iterator(const path& p); directory_iterator(const path& p, directory_options options); directory_iterator(const path& p, error_code& ec); directory_iterator(const path& p, directory_options options, error_code& ec);
Effects: For the directory that p resolves to, constructs an iterator for the first element in a sequence of directory_­entry elements representing the files in the directory, if any; otherwise the end iterator.
However, if
(options & directory_options::skip_permission_denied) != directory_options::none
and construction encounters an error indicating that permission to access p is denied, constructs the end iterator and does not report an error.
Throws: As specified in [fs.err.report].
Note
:
To iterate over the current directory, use directory_­iterator(".") rather than directory_­iterator("").
— end note
 ]
directory_iterator(const directory_iterator& rhs); directory_iterator(directory_iterator&& rhs) noexcept;
Postconditions: *this has the original value of rhs.
directory_iterator& operator=(const directory_iterator& rhs); directory_iterator& operator=(directory_iterator&& rhs) noexcept;
Effects: If *this and rhs are the same object, the member has no effect.
Postconditions: *this has the original value of rhs.
Returns: *this.
directory_iterator& operator++(); directory_iterator& increment(error_code& ec);
Effects: As specified for the prefix increment operation of Input iterators.
Returns: *this.
Throws: As specified in [fs.err.report].