mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Convert all tabs to four spaces. refs #743
This commit is contained in:
@@ -51,26 +51,26 @@ RKParserRegistry *gSharedRegistry;
|
||||
|
||||
- (void)dealloc {
|
||||
[_MIMETypeToParserClasses release];
|
||||
[_MIMETypeToParserClassesRegularExpressions release];
|
||||
[_MIMETypeToParserClassesRegularExpressions release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (Class<RKParser>)parserClassForMIMEType:(NSString *)MIMEType {
|
||||
id parserClass = [_MIMETypeToParserClasses objectForKey:MIMEType];
|
||||
id parserClass = [_MIMETypeToParserClasses objectForKey:MIMEType];
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
|
||||
if (!parserClass)
|
||||
{
|
||||
for (NSArray *regexAndClass in _MIMETypeToParserClassesRegularExpressions) {
|
||||
NSRegularExpression *regex = [regexAndClass objectAtIndex:0];
|
||||
NSUInteger numberOfMatches = [regex numberOfMatchesInString:MIMEType options:0 range:NSMakeRange(0, [MIMEType length])];
|
||||
if (numberOfMatches) {
|
||||
parserClass = [regexAndClass objectAtIndex:1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!parserClass)
|
||||
{
|
||||
for (NSArray *regexAndClass in _MIMETypeToParserClassesRegularExpressions) {
|
||||
NSRegularExpression *regex = [regexAndClass objectAtIndex:0];
|
||||
NSUInteger numberOfMatches = [regex numberOfMatchesInString:MIMEType options:0 range:NSMakeRange(0, [MIMEType length])];
|
||||
if (numberOfMatches) {
|
||||
parserClass = [regexAndClass objectAtIndex:1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return parserClass;
|
||||
return parserClass;
|
||||
}
|
||||
|
||||
- (void)setParserClass:(Class<RKParser>)parserClass forMIMEType:(NSString *)MIMEType {
|
||||
@@ -80,7 +80,7 @@ RKParserRegistry *gSharedRegistry;
|
||||
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 || __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000
|
||||
|
||||
- (void)setParserClass:(Class<RKParser>)parserClass forMIMETypeRegularExpression:(NSRegularExpression *)MIMETypeRegex {
|
||||
NSArray *expressionAndClass = [NSArray arrayWithObjects:MIMETypeRegex, parserClass, nil];
|
||||
NSArray *expressionAndClass = [NSArray arrayWithObjects:MIMETypeRegex, parserClass, nil];
|
||||
[_MIMETypeToParserClassesRegularExpressions addObject:expressionAndClass];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user