28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#import "OFStdIOStream.h"
#import "OFOutOfRangeException.h"
#import "TableGenerator.h"
#import "copyright.h"
#define UNICODE_DATA_URL \
@"http://www.unicode.org/Public/UNIDATA/UnicodeData.txt"
#define CASE_FOLDING_URL \
@"http://www.unicode.org/Public/UNIDATA/CaseFolding.txt"
OF_APPLICATION_DELEGATE(TableGenerator)
@implementation TableGenerator
- (instancetype)init
{
self = [super init];
|
|
|
|
|
|
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#import "OFStdIOStream.h"
#import "OFOutOfRangeException.h"
#import "TableGenerator.h"
#import "copyright.h"
static OFString *const unicodeDataURL =
@"http://www.unicode.org/Public/UNIDATA/UnicodeData.txt";
static OFString *const caseFoldingURL =
@"http://www.unicode.org/Public/UNIDATA/CaseFolding.txt";
OF_APPLICATION_DELEGATE(TableGenerator)
@implementation TableGenerator
- (instancetype)init
{
self = [super init];
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
- (void)applicationDidFinishLaunching
{
OFHTTPRequest *request;
[OFStdOut writeString: @"Downloading UnicodeData.txt…"];
_state = STATE_UNICODE_DATA;
request = [OFHTTPRequest requestWithURL:
[OFURL URLWithString: UNICODE_DATA_URL]];
[_HTTPClient asyncPerformRequest: request];
}
- (void)client: (OFHTTPClient *)client
didPerformRequest: (OFHTTPRequest *)request
response: (OFHTTPResponse *)response
exception: (id)exception
|
|
|
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
- (void)applicationDidFinishLaunching
{
OFHTTPRequest *request;
[OFStdOut writeString: @"Downloading UnicodeData.txt…"];
_state = STATE_UNICODE_DATA;
request = [OFHTTPRequest requestWithURL:
[OFURL URLWithString: unicodeDataURL]];
[_HTTPClient asyncPerformRequest: request];
}
- (void)client: (OFHTTPClient *)client
didPerformRequest: (OFHTTPRequest *)request
response: (OFHTTPResponse *)response
exception: (id)exception
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
[self applyDecompositionRecursivelyForTable: _decompositionCompatTable];
[OFStdOut writeLine: @" done"];
[OFStdOut writeString: @"Downloading CaseFolding.txt…"];
_state = STATE_CASE_FOLDING;
request = [OFHTTPRequest requestWithURL:
[OFURL URLWithString: CASE_FOLDING_URL]];
[_HTTPClient asyncPerformRequest: request];
}
- (void)parseCaseFolding: (OFHTTPResponse *)response
{
OFString *line;
|
|
|
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
[self applyDecompositionRecursivelyForTable: _decompositionCompatTable];
[OFStdOut writeLine: @" done"];
[OFStdOut writeString: @"Downloading CaseFolding.txt…"];
_state = STATE_CASE_FOLDING;
request = [OFHTTPRequest requestWithURL:
[OFURL URLWithString: caseFoldingURL]];
[_HTTPClient asyncPerformRequest: request];
}
- (void)parseCaseFolding: (OFHTTPResponse *)response
{
OFString *line;
|