Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
Objective-C refresh.
Browse files Browse the repository at this point in the history
  • Loading branch information
NeilFraser committed Feb 12, 2018
1 parent 1c8c8e2 commit 47ba260
Show file tree
Hide file tree
Showing 15 changed files with 533 additions and 486 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
*.pyc
*.komodoproject

.DS_STORE
xcuserdata

dart/tests/Speedtest.dart.js.deps
dart/tests/Speedtest.dart.js.map
3 changes: 0 additions & 3 deletions objectivec/Configurations/Base+SnowLeopard.xcconfig

This file was deleted.

35 changes: 0 additions & 35 deletions objectivec/Configurations/Base.xcconfig

This file was deleted.

2 changes: 0 additions & 2 deletions objectivec/Configurations/Version.xcconfig

This file was deleted.

527 changes: 300 additions & 227 deletions objectivec/DiffMatchPatch.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
2 changes: 1 addition & 1 deletion objectivec/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>de.geheimwerk.${PRODUCT_NAME:rfc1034Identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand Down
28 changes: 11 additions & 17 deletions objectivec/NSString+UriCompatibility.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ @implementation NSString (UriCompatibility)
* @param str The CFStringRef to escape.
* @return The escaped CFStringRef.
*/
- (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility;
{
CFStringRef urlString = CFURLCreateStringByAddingPercentEscapes(NULL,
(CFStringRef)self,
CFSTR(" !~*'();/?:@&=+$,#"),
NULL,
kCFStringEncodingUTF8);
CFMakeCollectable(urlString);
return [(NSString *)urlString autorelease];
- (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility {
NSMutableCharacterSet *allowedCharacters =
[NSMutableCharacterSet characterSetWithCharactersInString:@" !~*'();/?:@&=+$,#"];
[allowedCharacters formUnionWithCharacterSet:[NSCharacterSet URLQueryAllowedCharacterSet]];
NSString *URLString =
[self stringByAddingPercentEncodingWithAllowedCharacters:allowedCharacters];

return URLString;
}

/**
Expand All @@ -49,14 +48,9 @@ - (NSString *)diff_stringByAddingPercentEscapesForEncodeUriCompatibility;
*
* @return The unescaped NSString.
*/
- (NSString *)diff_stringByReplacingPercentEscapesForEncodeUriCompatibility;
{
CFStringRef decodedString = CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
(CFStringRef)self,
CFSTR(""),
kCFStringEncodingUTF8);
CFMakeCollectable(decodedString);
return [(NSString *)decodedString autorelease];
- (NSString *)diff_stringByReplacingPercentEscapesForEncodeUriCompatibility {
NSString *decodedString = [self stringByRemovingPercentEncoding];
return decodedString;
}

@end
10 changes: 5 additions & 5 deletions objectivec/Tests/DiffMatchPatchTest-Info.plist
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034identifier}</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
8 changes: 2 additions & 6 deletions objectivec/Tests/DiffMatchPatchTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@
* ObjC port: jan@geheimwerk.de (Jan Weiß)
*/

#import <SenTestingKit/SenTestingKit.h>
#import <XCTest/XCTest.h>

#import "DiffMatchPatch.h"


@interface DiffMatchPatchTest : SenTestCase {

}

@interface DiffMatchPatchTest : XCTestCase
@end
Loading

0 comments on commit 47ba260

Please sign in to comment.