1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

fix for a mac file bug introduced in the last check-in..

This commit is contained in:
Julian Storer 2009-10-12 14:39:43 +01:00
parent 1acee444d1
commit 0280c57ff0
19 changed files with 157 additions and 143 deletions

View file

@ -333,4 +333,3 @@ int main (int argc, char* argv[])
return 0;
}

View file

@ -258063,7 +258063,7 @@ bool File::moveToTrash() const throw()
struct FindFileStruct
{
NSDirectoryEnumerator* enumerator;
String parentDir;
String parentDir, wildCard;
};
bool juce_findFileNext (void* handle, String& resultFile,
@ -258071,13 +258071,19 @@ bool juce_findFileNext (void* handle, String& resultFile,
{
FindFileStruct* ff = (FindFileStruct*) handle;
NSString* file;
const char* const wildcardUTF8 = ff->wildCard.toUTF8();
for (;;)
{
if (ff == 0 || (file = [ff->enumerator nextObject]) == 0)
return false;
[ff->enumerator skipDescendents];
resultFile = nsStringToJuce (file);
if (fnmatch (wildcardUTF8, resultFile.toUTF8(), FNM_CASEFOLD) != 0)
continue;
const String path (ff->parentDir + resultFile);
if (isDir != 0 || fileSize != 0)
@ -258112,6 +258118,7 @@ bool juce_findFileNext (void* handle, String& resultFile,
return true;
}
}
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime,
@ -258124,6 +258131,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin
FindFileStruct* ff = new FindFileStruct();
ff->enumerator = [e retain];
ff->parentDir = directory;
ff->wildCard = wildCard;
if (! ff->parentDir.endsWithChar (File::separator))
ff->parentDir += File::separator;

View file

@ -26,4 +26,3 @@
// This file just wraps juce_VSTPluginFormat.cpp in an objective-C wrapper
#define JUCE_MAC_VST_INCLUDED 1
#include "juce_VSTPluginFormat.cpp"

View file

@ -334,7 +334,7 @@ bool File::moveToTrash() const throw()
struct FindFileStruct
{
NSDirectoryEnumerator* enumerator;
String parentDir;
String parentDir, wildCard;
};
bool juce_findFileNext (void* handle, String& resultFile,
@ -342,13 +342,19 @@ bool juce_findFileNext (void* handle, String& resultFile,
{
FindFileStruct* ff = (FindFileStruct*) handle;
NSString* file;
const char* const wildcardUTF8 = ff->wildCard.toUTF8();
for (;;)
{
if (ff == 0 || (file = [ff->enumerator nextObject]) == 0)
return false;
[ff->enumerator skipDescendents];
resultFile = nsStringToJuce (file);
if (fnmatch (wildcardUTF8, resultFile.toUTF8(), FNM_CASEFOLD) != 0)
continue;
const String path (ff->parentDir + resultFile);
if (isDir != 0 || fileSize != 0)
@ -383,6 +389,7 @@ bool juce_findFileNext (void* handle, String& resultFile,
return true;
}
}
void* juce_findFileStart (const String& directory, const String& wildCard, String& firstResultFile,
bool* isDir, bool* isHidden, int64* fileSize, Time* modTime,
@ -395,6 +402,7 @@ void* juce_findFileStart (const String& directory, const String& wildCard, Strin
FindFileStruct* ff = new FindFileStruct();
ff->enumerator = [e retain];
ff->parentDir = directory;
ff->wildCard = wildCard;
if (! ff->parentDir.endsWithChar (File::separator))
ff->parentDir += File::separator;