-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathSSYTextCodec.h
41 lines (34 loc) · 1.46 KB
/
SSYTextCodec.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
#import <Cocoa/Cocoa.h>
@interface SSYTextCodec : NSObject {
}
/*!
@brief Attempts to decode data read in from a supposed text
file into a string, by detecting the encoding.
@detail
@param fileDataIn The data in the file
@param textStringOut A pointer, or nil. On output, if non-nil,
will point to the decoded string.
@param stringEncodingStated A pointer, or NULL. On output,
if non-NULL, points to the type of string encoding stated in the
file header.
@param stringEncodingStated A pointer, or NULL. On output,
if non-NULL, points to to the type of encoding actually used to decode
the data.
@param newLinesFound A pointer, or nil. On output, if non-nil,
points to a short string which is the line endings found in the data.
@param error_p A pointer, or nil. If non-nil, on output, if an
error occurred, points to the relevant NSError.
@result YES if the data could be decoded, otherwise NO.
*/
+ (BOOL)decodeTextData:(NSData*)fileDataIn
decodedString_p:(NSString**)decodedString_p
stringEncodingStated_p:(NSStringEncoding*)stringEncodingStated_p
stringEncodingUsed_p:(NSStringEncoding*)stringEncodingUsed_p
newLinesFound_p:(NSString**)newLinesFound_p
error_p:(NSError**)error_p ;
/*!
@brief Returns a string expressing the name of the encoding represented
by an NSStringEncoding constant.
*/
+ (NSString*)humanReadableStringEncoding:(NSStringEncoding)stringEncoding ;
@end