mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Add skeletal implementation of keysSortyedByValue*** methods
This commit is contained in:
parent
d4428e8d6c
commit
5287a62909
4 changed files with 17 additions and 2 deletions
|
@ -283,7 +283,7 @@ DEFINE_BLOCK_TYPE(GSPredicateBlock, BOOL, GS_GENERIC_TYPE(ElementT),
|
|||
- (GS_GENERIC_CLASS(NSArray, ElementT) *)
|
||||
sortedArrayWithOptions: (NSSortOptions)options
|
||||
usingComparator: (NSComparator)comparator;
|
||||
|
||||
|
||||
/**
|
||||
* Performs a binary search of the array within the specified range for the
|
||||
* index of an object equal to obj according to cmp.
|
||||
|
|
|
@ -109,6 +109,8 @@ DEFINE_BLOCK_TYPE(GSKeysAndObjectsPredicateBlock, BOOL,
|
|||
#endif
|
||||
|
||||
- (GS_GENERIC_CLASS(NSArray,ValT)*) keysSortedByValueUsingSelector: (SEL)comp;
|
||||
- (GS_GENERIC_CLASS(NSArray,ValT)*) keysSortedByValueUsingComparator:(NSComparator)cmptr;
|
||||
- (GS_GENERIC_CLASS(NSArray,ValT)*) keysSortedByValueWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr;
|
||||
- (GS_GENERIC_CLASS(NSEnumerator,ValT)*) objectEnumerator; // Primitive
|
||||
- (GS_GENERIC_TYPE(ValT)) objectForKey:
|
||||
(GS_GENERIC_TYPE(KeyT))aKey; // Primitive
|
||||
|
|
|
@ -1219,7 +1219,6 @@ compare(id elem1, id elem2, void* context)
|
|||
return NSNotFound;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a string formed by concatenating the objects in the receiver,
|
||||
* with the specified separator string inserted between each part.
|
||||
|
|
|
@ -949,6 +949,20 @@ compareIt(id o1, id o2, void* context)
|
|||
return k;
|
||||
}
|
||||
|
||||
- (NSArray *)keysSortedByValueUsingComparator:(NSComparator)cmptr
|
||||
{
|
||||
return [self keysSortedByValueWithOptions:0 usingComparator:cmptr];
|
||||
}
|
||||
|
||||
- (NSArray *)keysSortedByValueWithOptions:(NSSortOptions)opts usingComparator:(NSComparator)cmptr
|
||||
{
|
||||
//return [[self allKeys] sortedArrayWithOptions:opts
|
||||
// usingComparator:^NSComparisonResult(id key1, id key2) {
|
||||
// return cmptr([self objectForKey:key1], [self objectForKey:key2]);
|
||||
//}]
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Multiple version of [-objectForKey:]. Objects for each key in keys are
|
||||
* looked up and placed into return array in same order. For each key that
|
||||
|
|
Loading…
Reference in a new issue