Skip to content

Commit 47ba260

Browse files
committedFeb 12, 2018
Objective-C refresh.
1 parent 1c8c8e2 commit 47ba260

15 files changed

+533
-486
lines changed
 

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
*.pyc
55
*.komodoproject
66

7+
.DS_STORE
8+
xcuserdata
9+
710
dart/tests/Speedtest.dart.js.deps
811
dart/tests/Speedtest.dart.js.map

‎objectivec/Configurations/Base+SnowLeopard.xcconfig

-3
This file was deleted.

‎objectivec/Configurations/Base.xcconfig

-35
This file was deleted.

‎objectivec/Configurations/Version.xcconfig

-2
This file was deleted.

‎objectivec/DiffMatchPatch.xcodeproj/project.pbxproj

+300-227
Large diffs are not rendered by default.

‎objectivec/DiffMatchPatch.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict/>
5+
</plist>

‎objectivec/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<key>CFBundleIconFile</key>
1010
<string></string>
1111
<key>CFBundleIdentifier</key>
12-
<string>de.geheimwerk.${PRODUCT_NAME:rfc1034Identifier}</string>
12+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1313
<key>CFBundleInfoDictionaryVersion</key>
1414
<string>6.0</string>
1515
<key>CFBundleName</key>

‎objectivec/NSString+UriCompatibility.m

+11-17
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,14 @@ @implementation NSString (UriCompatibility)
3131
* @param str The CFStringRef to escape.
3232
* @return The escaped CFStringRef.
3333
*/
34-
- (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility;
35-
{
36-
CFStringRef urlString = CFURLCreateStringByAddingPercentEscapes(NULL,
37-
(CFStringRef)self,
38-
CFSTR(" !~*'();/?:@&=+$,#"),
39-
NULL,
40-
kCFStringEncodingUTF8);
41-
CFMakeCollectable(urlString);
42-
return [(NSString *)urlString autorelease];
34+
- (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility {
35+
NSMutableCharacterSet *allowedCharacters =
36+
[NSMutableCharacterSet characterSetWithCharactersInString:@" !~*'();/?:@&=+$,#"];
37+
[allowedCharacters formUnionWithCharacterSet:[NSCharacterSet URLQueryAllowedCharacterSet]];
38+
NSString *URLString =
39+
[self stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];
40+
41+
return URLString;
4342
}
4443

4544
/**
@@ -49,14 +48,9 @@ - (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility;
4948
*
5049
* @return The unescaped NSString.
5150
*/
52-
- (NSString *)diff_stringByReplacingPercentEscapesForEncodeUriCompatibility;
53-
{
54-
CFStringRef decodedString = CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
55-
(CFStringRef)self,
56-
CFSTR(""),
57-
kCFStringEncodingUTF8);
58-
CFMakeCollectable(decodedString);
59-
return [(NSString *)decodedString autorelease];
51+
- (NSString *)diff_stringByReplacingPercentEscapesForEncodeUriCompatibility {
52+
NSString *decodedString = [self stringByRemovingPercentEncoding];
53+
return decodedString;
6054
}
6155

6256
@end

‎objectivec/Tests/DiffMatchPatchTest-Info.plist

100755100644
+5-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
<plist version="1.0">
44
<dict>
55
<key>CFBundleDevelopmentRegion</key>
6-
<string>English</string>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
77
<key>CFBundleExecutable</key>
8-
<string>${EXECUTABLE_NAME}</string>
8+
<string>$(EXECUTABLE_NAME)</string>
99
<key>CFBundleIdentifier</key>
10-
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
1111
<key>CFBundleInfoDictionaryVersion</key>
1212
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
1315
<key>CFBundlePackageType</key>
1416
<string>BNDL</string>
1517
<key>CFBundleShortVersionString</key>
1618
<string>1.0</string>
17-
<key>CFBundleSignature</key>
18-
<string>????</string>
1919
<key>CFBundleVersion</key>
2020
<string>1</string>
2121
</dict>

‎objectivec/Tests/DiffMatchPatchTest.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,9 @@
1919
* ObjC port: jan@geheimwerk.de (Jan Weiß)
2020
*/
2121

22-
#import <SenTestingKit/SenTestingKit.h>
22+
#import <XCTest/XCTest.h>
2323

2424
#import "DiffMatchPatch.h"
2525

26-
27-
@interface DiffMatchPatchTest : SenTestCase {
28-
29-
}
30-
26+
@interface DiffMatchPatchTest : XCTestCase
3127
@end

‎objectivec/Tests/DiffMatchPatchTest.m

+188-188
Large diffs are not rendered by default.
File renamed without changes.
File renamed without changes.

‎objectivec/Tests/speedtest.m

+11-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,20 @@
2626
int main (int argc, const char * argv[]) {
2727
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
2828

29-
NSString *text1 = [NSString stringWithContentsOfFile:@"Speedtest1.txt"
29+
NSString *directory = @"";
30+
if (argc >= 1) {
31+
directory = [NSString stringWithCString:argv[1] encoding:NSUTF8StringEncoding];
32+
}
33+
34+
NSString *filePath1 =
35+
[directory stringByAppendingPathComponent:@"Tests/Speedtest1.txt"];
36+
NSString *text1 = [NSString stringWithContentsOfFile:filePath1
3037
encoding:NSUTF8StringEncoding
3138
error:NULL];
3239

33-
NSString *text2 = [NSString stringWithContentsOfFile:@"Speedtest2.txt"
40+
NSString *filePath2 =
41+
[directory stringByAppendingPathComponent:@"Tests/Speedtest2.txt"];
42+
NSString *text2 = [NSString stringWithContentsOfFile:filePath2
3443
encoding:NSUTF8StringEncoding
3544
error:NULL];
3645

0 commit comments

Comments
 (0)
Please sign in to comment.