From d727c23d614e60b7b6e6ded0a7d61a347ab60938 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 14 Jan 2010 14:26:38 +0000 Subject: =?UTF-8?q?=E2=80=A2=20added=20"componentsJoinedByPeriodAndBacktic?= =?UTF-8?q?kQuoted"=20to=20NSArrayAdditions=20=E2=80=A2=20updated=20some?= =?UTF-8?q?=20methods=20in=20in=20SPStringAdditions=20to=2010.5=20code=20w?= =?UTF-8?q?hich=20avoid=20mutableCopy=20and=20they're=20faster?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPArrayAdditions.m | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'Source/SPArrayAdditions.m') diff --git a/Source/SPArrayAdditions.m b/Source/SPArrayAdditions.m index 4742aa83..de7b8a3e 100644 --- a/Source/SPArrayAdditions.m +++ b/Source/SPArrayAdditions.m @@ -31,7 +31,7 @@ * This method quotes all elements with backticks and then joins them with * commas. Use it for field lists as in "SELECT (...) FROM somewhere" */ -- (NSString *)componentsJoinedAndBacktickQuoted; +- (NSString *)componentsJoinedAndBacktickQuoted { NSMutableString *result = [NSMutableString string]; [result setString:@""]; @@ -61,6 +61,21 @@ return result; } +- (NSString *)componentsJoinedByPeriodAndBacktickQuoted +{ + NSMutableString *result = [NSMutableString string]; + [result setString:@""]; + + for (NSString *component in self) + { + if ([result length]) + [result appendString: @"."]; + + [result appendString:[component backtickQuotedString]]; + } + return result; +} + - (NSArray *)subarrayWithIndexes:(NSIndexSet *)indexes { NSMutableArray *subArray = [NSMutableArray arrayWithCapacity:[indexes count]]; -- cgit v1.2.3