2006-05-09 14:21:26 +00:00
|
|
|
/* Interface for NSPredicate for GNUStep
|
|
|
|
Copyright (C) 2005 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
Written by: Dr. H. Nikolaus Schaller
|
|
|
|
Created: 2005
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
modify it under the terms of the GNU Lesser General Public
|
2006-05-09 14:21:26 +00:00
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
version 2 of the License, or (at your option) any later version.
|
2006-05-09 14:21:26 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
2006-05-09 14:21:26 +00:00
|
|
|
License along with this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __NSPredicate_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define __NSPredicate_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
2006-05-09 14:21:26 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(100400, GS_API_LATEST)
|
|
|
|
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
#import <Foundation/NSArray.h>
|
2006-05-09 14:21:26 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2006-05-09 14:21:26 +00:00
|
|
|
@interface NSPredicate : NSObject <NSCoding, NSCopying>
|
|
|
|
|
|
|
|
+ (NSPredicate *) predicateWithFormat: (NSString *)format, ...;
|
|
|
|
+ (NSPredicate *) predicateWithFormat: (NSString *)format
|
|
|
|
argumentArray: (NSArray *)args;
|
|
|
|
+ (NSPredicate *) predicateWithFormat: (NSString *)format
|
|
|
|
arguments: (va_list)args;
|
|
|
|
+ (NSPredicate *) predicateWithValue: (BOOL)value;
|
|
|
|
|
|
|
|
- (BOOL) evaluateWithObject: (id)object;
|
|
|
|
- (NSString *) predicateFormat;
|
|
|
|
- (NSPredicate *) predicateWithSubstitutionVariables: (NSDictionary *)variables;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSArray (NSPredicate)
|
2007-04-15 09:50:48 +00:00
|
|
|
/** Evaluate each object in the array using the specified predicate and
|
|
|
|
* return an array containing all the objects which evaluate to YES.
|
|
|
|
*/
|
2006-05-09 14:21:26 +00:00
|
|
|
- (NSArray *) filteredArrayUsingPredicate: (NSPredicate *)predicate;
|
|
|
|
@end
|
|
|
|
|
2007-04-15 09:50:48 +00:00
|
|
|
@interface NSMutableArray (NSPredicate)
|
|
|
|
/** Evaluate each object in the array using the specified predicate and
|
|
|
|
* remove each objects which evaluates to NO.
|
|
|
|
*/
|
|
|
|
- (void) filterUsingPredicate: (NSPredicate *)predicate;
|
|
|
|
@end
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#endif /* 100400 */
|
|
|
|
#endif /* __NSPredicate_h_GNUSTEP_BASE_INCLUDE */
|