diff options
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]]; |