Monotone-Parent: d656a1a3c9e97c1b1a23a7959821aa3c54780d86

Monotone-Revision: 8b5b324a1c2f984ac4755fedfc3bf7a66169a6af

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-11-18T23:16:15
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-11-18 23:16:15 +00:00
parent 2dcdcb2e89
commit 7e03b255fe
3 changed files with 17 additions and 0 deletions

View File

@@ -1,5 +1,9 @@
2009-11-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSString+Utilities.m (-isJSONString): new utility
method that determines whether the current string is a json
document.
* SoObjects/SOGo/NSDictionary+BSJSONAdditions.m
(+dictionaryWithJSONString:): this constructor now explicitly
returns an NSMutableDictionary to avoid messing with mutable

View File

@@ -65,6 +65,8 @@
// LDIF
- (BOOL) _isLDIFSafe;
- (BOOL) isJSONString;
@end
#endif /* NSSTRING_URL_H */

View File

@@ -30,6 +30,7 @@
#import <NGExtensions/NGQuotedPrintableCoding.h>
#import "NSArray+Utilities.h"
#import "NSDictionary+BSJSONAdditions.h"
#import "NSDictionary+URL.h"
#import "NSString+Utilities.h"
@@ -422,4 +423,14 @@ static NSMutableCharacterSet *safeLDIFStartChars = nil;
return rc;
}
- (BOOL) isJSONString
{
NSDictionary *jsonData;
#warning this method is a quick and dirty way of detecting the file-format
jsonData = [NSDictionary dictionaryWithJSONString: self];
return (jsonData != nil);
}
@end