28 : wildCards (parseWildcards (
pattern)),
31 path (
File::addTrailingSeparator (
directory.getFullPathName())),
37 jassert (type > 0 && type <= 7);
49 s.removeEmptyStrings();
53bool DirectoryIterator::fileMatches (
const StringArray& wildcards,
const String& filename)
55 for (
auto& w : wildcards)
56 if (filename.matchesWildcard (w, ! File::areFileNamesCaseSensitive()))
64 return next (
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr);
72 hasBeenAdvanced =
true;
74 if (subIterator !=
nullptr)
85 while (fileFinder.next (filename, &isDirectory,
99 true, wildCard, whatToLookFor));
109 if (matches && (isRecursive || wildCards.
size() > 1))
110 matches = fileMatches (wildCards, filename);
113 matches = ! isHidden;
124 if (subIterator !=
nullptr)
139 if (subIterator !=
nullptr && subIterator->hasBeenAdvanced)
140 return subIterator->getFile();
143 jassert (hasBeenAdvanced);
150 if (totalNumFiles < 0)
153 if (totalNumFiles <= 0)
156 auto detailedIndex = (subIterator !=
nullptr) ? index + subIterator->getEstimatedProgress()
Holds a resizable array of primitive or copy-by-value objects.
Searches through the files in a directory, returning each file that is found.
const File & getFile() const
Returns the file that the iterator is currently pointing at.
bool next()
Moves the iterator along to the next file.
float getEstimatedProgress() const
Returns a guess of how far through the search the iterator has got.
DirectoryIterator(const File &directory, bool isRecursive, const String &wildCard="*", int whatToLookFor=File::findFiles)
Creates a DirectoryIterator for a given directory.
~DirectoryIterator()
Destructor.
Represents a local file or directory.
int getNumberOfChildFiles(int whatToLookFor, const String &wildCardPattern="*") const
Searches inside a directory and counts how many files match a wildcard pattern.
@ ignoreHiddenFiles
Add this flag to avoid returning any hidden files in the results.
@ findDirectories
Use this flag to indicate that you want to find directories.
@ findFilesAndDirectories
Use this flag to indicate that you want to find both files and directories.
@ findFiles
Use this flag to indicate that you want to find files.
static File createFileWithoutCheckingPath(const String &absolutePath) noexcept
Creates a file that simply contains this string, without doing the sanity-checking that the normal co...
A special array for holding a list of strings.
int size() const noexcept
Returns the number of strings in the array.
bool containsOnly(StringRef charactersItMightContain) const noexcept
Looks for a set of characters in the string.
Holds an absolute date and time.