OS X: Make PluginList comply with the NSFastEnumeration protocol.

git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91643 e17a0e51-4ae3-4d35-97c3-1a29b211df97
This commit is contained in:
SND\MaddTheSane_cp 2014-09-27 19:35:23 +00:00
parent 637f97d9db
commit 5932a2148f
3 changed files with 21 additions and 3 deletions

View File

@ -369,7 +369,7 @@
- (NSUInteger)hash
{
return [path hash];
return [fullPlugPath hash];
}
- (NSString *)description

View File

@ -10,8 +10,9 @@
#import "PcsxrPlugin.h"
//extern NSMutableArray *plugins;
@class PcsxrPlugin;
@interface PluginList : NSObject
@interface PluginList : NSObject <NSFastEnumeration>
+ (PluginList *)list;
@ -25,4 +26,7 @@
- (void)disableNetPlug;
- (void)enableNetPlug;
- (PcsxrPlugin*)objectAtIndexedSubscript:(NSInteger)index;
- (NSInteger)count;
@end

View File

@ -312,7 +312,21 @@ const static int typeList[] = {PSE_LT_GPU, PSE_LT_SPU, PSE_LT_CDR, PSE_LT_PAD, P
dst++;
}
}
}
- (NSInteger)count;
{
return self.pluginList.count;
}
- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id [])buffer count:(NSUInteger)len
{
return [self.pluginList countByEnumeratingWithState:state objects:buffer count:len];
}
- (PcsxrPlugin*)objectAtIndexedSubscript:(NSInteger)index
{
return self.pluginList[index];
}
@end