Annotated various methods with generics

This commit is contained in:
Frederik Seiffert 2022-02-14 10:23:46 +01:00
parent 20152fc291
commit 829a39663c
4 changed files with 13 additions and 13 deletions

View file

@ -155,8 +155,8 @@ GS_EXPORT_CLASS
- (NSString *) descriptionWithLocale: (NSLocale *)locale indent: (BOOL)flag;
// Convert to other types
- (NSArray *) array;
- (NSSet *) set;
- (GS_GENERIC_CLASS(NSArray, ElementT) *) array;
- (GS_GENERIC_CLASS(NSSet, ElementT) *) set;
@end
// Mutable Ordered Set

View file

@ -65,11 +65,11 @@ GS_EXPORT_CLASS
#endif
@end
@interface NSArray (NSPredicate)
@interface GS_GENERIC_CLASS(NSArray, ElementT) (NSPredicate)
/** Evaluate each object in the array using the specified predicate and
* return an array containing all the objects which evaluate to YES.
*/
- (NSArray *) filteredArrayUsingPredicate: (NSPredicate *)predicate;
- (GS_GENERIC_CLASS(NSArray, ElementT) *) filteredArrayUsingPredicate: (NSPredicate *)predicate;
@end
@interface NSMutableArray (NSPredicate)
@ -79,11 +79,11 @@ GS_EXPORT_CLASS
- (void) filterUsingPredicate: (NSPredicate *)predicate;
@end
@interface NSSet (NSPredicate)
@interface GS_GENERIC_CLASS(NSSet, ElementT) (NSPredicate)
/** Evaluate each object in the set using the specified predicate and
* return an set containing all the objects which evaluate to YES.
*/
- (NSSet *) filteredSetUsingPredicate: (NSPredicate *)predicate;
- (GS_GENERIC_CLASS(NSSet, ElementT) *) filteredSetUsingPredicate: (NSPredicate *)predicate;
@end
@interface NSMutableSet (NSPredicate)

View file

@ -143,13 +143,13 @@ GS_EXPORT_CLASS
- (id) reversedSortDescriptor;
@end
@interface NSArray (NSSortDescriptorSorting)
@interface GS_GENERIC_CLASS(NSArray, ElementT) (NSSortDescriptorSorting)
/**
* Produces a sorted array using the mechanism described for
* [NSMutableArray-sortUsingDescriptors:]
*/
- (NSArray *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
- (GS_GENERIC_CLASS(NSArray, ElementT) *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
@end
@ -171,12 +171,12 @@ GS_EXPORT_CLASS
@end
#if OS_API_VERSION(MAC_OS_X_VERSION_10_6,GS_API_LATEST)
@interface NSSet (NSSortDescriptorSorting)
@interface GS_GENERIC_CLASS(NSSet, ElementT) (NSSortDescriptorSorting)
/**
* Produces a sorted array from using the mechanism described for
* [NSMutableArray-sortUsingDescriptors:]
*/
- (NSArray *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
- (GS_GENERIC_CLASS(NSArray, ElementT) *) sortedArrayUsingDescriptors: (NSArray *)sortDescriptors;
@end
#endif

View file

@ -102,7 +102,7 @@ typedef uint16_t unichar;
#define NSMaximumStringLength (INT_MAX-1)
#endif
@class NSArray;
@class GS_GENERIC_CLASS(NSArray, ElementT);
@class NSCharacterSet;
@class NSData;
@class NSDictionary;
@ -576,7 +576,7 @@ GS_EXPORT_CLASS
- (NSString*) stringByAppendingString: (NSString*)aString;
// Dividing Strings into Substrings
- (NSArray*) componentsSeparatedByString: (NSString*)separator;
- (GS_GENERIC_CLASS(NSArray, NSString*) *) componentsSeparatedByString: (NSString*)separator;
- (NSString*) substringFromIndex: (NSUInteger)index;
- (NSString*) substringToIndex: (NSUInteger)index;
@ -1024,7 +1024,7 @@ GS_EXPORT_CLASS
* Returns NO if the above conditions are not met.
*/
- (BOOL) boolValue;
- (NSArray *) componentsSeparatedByCharactersInSet: (NSCharacterSet *)separator;
- (GS_GENERIC_CLASS(NSArray, NSString*) *) componentsSeparatedByCharactersInSet: (NSCharacterSet *)separator;
- (NSInteger) integerValue;
- (long long) longLongValue;
/** Not implemented */