From 4deba12358b4108b178688e9b35e610a4edb91b8 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 7 Jan 2009 16:45:15 +0000 Subject: [PATCH] Monotone-Parent: bd80ab1b5ef73a7bb7780c2f592816cd299c35b8 Monotone-Revision: bab2062ac2f3f3078377ef0d19e780ee5ea5e068 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-01-07T16:45:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 8 ++++++++ SoObjects/SOGo/NSString+Utilities.h | 2 ++ SoObjects/SOGo/NSString+Utilities.m | 7 ++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8f2fb9d2d..a68b1882b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-07 Wolfgang Sourdeau + + * SoObjects/SOGo/NSString+Utilities.m ([NSString + -doubleQuotedString]): new method that returns a double-quoted and + properly escaped version of the string. Since it's the same + algorithm used in jsonRepresentation, the latter is now calling + this new method. + 2009-01-07 Francis Lachapelle * UI/Scheduler/UIxAppointmentEditor.m ([UIxAppointmentEditor diff --git a/SoObjects/SOGo/NSString+Utilities.h b/SoObjects/SOGo/NSString+Utilities.h index b322b78a3..8f6838fbb 100644 --- a/SoObjects/SOGo/NSString+Utilities.h +++ b/SoObjects/SOGo/NSString+Utilities.h @@ -42,6 +42,8 @@ - (NSString *) stringByDetectingURLs; +- (NSString *) doubleQuotedString; + - (NSString *) jsonRepresentation; /* bare email addresses */ diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 6adbe9e6f..6ebc222aa 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -283,7 +283,7 @@ static NSMutableCharacterSet *urlStartChars = nil; return selfCopy; } -- (NSString *) jsonRepresentation +- (NSString *) doubleQuotedString { NSMutableString *representation; @@ -300,6 +300,11 @@ static NSMutableCharacterSet *urlStartChars = nil; return [NSString stringWithFormat: @"\"%@\"", representation]; } +- (NSString *) jsonRepresentation +{ + return [self doubleQuotedString]; +} + - (NSString *) pureEMailAddress { NSString *pureAddress;