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
|
|
|
|
modify it under the terms of the GNU Library 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 Library General Public
|
|
|
|
License along with this library; if not, write to the Free
|
2005-05-22 03:32:16 +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
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2000-06-14 04:03:56 +00:00
|
|
|
#include <Foundation/NSObject.h>
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2001-07-16 07:08:47 +00:00
|
|
|
@class NSArray, NSString, NSEnumerator, NSURL;
|
1995-04-03 22:59:20 +00:00
|
|
|
|
1998-07-30 16:34:32 +00:00
|
|
|
@interface NSDictionary : NSObject <NSCoding, NSCopying, NSMutableCopying>
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (id) dictionary;
|
|
|
|
+ (id) dictionaryWithContentsOfFile: (NSString*)path;
|
2003-07-15 16:35:11 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
+ (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
|
|
|
|
count: (unsigned)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;
|
|
|
|
- (unsigned) count; // Primitive
|
|
|
|
- (NSString*) description;
|
|
|
|
- (NSString*) descriptionInStringsFileFormat;
|
|
|
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale;
|
|
|
|
- (NSString*) descriptionWithLocale: (NSDictionary*)locale
|
|
|
|
indent: (unsigned int)level;
|
|
|
|
|
2004-09-07 05:43:20 +00:00
|
|
|
- (id) init;
|
1999-09-16 07:21:34 +00:00
|
|
|
- (id) initWithContentsOfFile: (NSString*)path;
|
2003-07-15 16:35:11 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (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
|
|
|
|
count: (unsigned)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;
|
2001-07-16 07:08:47 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
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
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
+ (id) dictionaryWithCapacity: (unsigned)numItems;
|
1995-04-03 22:59:20 +00:00
|
|
|
|
2001-01-09 09:17:31 +00:00
|
|
|
- (void) addEntriesFromDictionary: (NSDictionary*)otherDictionary;
|
|
|
|
- (id) initWithCapacity: (unsigned)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;
|
2002-02-27 09:25:30 +00:00
|
|
|
#ifndef STRICT_OPENSTEP
|
|
|
|
- (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
|
|
|
|
|
|
|
|
#endif
|