@@ -24,18 +24,18 @@ #import "OFStream.h" #import "OFInvalidArgumentException.h" #import "OFInvalidFormatException.h" -@interface OFINICategory_Pair: OFObject +@interface OFINICategoryPair: OFObject { @public OFString *_key, *_value; } @end -@interface OFINICategory_Comment: OFObject +@interface OFINICategoryComment: OFObject { @public OFString *_comment; } @end @@ -98,21 +98,21 @@ [mutableString makeImmutable]; return mutableString; } -@implementation OFINICategory_Pair +@implementation OFINICategoryPair - (void)dealloc { [_key release]; [_value release]; [super dealloc]; } @end -@implementation OFINICategory_Comment +@implementation OFINICategoryComment - (void)dealloc { [_comment release]; [super dealloc]; @@ -151,12 +151,12 @@ } - (void)of_parseLine: (OFString *)line { if (![line hasPrefix: @";"]) { - OFINICategory_Pair *pair = - [[[OFINICategory_Pair alloc] init] autorelease]; + OFINICategoryPair *pair = + [[[OFINICategoryPair alloc] init] autorelease]; OFString *key, *value; size_t pos; if ((pos = [line rangeOfString: @"="].location) == OF_NOT_FOUND) @throw [OFInvalidFormatException exception]; @@ -174,12 +174,12 @@ pair->_key = [key copy]; pair->_value = [value copy]; [_lines addObject: pair]; } else { - OFINICategory_Comment *comment = - [[[OFINICategory_Comment alloc] init] autorelease]; + OFINICategoryComment *comment = + [[[OFINICategoryComment alloc] init] autorelease]; comment->_comment = [line copy]; [_lines addObject: comment]; } @@ -193,13 +193,13 @@ - (OFString *)stringForKey: (OFString *)key defaultValue: (OFString *)defaultValue { for (id line in _lines) { - OFINICategory_Pair *pair; + OFINICategoryPair *pair; - if (![line isKindOfClass: [OFINICategory_Pair class]]) + if (![line isKindOfClass: [OFINICategoryPair class]]) continue; pair = line; if ([pair->_key isEqual: key]) @@ -293,13 +293,13 @@ { OFMutableArray *ret = [OFMutableArray array]; void *pool = objc_autoreleasePoolPush(); for (id line in _lines) { - OFINICategory_Pair *pair; + OFINICategoryPair *pair; - if (![line isKindOfClass: [OFINICategory_Pair class]]) + if (![line isKindOfClass: [OFINICategoryPair class]]) continue; pair = line; if ([pair->_key isEqual: key]) @@ -315,14 +315,14 @@ - (void)setString: (OFString *)string forKey: (OFString *)key { void *pool = objc_autoreleasePoolPush(); - OFINICategory_Pair *pair; + OFINICategoryPair *pair; for (id line in _lines) { - if (![line isKindOfClass: [OFINICategory_Pair class]]) + if (![line isKindOfClass: [OFINICategoryPair class]]) continue; pair = line; if ([pair->_key isEqual: key]) { @@ -334,11 +334,11 @@ return; } } - pair = [[[OFINICategory_Pair alloc] init] autorelease]; + pair = [[[OFINICategoryPair alloc] init] autorelease]; pair->_key = nil; pair->_value = nil; @try { pair->_key = [key copy]; @@ -411,16 +411,16 @@ pool = objc_autoreleasePoolPush(); pairs = [OFMutableArray arrayWithCapacity: array.count]; for (id object in array) { - OFINICategory_Pair *pair; + OFINICategoryPair *pair; if (![object isKindOfClass: [OFString class]]) @throw [OFInvalidArgumentException exception]; - pair = [[[OFINICategory_Pair alloc] init] autorelease]; + pair = [[[OFINICategoryPair alloc] init] autorelease]; pair->_key = [key copy]; pair->_value = [object copy]; [pairs addObject: pair]; } @@ -428,13 +428,13 @@ lines = _lines.objects; count = _lines.count; replaced = false; for (size_t i = 0; i < count; i++) { - OFINICategory_Pair *pair; + OFINICategoryPair *pair; - if (![lines[i] isKindOfClass: [OFINICategory_Pair class]]) + if (![lines[i] isKindOfClass: [OFINICategoryPair class]]) continue; pair = lines[i]; if ([pair->_key isEqual: key]) { @@ -468,13 +468,13 @@ void *pool = objc_autoreleasePoolPush(); id const *lines = _lines.objects; size_t count = _lines.count; for (size_t i = 0; i < count; i++) { - OFINICategory_Pair *pair; + OFINICategoryPair *pair; - if (![lines[i] isKindOfClass: [OFINICategory_Pair class]]) + if (![lines[i] isKindOfClass: [OFINICategoryPair class]]) continue; pair = lines[i]; if ([pair->_key isEqual: key]) { @@ -502,15 +502,15 @@ [stream writeFormat: @"[%@]\r\n", _name]; else [stream writeFormat: @"\r\n[%@]\r\n", _name]; for (id line in _lines) { - if ([line isKindOfClass: [OFINICategory_Comment class]]) { - OFINICategory_Comment *comment = line; + if ([line isKindOfClass: [OFINICategoryComment class]]) { + OFINICategoryComment *comment = line; [stream writeFormat: @"%@\r\n", comment->_comment]; - } else if ([line isKindOfClass: [OFINICategory_Pair class]]) { - OFINICategory_Pair *pair = line; + } else if ([line isKindOfClass: [OFINICategoryPair class]]) { + OFINICategoryPair *pair = line; OFString *key = escapeString(pair->_key); OFString *value = escapeString(pair->_value); OFString *tmp = [OFString stringWithFormat: @"%@=%@\r\n", key, value];