Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 41 lines (34 sloc) 1.209 kb
4d4563c @JanX2 Objective C port of “diff-match-patch” as released in sub-folder “obj…
authored
1 /*
2 * Diff Match and Patch
3 *
4 * Copyright 2010 geheimwerk.de.
5 * http://code.google.com/p/google-diff-match-patch/
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 *
19 * Author: fraser@google.com (Neil Fraser)
20 * ObjC port: jan@geheimwerk.de (Jan Weiß)
21 */
22
23 #import "NSString+UnicharUtilities.h"
fda8aa4 @JanX2 Preparing for ARC using JXArcCompatibilityMacros.
authored
24 #import "JXArcCompatibilityMacros.h"
4d4563c @JanX2 Objective C port of “diff-match-patch” as released in sub-folder “obj…
authored
25
26
27 @implementation NSString (UnicharUtilities)
28
29 + (NSString *)diff_stringFromUnichar:(unichar)ch;
30 {
31 CFStringRef c = CFStringCreateWithCharacters(kCFAllocatorDefault, &ch, 1);
fda8aa4 @JanX2 Preparing for ARC using JXArcCompatibilityMacros.
authored
32 return JX_TRANSFER_CF_TO_OBJC(NSString *, c);
4d4563c @JanX2 Objective C port of “diff-match-patch” as released in sub-folder “obj…
authored
33 }
34
35 - (NSString *)diff_substringWithCharacterAtIndex:(NSUInteger)anIndex;
36 {
37 return [self substringWithRange:NSMakeRange(anIndex, 1)];
38 }
39
40 @end
Something went wrong with that request. Please try again.