Monotone-Parent: 31a2a168c052c18dcda914f1ebbe5bc651fdd779
Monotone-Revision: b2d46c6b2a5ef48f18ce5b5dae9339ace2025d0d Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-04T16:26:22 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
012aad04f8
commit
dd6fb4c07d
|
@ -1,3 +1,11 @@
|
|||
2009-11-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/NSDictionary+Utilities.m
|
||||
(+dictionaryFromStringsFile:): instantiate autoreleased objects.
|
||||
|
||||
* SoObjects/SOGo/NSArray+Utilities.m (-jsonRepresentation):
|
||||
instantiate autoreleased objects.
|
||||
|
||||
2009-10-30 Francis Lachapelle <flachapelle@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/SchedulerUI.js: the events list is now
|
||||
|
|
|
@ -174,18 +174,12 @@
|
|||
NSEnumerator *elements;
|
||||
NSString *representation;
|
||||
|
||||
jsonElements = [NSMutableArray new];
|
||||
|
||||
jsonElements = [NSMutableArray array];
|
||||
elements = [self objectEnumerator];
|
||||
currentElement = [elements nextObject];
|
||||
while (currentElement)
|
||||
{
|
||||
[jsonElements addObject: [currentElement jsonRepresentation]];
|
||||
currentElement = [elements nextObject];
|
||||
}
|
||||
while ((currentElement = [elements nextObject]))
|
||||
[jsonElements addObject: [currentElement jsonRepresentation]];
|
||||
representation = [NSString stringWithFormat: @"[%@]",
|
||||
[jsonElements componentsJoinedByString: @", "]];
|
||||
[jsonElements autorelease];
|
||||
|
||||
return representation;
|
||||
}
|
||||
|
|
|
@ -29,10 +29,11 @@
|
|||
#import <Foundation/NSCharacterSet.h>
|
||||
|
||||
#import <NGExtensions/NGBase64Coding.h>
|
||||
#import <SoObjects/SOGo/NSString+Utilities.h>
|
||||
|
||||
#import "NSArray+Utilities.h"
|
||||
#import "NSObject+Utilities.h"
|
||||
#import "NSString+Utilities.h"
|
||||
|
||||
#import "NSDictionary+Utilities.h"
|
||||
|
||||
@implementation NSDictionary (SOGoDictionaryUtilities)
|
||||
|
@ -43,15 +44,14 @@
|
|||
NSMutableData *content;
|
||||
NSDictionary *newDictionary;
|
||||
|
||||
content = [NSMutableData new];
|
||||
content = [NSMutableData data];
|
||||
[content appendBytes: "{" length: 1];
|
||||
[content appendData: [NSData dataWithContentsOfFile: file]];
|
||||
[content appendBytes: "}" length: 1];
|
||||
serialized = [[NSString alloc] initWithData: content
|
||||
encoding: NSUTF8StringEncoding];
|
||||
[content release];
|
||||
[serialized autorelease];
|
||||
newDictionary = [serialized propertyList];
|
||||
[serialized release];
|
||||
|
||||
return newDictionary;
|
||||
}
|
||||
|
@ -62,20 +62,17 @@
|
|||
NSString *representation, *currentKey, *currentValue, *currentPair;
|
||||
NSEnumerator *keys;
|
||||
|
||||
values = [NSMutableArray new];
|
||||
values = [NSMutableArray array];
|
||||
keys = [[self allKeys] objectEnumerator];
|
||||
currentKey = [keys nextObject];
|
||||
while (currentKey)
|
||||
while ((currentKey = [keys nextObject]))
|
||||
{
|
||||
currentValue = [[self objectForKey: currentKey] jsonRepresentation];
|
||||
currentPair = [NSString stringWithFormat: @"%@: %@",
|
||||
[currentKey jsonRepresentation], currentValue];
|
||||
[values addObject: currentPair];
|
||||
currentKey = [keys nextObject];
|
||||
}
|
||||
representation = [NSString stringWithFormat: @"{%@}",
|
||||
[values componentsJoinedByString: @", "]];
|
||||
[values release];
|
||||
|
||||
return representation;
|
||||
}
|
||||
|
@ -202,6 +199,4 @@
|
|||
@" the number of keys."];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
|
Loading…
Reference in New Issue