aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPStringAdditions.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-11-25 23:02:27 +0000
committerBibiko <bibiko@eva.mpg.de>2010-11-25 23:02:27 +0000
commit0898dd7e4da0becb043f3ae3d37ccc4c0c13c44e (patch)
tree1bae36c111bfa94fdb573404fdd917ae50ab7158 /Source/SPStringAdditions.m
parent36af2c018db397c64dd7635b7c79476b4df6d610 (diff)
downloadsequelpro-0898dd7e4da0becb043f3ae3d37ccc4c0c13c44e.tar.gz
sequelpro-0898dd7e4da0becb043f3ae3d37ccc4c0c13c44e.tar.bz2
sequelpro-0898dd7e4da0becb043f3ae3d37ccc4c0c13c44e.zip
• added method 'rot13' to NSString
• Bundle Editor - fixed several GUI issues - added the chance to add meta data to each bundle - each added/duplicated bundle will get an unique UUID in order to be able to identify a Bundle for future purposes like an update detection for installed bundles - changed init process
Diffstat (limited to 'Source/SPStringAdditions.m')
-rw-r--r--Source/SPStringAdditions.m35
1 files changed, 35 insertions, 0 deletions
diff --git a/Source/SPStringAdditions.m b/Source/SPStringAdditions.m
index 1f9f2738..1185756b 100644
--- a/Source/SPStringAdditions.m
+++ b/Source/SPStringAdditions.m
@@ -157,6 +157,41 @@
}
/**
+ * Returns ROT13 representation
+ */
+- (NSString *)rot13
+{
+ NSMutableString *holder = [[NSMutableString alloc] init];
+ unichar theChar;
+ int i;
+
+ for(i = 0; i < [self length]; i++) {
+ theChar = [self characterAtIndex:i];
+ if(theChar <= 122 && theChar >= 97) {
+ if(theChar + 13 > 122)
+ theChar -= 13;
+ else
+ theChar += 13;
+ [holder appendFormat:@"%C", (char)theChar];
+
+
+ } else if(theChar <= 90 && theChar >= 65) {
+ if((int)theChar + 13 > 90)
+ theChar -= 13;
+ else
+ theChar += 13;
+
+ [holder appendFormat:@"%C", theChar];
+
+ } else {
+ [holder appendFormat:@"%C", theChar];
+ }
+ }
+
+ return [NSString stringWithString:holder];
+}
+
+/**
* Escapes HTML special characters.
*/
- (NSString *)HTMLEscapeString