diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-14 14:26:38 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-14 14:26:38 +0000 |
commit | d727c23d614e60b7b6e6ded0a7d61a347ab60938 (patch) | |
tree | 02c94de18c8a94ad699d231b4ed52d6ee7c2d7c0 /Source/SPArrayAdditions.m | |
parent | c6b739f9927b6ed0feebf7515db02899b2424382 (diff) | |
download | sequelpro-d727c23d614e60b7b6e6ded0a7d61a347ab60938.tar.gz sequelpro-d727c23d614e60b7b6e6ded0a7d61a347ab60938.tar.bz2 sequelpro-d727c23d614e60b7b6e6ded0a7d61a347ab60938.zip |
• added "componentsJoinedByPeriodAndBacktickQuoted" to NSArrayAdditions
• updated some methods in in SPStringAdditions to 10.5 code which avoid mutableCopy and they're faster
Diffstat (limited to 'Source/SPArrayAdditions.m')
-rw-r--r-- | Source/SPArrayAdditions.m | 17 |
1 files changed, 16 insertions, 1 deletions
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]]; |