1995-04-03 22:59:20 +00:00
|
|
|
/* Interface for NSDictionary for GNUStep
|
1999-09-16 07:21:34 +00:00
|
|
|
Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
|
1995-07-01 19:01:11 +00:00
|
|
|
|
1996-04-17 20:17:45 +00:00
|
|
|
Written by: Andrew Kachites McCallum <mccallum@gnu.ai.mit.edu>
|
1995-07-01 19:01:11 +00:00
|
|
|
Date: 1995
|
1995-04-03 22:59:20 +00:00
|
|
|
|
1996-05-12 00:56:10 +00:00
|
|
|
This file is part of the GNUstep Base Library.
|
1995-04-03 22:59:20 +00:00
|
|
|
|
|
|
|
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
|
1995-04-03 22:59:20 +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.
|
1995-04-03 22:59:20 +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
|
1995-04-03 22:59:20 +00:00
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
Boston, MA 02111 USA.
|
1999-09-16 07:21:34 +00:00
|
|
|
*/
|
1995-04-03 22:59:20 +00:00
|
|
|
|
1996-04-17 19:36:35 +00:00
|
|
|
#ifndef _NSDictionary_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
#define _NSDictionary_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
#import <Foundation/NSObject.h>
|
2009-12-29 16:21:01 +00:00
|
|
|
#import <Foundation/NSEnumerator.h>
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2009-12-29 16:21:01 +00:00
|
|
|
@class NSArray, NSString, NSURL;
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2009-12-29 16:21:01 +00:00
|
|
|
@interface NSDictionary : NSObject <NSCoding, NSCopying, NSMutableCopying, NSFastEnumeration>
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (id) dictionary;
|
|
|
|
+ (id) dictionaryWithContentsOfFile: (NSString*)path;
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2003-07-15 16:35:11 +00:00
|
|
|
+ (id) dictionaryWithContentsOfURL: (NSURL*)aURL;
|
|
|
|
#endif
|
2002-01-11 10:10:35 +00:00
|
|
|
+ (id) dictionaryWithDictionary: (NSDictionary*)otherDictionary;
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (id) dictionaryWithObject: (id)object forKey: (id)key;
|
|
|
|
+ (id) dictionaryWithObjects: (NSArray*)objects forKeys: (NSArray*)keys;
|
|
|
|
+ (id) dictionaryWithObjects: (id*)objects
|
|
|
|
forKeys: (id*)keys
|
2009-02-23 20:42:32 +00:00
|
|
|
count: (NSUInteger)count;
|
2002-01-11 10:10:35 +00:00
|
|
|
+ (id) dictionaryWithObjectsAndKeys: (id)firstObject, ...;
|
2001-01-09 09:17:31 +00:00
|
|
|
|
|
|
|
- (NSArray*) allKeys;
|
|
|
|
- (NSArray*) allKeysForObject: (id)anObject;
|
|
|
|
- (NSArray*) allValues;
|
2009-02-23 20:42:32 +00:00
|
|
|
- (NSUInteger) count; // Primitive
|
2001-01-09 09:17:31 +00:00
|
|
|
- (NSString*) description;
|
|
|
|
- (NSString*) descriptionInStringsFileFormat;
|
|
|
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale;
|
|
|
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
2009-02-23 20:42:32 +00:00
|
|
|
indent: (NSUInteger)level;
|
2001-01-09 09:17:31 +00:00
|
|
|
|
2004-09-07 05:43:20 +00:00
|
|
|
- (id) init;
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithContentsOfFile: (NSString*)path;
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2003-07-15 16:35:11 +00:00
|
|
|
- (id) initWithContentsOfURL: (NSURL*)aURL;
|
|
|
|
#endif
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithDictionary: (NSDictionary*)otherDictionary;
|
2002-01-11 10:10:35 +00:00
|
|
|
- (id) initWithDictionary: (NSDictionary*)other copyItems: (BOOL)shouldCopy;
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithObjects: (NSArray*)objects forKeys: (NSArray*)keys;
|
2002-01-11 10:10:35 +00:00
|
|
|
- (id) initWithObjectsAndKeys: (id)firstObject, ...;
|
2001-01-09 09:17:31 +00:00
|
|
|
- (id) initWithObjects: (id*)objects
|
|
|
|
forKeys: (id*)keys
|
2009-02-23 20:42:32 +00:00
|
|
|
count: (NSUInteger)count; // Primitive
|
1995-05-05 18:32:50 +00:00
|
|
|
- (BOOL) isEqualToDictionary: (NSDictionary*)other;
|
1998-01-19 15:20:15 +00:00
|
|
|
|
2001-01-09 09:17:31 +00:00
|
|
|
- (NSEnumerator*) keyEnumerator; // Primitive
|
1998-01-19 15:20:15 +00:00
|
|
|
- (NSArray*) keysSortedByValueUsingSelector: (SEL)comp;
|
2001-01-09 09:17:31 +00:00
|
|
|
- (NSEnumerator*) objectEnumerator; // Primitive
|
|
|
|
- (id) objectForKey: (id)aKey; // Primitive
|
2002-01-11 10:10:35 +00:00
|
|
|
- (NSArray*) objectsForKeys: (NSArray*)keys notFoundMarker: (id)marker;
|
1998-01-19 15:20:15 +00:00
|
|
|
|
2002-01-11 10:10:35 +00:00
|
|
|
- (BOOL) writeToFile: (NSString*)path atomically: (BOOL)useAuxiliaryFile;
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2002-02-27 09:25:30 +00:00
|
|
|
- (id) valueForKey: (NSString*)key;
|
2002-01-11 10:10:35 +00:00
|
|
|
- (BOOL) writeToURL: (NSURL*)url atomically: (BOOL)useAuxiliaryFile;
|
2001-07-16 07:08:47 +00:00
|
|
|
#endif
|
1995-04-03 22:59:20 +00:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSMutableDictionary: NSDictionary
|
|
|
|
|
2009-02-23 20:42:32 +00:00
|
|
|
+ (id) dictionaryWithCapacity: (NSUInteger)numItems;
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2001-01-09 09:17:31 +00:00
|
|
|
- (void) addEntriesFromDictionary: (NSDictionary*)otherDictionary;
|
2009-02-23 20:42:32 +00:00
|
|
|
- (id) initWithCapacity: (NSUInteger)numItems; // Primitive
|
1995-05-05 18:32:50 +00:00
|
|
|
- (void) removeAllObjects;
|
2001-01-09 09:17:31 +00:00
|
|
|
- (void) removeObjectForKey: (id)aKey; // Primitive
|
1995-05-05 18:32:50 +00:00
|
|
|
- (void) removeObjectsForKeys: (NSArray*)keyArray;
|
2001-01-09 09:17:31 +00:00
|
|
|
- (void) setObject: (id)anObject forKey: (id)aKey; // Primitive
|
1998-01-19 15:20:15 +00:00
|
|
|
- (void) setDictionary: (NSDictionary*)otherDictionary;
|
2006-10-31 07:05:46 +00:00
|
|
|
#if OS_API_VERSION(GS_API_MACOSX, GS_API_LATEST)
|
2002-02-27 09:25:30 +00:00
|
|
|
- (void) takeStoredValue: (id)value forKey: (NSString*)key;
|
|
|
|
- (void) takeValue: (id)value forKey: (NSString*)key;
|
2004-02-24 19:43:34 +00:00
|
|
|
- (void) setValue: (id)value forKey: (NSString*)key;
|
2002-02-27 09:25:30 +00:00
|
|
|
#endif
|
1995-04-03 22:59:20 +00:00
|
|
|
@end
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1995-04-03 22:59:20 +00:00
|
|
|
#endif
|