forked from KosmicTask/Fragaria
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NSStringICUAdditions.h
78 lines (66 loc) · 2.41 KB
/
NSStringICUAdditions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// NSStringICUAdditions.h
// CocoaICU
//
// Created by Aaron Evans on 11/19/06.
// Copyright 2006 Aaron Evans. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class ICUPattern;
@interface NSString (NSStringICUAdditions)
/*!
@method nativeUTF16Encoding
@abstract The native UTF16 encoding on the given machine.
@discussion The native UTF16 encoding on the given machine.
*/
+(NSStringEncoding)nativeUTF16Encoding;
/*!
@method stringWithICUString:
@abstract Create an NSString from a UTF16 encoded string.
@discussion Create an NSString from a UTF16 encoded string.
*/
+(NSString *)stringWithICUString:(void *)utf16EncodedString;
/*!
@method UTF16String
@abstract Returns a UTF16 encoded string in the native encoding.
@discussion This string has a retain policy equivalent to UTF8String. In
other words, if you want to keep this string around beyond the given autorelease
context, you need to copy the returned string.
*/
-(void *)UTF16String;
/*!
@method copyUTF16String
@abstract returns a copy
@discussion Returns a UTF16 encoded string in the native encoding. The returned
buffer must eventually be freed.
*/
-(void *)copyUTF16String;
/*!
@method findPattern:
@abstract Finds the given expression and and groups.
@discussion Returns the match and any grouped matches in the returned
array. The first element of the array is the entire match and subsequent
elements are the groups in the order the matches occur.
*/
-(NSArray *)findPattern:(NSString *)aRegex;
/*!
@method componentsSeparatedByPattern:
@abstract Returns the components separated by the given pattern.
@discussion Break a string into components where components separated
by occurrences of the given pattern.
*/
-(NSArray *)componentsSeparatedByPattern:(NSString *)aRegex;
/*!
@method replaceOccurrencesOfPattern:withString:
@abstract Replace occurrences of the pattern with the replacement text.
@discussion Replace occurrences of the pattern with the replacement text.
The replacement text may contain backrerferences.
*/
-(NSString *)replaceOccurrencesOfPattern:(NSString *)aPattern withString:(NSString *)replacementText;
/*!
@method matchesPattern:
@abstract Returns YES if the string matches the entire pattern.
@discussion Returns YES if the string matches the entire pattern.
*/
-(BOOL)matchesPattern:(NSString *)aRegex;
@end