mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Add implementation of expressionValueWithObject:context: to GSAggregateExpression
This commit is contained in:
parent
a49ae59a79
commit
48ab2e2bc7
2 changed files with 17 additions and 4 deletions
3
MISSING
3
MISSING
|
@ -158,10 +158,7 @@ NSExpression:
|
|||
+ expressionForSubquery:usingIteratorVariable:predicate:
|
||||
+ expressionForFunction:selectorName:arguments:
|
||||
+ expressionForBlock:arguments:
|
||||
- collection
|
||||
- predicate
|
||||
- leftExpression
|
||||
- rightExpression
|
||||
- expressionBlock
|
||||
-------------------------------------------------------------
|
||||
NSFileHandle:
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#import "Foundation/NSValue.h"
|
||||
|
||||
#import "GSPrivate.h"
|
||||
#import "GSFastEnumeration.h"
|
||||
|
||||
// For pow()
|
||||
#include <math.h>
|
||||
|
@ -1297,7 +1298,7 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
|
||||
e = [[GSAggregateExpression alloc]
|
||||
initWithExpressionType: NSAggregateExpressionType];
|
||||
ASSIGN(e->_collection, [NSMutableArray array]);
|
||||
ASSIGN(e->_collection, subExpressions);
|
||||
|
||||
return AUTORELEASE(e);
|
||||
}
|
||||
|
@ -1808,6 +1809,21 @@ GSICUStringMatchesRegex(NSString *string, NSString *regex, NSStringCompareOption
|
|||
return _collection;
|
||||
}
|
||||
|
||||
- (id) expressionValueWithObject: (id)object
|
||||
context: (NSMutableDictionary *)context
|
||||
{
|
||||
NSMutableArray *result = [NSMutableArray arrayWithCapacity:
|
||||
[_collection count]];
|
||||
|
||||
FOR_IN(NSExpression*, exp, _collection)
|
||||
{
|
||||
NSExpression *value = [exp expressionValueWithObject: object context: context];
|
||||
[result addObject: value];
|
||||
}
|
||||
END_FOR_IN(_collection);
|
||||
|
||||
return result;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation GSFunctionExpression
|
||||
|
|
Loading…
Reference in a new issue