mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-25 08:23:28 +00:00
Monotone-Parent: 04980f497e9c317b4d93db9ab0dae2f1e8e464ba
Monotone-Revision: af5a859ee61b26ffd727e648f95c54ee60e3079e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-08-15T19:48:35 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
@interface NSDictionary (SOGoDictionaryUtilities)
|
||||
|
||||
- (NSString *) jsonRepresentation;
|
||||
- (NSString *) keysWithFormat: (NSString *) keyFormat;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSString.h>
|
||||
|
||||
#import "NSArray+Utilities.h"
|
||||
#import "NSObject+Utilities.h"
|
||||
#import "NSDictionary+Utilities.h"
|
||||
|
||||
@@ -52,4 +53,27 @@
|
||||
return representation;
|
||||
}
|
||||
|
||||
- (NSString *) keysWithFormat: (NSString *) keyFormat
|
||||
{
|
||||
NSArray *keys, *allKeys;
|
||||
unsigned int count, max;
|
||||
NSMutableString *keysWithFormat;
|
||||
id value;
|
||||
|
||||
keysWithFormat = [NSMutableString stringWithString: keyFormat];
|
||||
|
||||
allKeys = [self allKeys];
|
||||
keys = [allKeys stringsWithFormat: @"%{%@}"];
|
||||
|
||||
max = [allKeys count];
|
||||
for (count = 0; count < max; count++)
|
||||
{
|
||||
value = [self objectForKey: [allKeys objectAtIndex: count]];
|
||||
[keysWithFormat replaceString: [keys objectAtIndex: count]
|
||||
withString: [value description]];
|
||||
}
|
||||
|
||||
return keysWithFormat;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user