mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Headers/Foundation/Foundation.h: Add NSMetadataQuery.h to
include list. * Headers/Foundation/NSMetadataQuery.h: New header for class. * Source/GNUmakefile: Add NSMetadataQuery.[hm] to makefile. * Source/NSMetadataQuery.m: Abstract implementation for NSMetdataQuery. The idea is much like NSFileStream and other classes which have operating system specific implementations. On linux this will, most likely, interface with locate/slocate. I'm not certain what it will talk to on Win32. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35803 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
496dc94164
commit
79110c7ac7
5 changed files with 321 additions and 5 deletions
22
ChangeLog
22
ChangeLog
|
@ -1,10 +1,22 @@
|
|||
2012-11-18 11:29-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||
|
||||
* Headers/Foundation/Foundation.h: Add NSMetadataQuery.h to
|
||||
include list.
|
||||
* Headers/Foundation/NSMetadataQuery.h: New header for class.
|
||||
* Source/GNUmakefile: Add NSMetadataQuery.[hm] to makefile.
|
||||
* Source/NSMetadataQuery.m: Abstract implementation for
|
||||
NSMetdataQuery. The idea is much like NSFileStream and other
|
||||
classes which have operating system specific implementations.
|
||||
On linux this will, most likely, interface with locate/slocate.
|
||||
I'm not certain what it will talk to on Win32.
|
||||
|
||||
2012-11-15 Quentin Mathe <quentin.mathe@gmail.com>
|
||||
|
||||
* Source/NSAutoreleasePool.m (-emptyPool): Fixed not to push a pool to
|
||||
the cache in the ARC_RUNTIME implementation, -dealloc does it already.
|
||||
For the same current pool instance, the ARC_RUNTIME implementation was
|
||||
calling push_pool_to_cache() twice, once in -emptyPool and another
|
||||
-dealloc. Which meant a pool still in use could be reused, then it was
|
||||
* Source/NSAutoreleasePool.m (-emptyPool): Fixed not to push a pool to
|
||||
the cache in the ARC_RUNTIME implementation, -dealloc does it already.
|
||||
For the same current pool instance, the ARC_RUNTIME implementation was
|
||||
calling push_pool_to_cache() twice, once in -emptyPool and another
|
||||
-dealloc. Which meant a pool still in use could be reused, then it was
|
||||
possible to get stuck in an infinite loop.
|
||||
|
||||
2012-11-05 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
|
|
@ -83,6 +83,7 @@
|
|||
#import <Foundation/NSLock.h>
|
||||
#import <Foundation/NSLocale.h>
|
||||
#import <Foundation/NSMapTable.h>
|
||||
#import <Foundation/NSMetadataQuery.h>
|
||||
#import <Foundation/NSMethodSignature.h>
|
||||
#import <Foundation/NSNotification.h>
|
||||
#import <Foundation/NSNotificationQueue.h>
|
||||
|
|
89
Headers/Foundation/NSMetadataQuery.h
Normal file
89
Headers/Foundation/NSMetadataQuery.h
Normal file
|
@ -0,0 +1,89 @@
|
|||
/**Interface for NSMetadataQuery for GNUStep
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Gregory Casamento
|
||||
Date: 2012
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
AutogsdocSource: NSMetadataQuery.h
|
||||
*/
|
||||
|
||||
#ifndef __NSMetadataQuery_h_GNUSTEP_BASE_INCLUDE
|
||||
#define __NSMetadataQuery_h_GNUSTEP_BASE_INCLUDE
|
||||
|
||||
#import <Foundation/NSObject.h>
|
||||
#import <Foundation/NSTimer.h>
|
||||
|
||||
@class NSPredicate;
|
||||
|
||||
@interface NSMetadataQuery : NSObject
|
||||
|
||||
/* Instance methods */
|
||||
- (id)valueOfAttribute:(id)attr forResultAtIndex:(NSUInteger)index;
|
||||
- (NSArray *)groupedResults;
|
||||
- (NSArray *)valueLists;
|
||||
- (NSUInteger)indexOfResult:(id)result;
|
||||
- (NSArray *)results;
|
||||
- (id)resultAtIndex:(NSUInteger)index;
|
||||
- (NSUInteger)resultCount;
|
||||
|
||||
// Enable/Disable updates
|
||||
- (void)enableUpdates;
|
||||
- (void)disableUpdates;
|
||||
|
||||
// Status of the query...
|
||||
- (BOOL)isStopped;
|
||||
- (BOOL)isGathering;
|
||||
- (BOOL)isStarted;
|
||||
- (void)stopQuery;
|
||||
- (BOOL)startQuery;
|
||||
|
||||
// Search URLS
|
||||
- (void)setSearchItemURLs:(NSArray *)urls;
|
||||
- (NSArray *)searchItemURLs;
|
||||
|
||||
// Search scopes
|
||||
- (void)setSearchScopes:(NSArray *)scopes;
|
||||
- (NSArray *)searchScopes;
|
||||
|
||||
// Notification interval
|
||||
- (void)setNotificationBatchingInterval:(NSTimeInterval)interval;
|
||||
- (NSTimeInterval)notificationBatchingInterval;
|
||||
|
||||
// Grouping Attributes.
|
||||
- (void)setGroupingAttributes:(NSArray *)attrs;
|
||||
- (NSArray *)groupingAttributes;
|
||||
- (void)setValueListAttributes:(NSArray *)attrs;
|
||||
- (NSArray *)valueListAttributes;
|
||||
|
||||
// Sort descriptors
|
||||
- (void)setSortDescriptors:(NSArray *)attrs;
|
||||
- (id)sortDescriptors;
|
||||
|
||||
// Predicate
|
||||
- (void)setPredicate:(NSPredicate *)predicate;
|
||||
- (NSPredicate *)predicate;
|
||||
|
||||
// Delegate
|
||||
- (void)setDelegate:(id)delegate;
|
||||
- (id)delegate;
|
||||
|
||||
@end
|
||||
|
||||
#endif
|
|
@ -227,6 +227,7 @@ NSLocale.m \
|
|||
NSLock.m \
|
||||
NSLog.m \
|
||||
NSMapTable.m \
|
||||
NSMetadataQuery.m \
|
||||
NSMethodSignature.m \
|
||||
NSNotification.m \
|
||||
NSNotificationCenter.m \
|
||||
|
@ -389,6 +390,7 @@ NSKeyValueObserving.h \
|
|||
NSLocale.h \
|
||||
NSLock.h \
|
||||
NSMapTable.h \
|
||||
NSMetadataQuery.h \
|
||||
NSMethodSignature.h \
|
||||
NSNetServices.h \
|
||||
NSNotification.h \
|
||||
|
|
212
Source/NSMetadataQuery.m
Normal file
212
Source/NSMetadataQuery.m
Normal file
|
@ -0,0 +1,212 @@
|
|||
/**Interface for NSMetadataQuery for GNUStep
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
Written by: Gregory Casamento
|
||||
Date: 2012
|
||||
|
||||
This file is part of the GNUstep Base Library.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
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.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free
|
||||
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02111 USA.
|
||||
|
||||
AutogsdocSource: NSMetadataQuery.h
|
||||
*/
|
||||
|
||||
#import <Foundation/NSMetadataQuery.h>
|
||||
#import <Foundation/NSArray.h>
|
||||
#import "GNUstepBase/NSObject+GNUstepBase.h"
|
||||
|
||||
@implementation NSMetadataQuery
|
||||
|
||||
/* Instance methods */
|
||||
- (id)valueOfAttribute:(id)attr forResultAtIndex:(NSUInteger)index
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSArray *)groupedResults;
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (NSArray *)valueLists
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (NSUInteger)indexOfResult:(id)result
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NSNotFound;
|
||||
}
|
||||
|
||||
- (NSArray *)results
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (id)resultAtIndex:(NSUInteger)index
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSUInteger)resultCount
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable/Disable updates
|
||||
- (void)enableUpdates
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (void)disableUpdates
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
// Status of the query...
|
||||
- (BOOL)isStopped
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isGathering
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isStarted
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)stopQuery
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (BOOL)startQuery
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return NO;
|
||||
}
|
||||
|
||||
// Search URLS
|
||||
- (void)setSearchItemURLs:(NSArray *)urls
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSArray *)searchItemURLs
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
// Search scopes
|
||||
- (void)setSearchScopes:(NSArray *)scopes
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSArray *)searchScopes
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
// Notification interval
|
||||
- (void)setNotificationBatchingInterval:(NSTimeInterval)interval
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSTimeInterval)notificationBatchingInterval
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return (NSTimeInterval)0;
|
||||
}
|
||||
|
||||
// Grouping Attributes.
|
||||
- (void)setGroupingAttributes:(NSArray *)attrs
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSArray *)groupingAttributes
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
- (void)setValueListAttributes:(NSArray *)attrs
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSArray *)valueListAttributes
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
// Sort descriptors
|
||||
- (void)setSortDescriptors:(NSArray *)attrs
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSArray *)sortDescriptors
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return [NSArray array];
|
||||
}
|
||||
|
||||
// Predicate
|
||||
- (void)setPredicate:(NSPredicate *)predicate
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (NSPredicate *)predicate
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Delegate
|
||||
- (void)setDelegate:(id)delegate
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
}
|
||||
|
||||
- (id)delegate
|
||||
{
|
||||
[self subclassResponsibility: _cmd];
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
Loading…
Reference in a new issue