mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Moved a couple of static functions.
This commit is contained in:
parent
265fb0e8eb
commit
ef486ad07d
2 changed files with 21 additions and 18 deletions
|
|
@ -26,24 +26,6 @@
|
|||
==============================================================================
|
||||
*/
|
||||
|
||||
static StringArray parseWildcards (const String& pattern)
|
||||
{
|
||||
StringArray s;
|
||||
s.addTokens (pattern, ";,", "\"'");
|
||||
s.trim();
|
||||
s.removeEmptyStrings();
|
||||
return s;
|
||||
}
|
||||
|
||||
static bool fileMatches (const StringArray& wildCards, const String& filename)
|
||||
{
|
||||
for (int i = 0; i < wildCards.size(); ++i)
|
||||
if (filename.matchesWildcard (wildCards[i], ! File::areFileNamesCaseSensitive()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
DirectoryIterator::DirectoryIterator (const File& directory, bool recursive,
|
||||
const String& pattern, const int type)
|
||||
: wildCards (parseWildcards (pattern)),
|
||||
|
|
@ -65,6 +47,24 @@ DirectoryIterator::~DirectoryIterator()
|
|||
{
|
||||
}
|
||||
|
||||
StringArray DirectoryIterator::parseWildcards (const String& pattern)
|
||||
{
|
||||
StringArray s;
|
||||
s.addTokens (pattern, ";,", "\"'");
|
||||
s.trim();
|
||||
s.removeEmptyStrings();
|
||||
return s;
|
||||
}
|
||||
|
||||
bool DirectoryIterator::fileMatches (const StringArray& wildCards, const String& filename)
|
||||
{
|
||||
for (int i = 0; i < wildCards.size(); ++i)
|
||||
if (filename.matchesWildcard (wildCards[i], ! File::areFileNamesCaseSensitive()))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DirectoryIterator::next()
|
||||
{
|
||||
return next (nullptr, nullptr, nullptr, nullptr, nullptr, nullptr);
|
||||
|
|
|
|||
|
|
@ -153,6 +153,9 @@ private:
|
|||
ScopedPointer <DirectoryIterator> subIterator;
|
||||
File currentFile;
|
||||
|
||||
static StringArray parseWildcards (const String& pattern);
|
||||
static bool fileMatches (const StringArray& wildCards, const String& filename);
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (DirectoryIterator)
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue