Implemented allBundles

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4075 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-04-14 08:48:32 +00:00
parent 05286efbe9
commit a7f9d28f0d
2 changed files with 20 additions and 1 deletions

View file

@ -267,7 +267,21 @@ _bundle_load_callback(Class theClass, Category *theCategory)
+ (NSArray *) allBundles
{
return [self notImplemented: _cmd];
NSMapEnumerator enumerate;
NSMutableArray *array = [NSMutableArray arrayWithCapacity: 2];
void *key;
NSBundle *bundle;
enumerate = NSEnumerateMapTable(_bundles);
while (NSNextMapEnumeratorPair(&enumerate, &key, (void **)&bundle))
{
if ([array indexOfObjectIdenticalTo: bundle] == NSNotFound)
{
/* FIXME - must ignore frameworks here */
[array addObject: bundle];
}
}
return array;
}
+ (NSArray *) allFrameworks