Lines 38-44
Link Here
|
38 |
|
38 |
|
39 |
if (!createdIterator) { |
39 |
if (!createdIterator) { |
40 |
UErrorCode openStatus = U_ZERO_ERROR; |
40 |
UErrorCode openStatus = U_ZERO_ERROR; |
41 |
iterator = static_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); |
41 |
iterator = reinterpret_cast<TextBreakIterator*>(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &openStatus)); |
42 |
createdIterator = true; |
42 |
createdIterator = true; |
43 |
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); |
43 |
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); |
44 |
} |
44 |
} |
Lines 46-52
Link Here
|
46 |
return 0; |
46 |
return 0; |
47 |
|
47 |
|
48 |
UErrorCode setTextStatus = U_ZERO_ERROR; |
48 |
UErrorCode setTextStatus = U_ZERO_ERROR; |
49 |
ubrk_setText(iterator, string, length, &setTextStatus); |
49 |
ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus); |
50 |
if (U_FAILURE(setTextStatus)) |
50 |
if (U_FAILURE(setTextStatus)) |
51 |
return 0; |
51 |
return 0; |
52 |
|
52 |
|
Lines 85-118
Link Here
|
85 |
staticSentenceBreakIterator, UBRK_SENTENCE, string, length); |
85 |
staticSentenceBreakIterator, UBRK_SENTENCE, string, length); |
86 |
} |
86 |
} |
87 |
|
87 |
|
88 |
int textBreakFirst(TextBreakIterator* bi) |
88 |
int textBreakFirst(TextBreakIterator* iterator) |
89 |
{ |
89 |
{ |
90 |
return ubrk_first(bi); |
90 |
return ubrk_first(reinterpret_cast<UBreakIterator*>(iterator)); |
91 |
} |
91 |
} |
92 |
|
92 |
|
93 |
int textBreakNext(TextBreakIterator* bi) |
93 |
int textBreakNext(TextBreakIterator* iterator) |
94 |
{ |
94 |
{ |
95 |
return ubrk_next(bi); |
95 |
return ubrk_next(reinterpret_cast<UBreakIterator*>(iterator)); |
96 |
} |
96 |
} |
97 |
|
97 |
|
98 |
int textBreakPreceding(TextBreakIterator* bi, int pos) |
98 |
int textBreakPreceding(TextBreakIterator* iterator, int pos) |
99 |
{ |
99 |
{ |
100 |
return ubrk_preceding(bi, pos); |
100 |
return ubrk_preceding(reinterpret_cast<UBreakIterator*>(iterator), pos); |
101 |
} |
101 |
} |
102 |
|
102 |
|
103 |
int textBreakFollowing(TextBreakIterator* bi, int pos) |
103 |
int textBreakFollowing(TextBreakIterator* iterator, int pos) |
104 |
{ |
104 |
{ |
105 |
return ubrk_following(bi, pos); |
105 |
return ubrk_following(reinterpret_cast<UBreakIterator*>(iterator), pos); |
106 |
} |
106 |
} |
107 |
|
107 |
|
108 |
int textBreakCurrent(TextBreakIterator* bi) |
108 |
int textBreakCurrent(TextBreakIterator* iterator) |
109 |
{ |
109 |
{ |
110 |
return ubrk_current(bi); |
110 |
return ubrk_current(reinterpret_cast<UBreakIterator*>(iterator)); |
111 |
} |
111 |
} |
112 |
|
112 |
|
113 |
bool isTextBreak(TextBreakIterator* bi, int pos) |
113 |
bool isTextBreak(TextBreakIterator* iterator, int position) |
114 |
{ |
114 |
{ |
115 |
return ubrk_isBoundary(bi, pos); |
115 |
return ubrk_isBoundary(reinterpret_cast<UBreakIterator*>(iterator), position); |
116 |
} |
116 |
} |
117 |
|
117 |
|
118 |
#ifndef BUILDING_ON_TIGER |
118 |
#ifndef BUILDING_ON_TIGER |
Lines 126-132
Link Here
|
126 |
UParseError parseStatus; |
126 |
UParseError parseStatus; |
127 |
UErrorCode openStatus = U_ZERO_ERROR; |
127 |
UErrorCode openStatus = U_ZERO_ERROR; |
128 |
String rules(breakRules); |
128 |
String rules(breakRules); |
129 |
iterator = static_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); |
129 |
iterator = reinterpret_cast<TextBreakIterator*>(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &parseStatus, &openStatus)); |
130 |
createdIterator = true; |
130 |
createdIterator = true; |
131 |
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); |
131 |
ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), "ICU could not open a break iterator: %s (%d)", u_errorName(openStatus), openStatus); |
132 |
} |
132 |
} |
Lines 134-140
Link Here
|
134 |
return 0; |
134 |
return 0; |
135 |
|
135 |
|
136 |
UErrorCode setTextStatus = U_ZERO_ERROR; |
136 |
UErrorCode setTextStatus = U_ZERO_ERROR; |
137 |
ubrk_setText(iterator, string, length, &setTextStatus); |
137 |
ubrk_setText(reinterpret_cast<UBreakIterator*>(iterator), string, length, &setTextStatus); |
138 |
if (U_FAILURE(setTextStatus)) |
138 |
if (U_FAILURE(setTextStatus)) |
139 |
return 0; |
139 |
return 0; |
140 |
|
140 |
|