Support for collection subscripting (NSArray and NSDictionary).

Yes, the syntax is ugly, but no doubt people will start using it in June...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
David Chisnall 2012-04-06 12:23:10 +00:00
parent 099038ac58
commit 3cb1b08b26
7 changed files with 64 additions and 4 deletions

View file

@ -213,6 +213,11 @@ DEFINE_BLOCK_TYPE(GSPredicateBlock, BOOL, id, NSUInteger, BOOL*);
options: (NSEnumerationOptions)opts
passingTest: (GSPredicateBlock)predicate;
#endif
/**
* Accessor for subscripting. This is called by the compiler when you write
* code like anArray[12]. It should not be called directly.
*/
- (id) objectAtIndexedSubscript: (size_t)anIndex;
@end
@ -264,7 +269,10 @@ DEFINE_BLOCK_TYPE(GSPredicateBlock, BOOL, id, NSUInteger, BOOL*);
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
- (void) setValue: (id)value forKey: (NSString*)key;
#endif
/**
* Set method called by the compiler with array subscripting.
*/
- (void) setObject: (id)anObject atIndexedSubscript: (size_t)anIndex;
@end
#if defined(__cplusplus)