* 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:
gcasa 2012-11-25 19:40:10 +00:00
parent c08ff39f06
commit 86e6ebe7e7
3 changed files with 93 additions and 5 deletions

View file

@ -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

View file

@ -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

View file

@ -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