mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Headers/Foundation/NSMetadata.h
* Source/NSMetadata.m: Add NSMetadataQueryAttributeValueTuple and NSMetadataQueryResultGroup classes. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35820 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c08ff39f06
commit
86e6ebe7e7
3 changed files with 93 additions and 5 deletions
|
@ -1,8 +1,14 @@
|
|||
2012-11-25 14:39-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSMetadata.h
|
||||
* Source/NSMetadata.m: Add NSMetadataQueryAttributeValueTuple and
|
||||
NSMetadataQueryResultGroup classes.
|
||||
|
||||
2012-11-21 12:10-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSMetadata.h: Add ivars.
|
||||
* Source/NSMetadata.m: Cleanup compilation error.
|
||||
|
||||
|
||||
2012-11-20 12:50-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/NSMetadata.h: Declaratioins for constants and
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSTimer.h>
|
||||
|
||||
@class NSPredicate, NSMutableDictionary, NSDictionary;
|
||||
@class NSPredicate, NSMutableDictionary, NSDictionary, NSMutableArray;
|
||||
@protocol NSMetadataQueryDelegate;
|
||||
|
||||
// Metadata item constants...
|
||||
|
@ -144,4 +144,33 @@ GS_EXPORT NSString * const NSMetadataQueryGatheringProgressNotification;
|
|||
- (id)metadataQuery:(NSMetadataQuery *)query replacementValueForAttribute:(NSString *)attribute value:(id)attributeValue;
|
||||
@end
|
||||
|
||||
@interface NSMetadataQueryAttributeValueTuple : NSObject
|
||||
{
|
||||
id _attribute;
|
||||
id _value;
|
||||
NSUInteger _count;
|
||||
}
|
||||
|
||||
- (NSString *) attribute;
|
||||
- (id) value;
|
||||
- (NSUInteger) count;
|
||||
|
||||
@end
|
||||
|
||||
@interface NSMetadataQueryResultGroup : NSObject
|
||||
{
|
||||
NSString *_attribute;
|
||||
id _value;
|
||||
NSMutableArray *_subgroups;
|
||||
}
|
||||
|
||||
- (NSString *) attribute;
|
||||
- (id) value;
|
||||
- (NSArray *) subgroups;
|
||||
- (NSUInteger) resultCount;
|
||||
- (id) resultAtIndex: (NSUInteger)index;
|
||||
- (NSArray *) results;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
||||
|
|
|
@ -94,7 +94,7 @@ NSString * const NSMetadataQueryGatheringProgressNotification = @"NSMetadataQuer
|
|||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (NSArray *)valueLists
|
||||
- (NSDictionary *)valueLists
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
|
@ -249,15 +249,68 @@ NSString * const NSMetadataQueryGatheringProgressNotification = @"NSMetadataQuer
|
|||
}
|
||||
|
||||
// Delegate
|
||||
- (void)setDelegate:(id)delegate
|
||||
- (void)setDelegate:(id<NSMetadataQueryDelegate>)delegate;
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (id)delegate
|
||||
- (id<NSMetadataQueryDelegate>)delegate;
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMetadataQueryAttributeValueTuple
|
||||
|
||||
- (NSString *) attribute
|
||||
{
|
||||
return _attribute;
|
||||
}
|
||||
|
||||
- (id) value
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
- (NSUInteger) count
|
||||
{
|
||||
return _count;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation NSMetadataQueryResultGroup : NSObject
|
||||
|
||||
- (NSString *) attribute
|
||||
{
|
||||
return _attribute;
|
||||
}
|
||||
|
||||
- (id) value
|
||||
{
|
||||
return _value;
|
||||
}
|
||||
|
||||
- (NSArray *) subgroups
|
||||
{
|
||||
return _subgroups;
|
||||
}
|
||||
|
||||
- (NSUInteger) resultCount
|
||||
{
|
||||
return [_subgroups count];
|
||||
}
|
||||
|
||||
- (id) resultAtIndex: (NSUInteger)index
|
||||
{
|
||||
return [_subgroups objectAtIndex:index];
|
||||
}
|
||||
|
||||
- (NSArray *) results
|
||||
{
|
||||
return [self subgroups];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
Loading…
Reference in a new issue