Allows iterating over files and folders using C++11 range-for syntax.
More...
#include <juce_RangedDirectoryIterator.h>
Allows iterating over files and folders using C++11 range-for syntax.
In the following example, we recursively find all hidden files in a specific directory.
std::vector<File> hiddenFiles;
hiddenFiles.push_back (
entry.getFile());
Describes the attributes of a file or folder.
Definition juce_RangedDirectoryIterator.h:47
Represents a local file or directory.
Definition juce_File.h:59
Allows iterating over files and folders using C++11 range-for syntax.
Definition juce_RangedDirectoryIterator.h:111
DirectoryEntry entry
Definition juce_RangedDirectoryIterator.h:184
@tags{Core}
◆ difference_type
◆ iterator_category
◆ pointer
◆ reference
◆ value_type
◆ RangedDirectoryIterator() [1/2]
| juce::RangedDirectoryIterator::RangedDirectoryIterator |
( |
| ) |
|
|
default |
The default-constructed iterator acts as the 'end' sentinel.
◆ RangedDirectoryIterator() [2/2]
Creates a RangedDirectoryIterator for a given directory.
The resulting iterator can be used directly in a 'range-for' expression.
- Parameters
-
| directory | the directory to search in |
| isRecursive | whether all the subdirectories should also be searched |
| wildCard | the file pattern to match. This may contain multiple patterns separated by a semi-colon or comma, e.g. "*.jpg;*.png" |
| whatToLookFor | a value from the File::TypesOfFileToFind enum, specifying whether to look for files, directories, or both. |
| followSymlinks | the policy to use when symlinks are encountered |
◆ increment()
| void juce::RangedDirectoryIterator::increment |
( |
| ) |
|
|
private |
◆ next()
| bool juce::RangedDirectoryIterator::next |
( |
| ) |
|
|
private |
◆ operator!=()
Returns the inverse of operator==.
◆ operator*()
| const DirectoryEntry & juce::RangedDirectoryIterator::operator* |
( |
| ) |
const |
|
inlinenoexcept |
Return an object containing metadata about the file or folder to which the iterator is currently pointing.
◆ operator++() [1/2]
Moves the iterator along to the next file.
◆ operator++() [2/2]
Moves the iterator along to the next file.
- Returns
- an object containing metadata about the file or folder to to which the iterator was previously pointing.
◆ operator->()
| const DirectoryEntry * juce::RangedDirectoryIterator::operator-> |
( |
| ) |
const |
|
inlinenoexcept |
◆ operator==()
Returns true if both iterators are in their end/sentinel state, otherwise returns false.
◆ entry
◆ iterator
| std::shared_ptr<DirectoryIterator> juce::RangedDirectoryIterator::iterator |
|
private |
The documentation for this class was generated from the following file: