mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-16 10:48:50 +00:00
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:
@@ -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
|
||||
|
||||
@@ -65,6 +65,8 @@
|
||||
// LDIF
|
||||
- (BOOL) _isLDIFSafe;
|
||||
|
||||
- (BOOL) isJSONString;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* NSSTRING_URL_H */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user