root/Trunk/AIUtilities.framework/Versions/A/Headers/AIDictionaryAdditions.h @ 2

Revision 2, 2.7 KB (checked in by jon, 16 years ago)

Initial commit of skeletal project.

Line 
1/*-------------------------------------------------------------------------------------------------------*\
2| Adium, Copyright (C) 2001-2005, Adam Iser  (adamiser@mac.com | http://www.adiumx.com)                   |
3\---------------------------------------------------------------------------------------------------------/
4 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU
5 | General Public License as published by the Free Software Foundation; either version 2 of the License,
6 | or (at your option) any later version.
7 |
8 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
9 | the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
10 | Public License for more details.
11 |
12 | You should have received a copy of the GNU General Public License along with this program; if not,
13 | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
14 \------------------------------------------------------------------------------------------------------ */
15
16@interface NSDictionary (AIDictionaryAdditions)
17
18+ (NSDictionary *)dictionaryNamed:(NSString *)name forClass:(Class)inClass;
19+ (NSDictionary *)dictionaryAtPath:(NSString *)path withName:(NSString *)name create:(BOOL)create;
20- (BOOL)writeToPath:(NSString *)path withName:(NSString *)name;
21
22- (NSDictionary *)dictionaryByTranslating:(NSDictionary *)translation adding:(NSDictionary *)addition removing:(NSSet *)removal;
23
24- (NSSet *)allKeysSet;
25- (NSMutableSet *)allKeysMutableSet;
26
27//If flag is non-NO, keys that are in both dicts but whose values are different will be included in both sets.
28- (void)compareWithPriorDictionary:(NSDictionary *)other
29                      getAddedKeys:(out NSSet **)outAddedKeys
30                    getRemovedKeys:(out NSSet **)outRemovedKeys
31                includeChangedKeys:(BOOL)flag;
32
33- (NSDictionary *)dictionaryWithIntersectionWithSetOfKeys:(NSSet *)keys;
34- (NSDictionary *)dictionaryWithDifferenceWithSetOfKeys:(NSSet *)keys;
35
36//Assumes that its key-value pairs (both key and value being NSStrings) are CSS properties. Generates CSS source code like this:
37//      font-family: Helvetica; font-size: 12pt; font-weight: bold; font-style: italic;
38- (NSString *)CSSString;
39
40- (BOOL)validateAsPropertyList;
41
42@end
43
44@interface NSMutableDictionary (AIDictionaryAdditions)
45
46+ (NSMutableDictionary *)dictionaryAtPath:(NSString *)path withName:(NSString *)name create:(BOOL)create;
47
48- (void)translate:(NSDictionary *)translation add:(NSDictionary *)addition remove:(NSSet *)removal;
49
50- (void)intersectSetOfKeys:(NSSet *)keys;
51- (void)minusSetOfKeys:(NSSet *)keys;
52
53@end
Note: See TracBrowser for help on using the browser.