Index: src/OFArray.h ================================================================== --- src/OFArray.h +++ src/OFArray.h @@ -93,11 +93,11 @@ * Returns a specific object of the OFDataArray. * * \param index The number of the object to return * \return The specified object of the OFArray */ -- (id)object: (size_t)index; +- (id)objectAtIndex: (size_t)index; /** * \return The last object of the OFDataArray */ - (id)last; Index: src/OFArray.m ================================================================== --- src/OFArray.m +++ src/OFArray.m @@ -164,13 +164,13 @@ [objs[i] retain]; return new; } -- (id)object: (size_t)index +- (id)objectAtIndex: (size_t)index { - return *((OFObject**)[array item: index]); + return *((OFObject**)[array itemAtIndex: index]); } - (id)last { return *((OFObject**)[array last]); Index: src/OFDataArray.h ================================================================== --- src/OFDataArray.h +++ src/OFDataArray.h @@ -70,11 +70,11 @@ * Returns a specific item of the OFDataArray. * * \param index The number of the item to return * \return The specified item of the OFDataArray */ -- (void*)item: (size_t)index; +- (void*)itemAtIndex: (size_t)index; /** * \return The last item of the OFDataArray */ - (void*)last; Index: src/OFDataArray.m ================================================================== --- src/OFDataArray.m +++ src/OFDataArray.m @@ -61,11 +61,11 @@ - (void*)data { return data; } -- (void*)item: (size_t)index +- (void*)itemAtIndex: (size_t)index { if (index >= count) @throw [OFOutOfRangeException newWithClass: isa]; return data + index * itemsize; @@ -157,16 +157,16 @@ if (count > [obj count]) { if ((ret = memcmp(data, [obj data], [obj count] * itemsize))) return ret; - return *(char*)[self item: [obj count]]; + return *(char*)[self itemAtIndex: [obj count]]; } else { if ((ret = memcmp(data, [obj data], count * itemsize))) return ret; - return *(char*)[obj item: count] * -1; + return *(char*)[obj itemAtIndex: count] * -1; } } - (uint32_t)hash { Index: src/OFDictionary.h ================================================================== --- src/OFDictionary.h +++ src/OFDictionary.h @@ -132,27 +132,27 @@ /** * \param key The key whose object should be returned * \return The object for the given key or nil if the key was not found */ -- (id)get: (OFObject*)key; +- (id)objectForKey: (OFObject*)key; /** * Sets a key to an object. A key can be any object. * * \param key The key to set * \param obj The object to set the key to */ -- set: (OFObject *)key - to: (OFObject*)obj; +- setObject: (OFObject*)obj + forKey: (OFObject *)key; /** * Remove the object with the given key from the dictionary. * * \param key The key whose object should be removed */ -- remove: (OFObject*)key; +- removeObjectForKey: (OFObject*)key; /** * Changes the hash size of the dictionary. * * \param hashsize The new hash size for the dictionary Index: src/OFDictionary.m ================================================================== --- src/OFDictionary.m +++ src/OFDictionary.m @@ -313,11 +313,11 @@ } return (float)items / buckets; } -- (id)get: (OFObject*)key +- (id)objectForKey: (OFObject*)key { uint32_t hash; of_list_object_t *iter; if (key == nil) @@ -334,18 +334,18 @@ return iter->next->object; return nil; } -- set: (OFObject *)key - to: (OFObject*)obj +- setObject: (OFObject*)obj + forKey: (OFObject *)key { @throw [OFNotImplementedException newWithClass: isa andSelector: _cmd]; } -- remove: (OFObject*)key +- removeObjectForKey: (OFObject*)key { @throw [OFNotImplementedException newWithClass: isa andSelector: _cmd]; } Index: src/OFMutableDictionary.m ================================================================== --- src/OFMutableDictionary.m +++ src/OFMutableDictionary.m @@ -16,12 +16,12 @@ #import "OFMutableDictionary.h" #import "OFExceptions.h" #import "OFMacros.h" @implementation OFMutableDictionary -- set: (OFObject *)key - to: (OFObject*)obj +- setObject: (OFObject*)obj + forKey: (OFObject *)key { uint32_t hash; of_list_object_t *iter, *key_obj; if (key == nil || obj == nil) @@ -58,11 +58,11 @@ } return self; } -- remove: (OFObject*)key +- removeObjectForKey: (OFObject*)key { uint32_t hash; of_list_object_t *iter; if (key == nil) Index: tests/OFArray/OFArray.m ================================================================== --- tests/OFArray/OFArray.m +++ tests/OFArray/OFArray.m @@ -61,10 +61,10 @@ [b removeNObjects: 1]; [b add: @"Qux"]; assert(![a isEqual: b]); - CATCH_EXCEPTION([a object: 3], OFOutOfRangeException) + CATCH_EXCEPTION([a objectAtIndex: 3], OFOutOfRangeException) CATCH_EXCEPTION([a add: @"foo"], OFNotImplementedException) return 0; } Index: tests/OFDataArray/OFDataArray.m ================================================================== --- tests/OFDataArray/OFDataArray.m +++ tests/OFDataArray/OFDataArray.m @@ -68,15 +68,17 @@ puts("Adding multiple items at once..."); \ p = [a allocWithSize: 8192]; \ memset(p, 64, 8192); \ [a addNItems: 2 \ fromCArray: p]; \ - if (!memcmp([a last], [a item: [a count] - 2], 4096) && \ - !memcmp([a item: [a count] - 2], p, 4096)) \ - puts("[a last], [a item: [a count] - 2] and p match!"); \ + if (!memcmp([a last], [a itemAtIndex: [a count] - 2], 4096) && \ + !memcmp([a itemAtIndex: [a count] - 2], p, 4096)) \ + puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ + "match!"); \ else { \ - puts("[a last], [a item: [a count] - 2] and p did not match!");\ + puts("[a last], [a itemAtIndex: [a count] - 2] and p " \ + "do not match!"); \ abort(); \ } \ [a freeMem: p]; \ \ i = [a count]; \ @@ -90,11 +92,12 @@ puts("Trying to remove more data than we added..."); \ CATCH_EXCEPTION([a removeNItems: [a count] + 1], \ OFOutOfRangeException); \ \ puts("Trying to access an index that does not exist..."); \ - CATCH_EXCEPTION([a item: [a count]], OFOutOfRangeException); \ + CATCH_EXCEPTION([a itemAtIndex: [a count]], \ + OFOutOfRangeException); \ \ [a release]; \ \ puts("Creating new array and using it to build a string..."); \ a = [[type alloc] initWithItemSize: 1]; \ Index: tests/OFDictionary/OFDictionary.m ================================================================== --- tests/OFDictionary/OFDictionary.m +++ tests/OFDictionary/OFDictionary.m @@ -33,24 +33,24 @@ OFString *key1 = [OFString stringWithCString: "key1"]; OFString *key2 = [OFString stringWithCString: "key2"]; OFString *value1 = [OFString stringWithCString: "value1"]; OFString *value2 = [OFString stringWithCString: "value2"]; - [dict set: key1 - to: value1]; - [dict set: key2 - to: value2]; + [dict setObject: value1 + forKey: key1]; + [dict setObject: value2 + forKey: key2]; [pool release]; i++; - if (strcmp([[dict get: @"key1"] cString], "value1")) { + if (strcmp([[dict objectForKey: @"key1"] cString], "value1")) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; - if (strcmp([[dict get: key2] cString], "value2")) { + if (strcmp([[dict objectForKey: key2] cString], "value2")) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; @@ -84,11 +84,11 @@ printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; - if ([dict get: @"key3"] != nil) { + if ([dict objectForKey: @"key3"] != nil) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; @@ -95,45 +95,45 @@ [dict release]; dict = [OFDictionary dictionaryWithKeysAndObjects: @"foo", @"bar", @"baz", @"qux", nil]; - if (![[dict get: @"foo"] isEqual: @"bar"]) { + if (![[dict objectForKey: @"foo"] isEqual: @"bar"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; - if (![[dict get: @"baz"] isEqual: @"qux"]) { + if (![[dict objectForKey: @"baz"] isEqual: @"qux"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; [dict release]; dict = [OFDictionary dictionaryWithKey: @"foo" andObject: @"bar"]; - if (![[dict get: @"foo"] isEqual: @"bar"]) { + if (![[dict objectForKey: @"foo"] isEqual: @"bar"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; [dict release]; dict = [OFDictionary dictionaryWithKeys: [OFArray arrayWithObjects: @"k1", @"k2", nil] andObjects: [OFArray arrayWithObjects: @"o1", @"o2", nil]]; - if (![[dict get: @"k1"] isEqual: @"o1"]) { + if (![[dict objectForKey: @"k1"] isEqual: @"o1"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } i++; - if (![[dict get: @"k2"] isEqual: @"o2"]) { + if (![[dict objectForKey: @"k2"] isEqual: @"o2"]) { printf("\033[K\033[1;31mTest %d/%d failed!\033[m\n", i, TESTS); return 1; } printf("\033[1;32mTests successful: %d/%d\033[0m\n", i, TESTS); return 0; } Index: tests/OFString/OFString.m ================================================================== --- tests/OFString/OFString.m +++ tests/OFString/OFString.m @@ -100,16 +100,16 @@ [s1 appendWithFormat: @"%02X", 15]; CHECK(!strcmp([s1 cString], "test: 1230F")) a = [@"fooXXbarXXXXbazXXXX" splitWithDelimiter: @"XX"]; - CHECK([[a object: j++] isEqual: @"foo"]) - CHECK([[a object: j++] isEqual: @"bar"]) - CHECK([[a object: j++] isEqual: @""]) - CHECK([[a object: j++] isEqual: @"baz"]) - CHECK([[a object: j++] isEqual: @""]) - CHECK([[a object: j++] isEqual: @""]) + CHECK([[a objectAtIndex: j++] isEqual: @"foo"]) + CHECK([[a objectAtIndex: j++] isEqual: @"bar"]) + CHECK([[a objectAtIndex: j++] isEqual: @""]) + CHECK([[a objectAtIndex: j++] isEqual: @"baz"]) + CHECK([[a objectAtIndex: j++] isEqual: @""]) + CHECK([[a objectAtIndex: j++] isEqual: @""]) CHECK([[@"foo\"ba'_$" urlencode] isEqual: @"foo%22ba%27_%24"]) CHECK([[@"foo%20bar%22%24" urldecode] isEqual: @"foo bar\"$"]) CHECK_EXCEPT([@"foo%bar" urldecode], OFInvalidEncodingException) CHECK_EXCEPT([@"foo%FFbar" urldecode], OFInvalidEncodingException)