Search Results
The RecursiveDirectoryIterator class Introduction ¶ The RecursiveDirectoryIterator provides an interface for iterating recursively over filesystem directories.
- Recursiveiteratoriterator
The RecursiveIteratorIterator class
- Directoryiterator
The DirectoryIterator class Introduction ¶ The...
- Splfileinfo
The SplFileInfo class Introduction ¶ The SplFileInfo class...
- Splfileobject
Introduction ¶ The SplFileObject class offers an...
- Recursivearrayiterator
The RecursiveArrayIterator class If you are iterating over a...
- Filesystemiterator
Table of Contents ¶ FilesystemIterator::__construct —...
- Regexiterator
The RegexIterator class In case the difference between modes...
- Cachingiterator
Table of Contents ¶ CachingIterator::__construct — Construct...
- Recursiveiteratoriterator
- In this article
- Remarks
- recursive_directory_iterator::depth
- recursive_directory_iterator::increment
- recursive_directory_iterator::operator!=
- recursive_directory_iterator::operator=
- recursive_directory_iterator::operator==
- recursive_directory_iterator::operator*
- recursive_directory_iterator::operator-
- recursive_directory_iterator::operator++
Describes an input iterator that sequences through the filenames in a directory, possibly descending into subdirectories recursively. For an iterator X, the expression *X evaluates to an object of class directory_entry that wraps the filename and anything known about its status.
For more information and code examples, see
an object of type stack >, called mystack here for the purposes of exposition, which represents the nest of directories to be sequenced
an object of type directory_entry called myentry here, which represents the current filename in the directory sequence
, called no_push here, which records whether recursive descent into subdirectories is disabled
an object of type directory_options, called myoptions here, which records the options established at construction
A default constructed object of type recursive_directory_entry has an end-of-sequence iterator at mystack.top ().first and represents the end-of-sequence iterator. For example, given the directory abc with entries def (a directory), def/ghi, and jkl, the code:
will call visit with the arguments path ("abc/def/ghi") and path ("abc/jkl"). You can qualify sequencing through a directory subtree in two ways:
Returns mystack.size () - 1, so pval is at depth zero.
Advances to the next filename in sequence.
recursive_directory_iterator& increment(error_code& ec) noexcept;
Returns ! (*this == right).
bool operator!=(const recursive_directory_iterator& right) const;
The defaulted member assignment operators behave as expected.
recursive_directory_iterator& operator=(const recursive_directory_iterator&) = default;
recursive_directory_iterator& operator=(recursive_directory_iterator&&) noexcept = default;
being copied into the recursive_directory_iterator.
are end-of-sequence iterators or both aren't end-of-sequence-iterators.
bool operator==(const recursive_directory_iterator& right) const;
const directory_entry& operator*() const;
const directory_entry * operator->() const;
The first member function calls increment (), then returns
The second member function makes a copy of the object, calls increment (), then returns the copy.
RecursiveDirectoryIterator::next 26 déc. 2018 16 fois (PHP 5, PHP 7, PHP 8) RecursiveDirectoryIterator::next — Se déplace vers la prochaine entrée
These specializations for recursive_directory_iterator make it a borrowed_range and a view. Notes A recursive_directory_iterator typically holds a reference-counted pointer (to satisfy shallow-copy semantics of LegacyInputIterator) to an implementation object, which holds: a container (such as std::vector) of non-recursive directory_iterator s that forms the recursion stack, the recursion ...
RecursiveDirectoryIterator::key — Return path and filename of current dir entry RecursiveDirectoryIterator::next — Move to next entry RecursiveDirectoryIterator::rewind — Rewind dir back to the start
Sep 6, 2023 · 4-7) Constructs an iterator that refers to the first entry in the directory that p resolves to.
People also ask
What is recursivedirectoryiterator?
How to recursively call a function with a directory?
How to recursively traverse a directory?
How do you increment a recursive directory?
How do you iterate through every file/directory recursively in standard C++?
