Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(376)

Side by Side Diff: source/common/ubrk.cpp

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/common/ubidiwrt.c ('k') | source/common/ucase_props_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ******************************************************************************** 2 ********************************************************************************
3 * Copyright (C) 1996-2013, International Business Machines 3 * Copyright (C) 1996-2015, International Business Machines
4 * Corporation and others. All Rights Reserved. 4 * Corporation and others. All Rights Reserved.
5 ******************************************************************************** 5 ********************************************************************************
6 */ 6 */
7 7
8 #include "unicode/utypes.h" 8 #include "unicode/utypes.h"
9 9
10 #if !UCONFIG_NO_BREAK_ITERATION 10 #if !UCONFIG_NO_BREAK_ITERATION
11 11
12 #include "unicode/ubrk.h" 12 #include "unicode/ubrk.h"
13 13
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 { 157 {
158 delete (BreakIterator *)bi; 158 delete (BreakIterator *)bi;
159 } 159 }
160 160
161 U_CAPI void U_EXPORT2 161 U_CAPI void U_EXPORT2
162 ubrk_setText(UBreakIterator* bi, 162 ubrk_setText(UBreakIterator* bi,
163 const UChar* text, 163 const UChar* text,
164 int32_t textLength, 164 int32_t textLength,
165 UErrorCode* status) 165 UErrorCode* status)
166 { 166 {
167 BreakIterator *brit = (BreakIterator *)bi;
168 UText ut = UTEXT_INITIALIZER; 167 UText ut = UTEXT_INITIALIZER;
169 utext_openUChars(&ut, text, textLength, status); 168 utext_openUChars(&ut, text, textLength, status);
170 brit->setText(&ut, *status); 169 ((BreakIterator*)bi)->setText(&ut, *status);
171 // A stack allocated UText wrapping a UChar * string 170 // A stack allocated UText wrapping a UChar * string
172 // can be dumped without explicitly closing it. 171 // can be dumped without explicitly closing it.
173 } 172 }
174 173
175 174
176 175
177 U_CAPI void U_EXPORT2 176 U_CAPI void U_EXPORT2
178 ubrk_setUText(UBreakIterator *bi, 177 ubrk_setUText(UBreakIterator *bi,
179 UText *text, 178 UText *text,
180 UErrorCode *status) 179 UErrorCode *status)
181 { 180 {
182 RuleBasedBreakIterator *brit = (RuleBasedBreakIterator *)bi; 181 ((BreakIterator*)bi)->setText(text, *status);
183 brit->RuleBasedBreakIterator::setText(text, *status);
184 } 182 }
185 183
186 184
187 185
188 186
189 187
190 U_CAPI int32_t U_EXPORT2 188 U_CAPI int32_t U_EXPORT2
191 ubrk_current(const UBreakIterator *bi) 189 ubrk_current(const UBreakIterator *bi)
192 { 190 {
193 191
194 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::current(); 192 return ((BreakIterator*)bi)->current();
195 } 193 }
196 194
197 U_CAPI int32_t U_EXPORT2 195 U_CAPI int32_t U_EXPORT2
198 ubrk_next(UBreakIterator *bi) 196 ubrk_next(UBreakIterator *bi)
199 { 197 {
200 198
201 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::next(); 199 return ((BreakIterator*)bi)->next();
202 } 200 }
203 201
204 U_CAPI int32_t U_EXPORT2 202 U_CAPI int32_t U_EXPORT2
205 ubrk_previous(UBreakIterator *bi) 203 ubrk_previous(UBreakIterator *bi)
206 { 204 {
207 205
208 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::previous(); 206 return ((BreakIterator*)bi)->previous();
209 } 207 }
210 208
211 U_CAPI int32_t U_EXPORT2 209 U_CAPI int32_t U_EXPORT2
212 ubrk_first(UBreakIterator *bi) 210 ubrk_first(UBreakIterator *bi)
213 { 211 {
214 212
215 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::first(); 213 return ((BreakIterator*)bi)->first();
216 } 214 }
217 215
218 U_CAPI int32_t U_EXPORT2 216 U_CAPI int32_t U_EXPORT2
219 ubrk_last(UBreakIterator *bi) 217 ubrk_last(UBreakIterator *bi)
220 { 218 {
221 219
222 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::last(); 220 return ((BreakIterator*)bi)->last();
223 } 221 }
224 222
225 U_CAPI int32_t U_EXPORT2 223 U_CAPI int32_t U_EXPORT2
226 ubrk_preceding(UBreakIterator *bi, 224 ubrk_preceding(UBreakIterator *bi,
227 int32_t offset) 225 int32_t offset)
228 { 226 {
229 227
230 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::preceding(offset ); 228 return ((BreakIterator*)bi)->preceding(offset);
231 } 229 }
232 230
233 U_CAPI int32_t U_EXPORT2 231 U_CAPI int32_t U_EXPORT2
234 ubrk_following(UBreakIterator *bi, 232 ubrk_following(UBreakIterator *bi,
235 int32_t offset) 233 int32_t offset)
236 { 234 {
237 235
238 return ((RuleBasedBreakIterator*)bi)->RuleBasedBreakIterator::following(offset ); 236 return ((BreakIterator*)bi)->following(offset);
239 } 237 }
240 238
241 U_CAPI const char* U_EXPORT2 239 U_CAPI const char* U_EXPORT2
242 ubrk_getAvailable(int32_t index) 240 ubrk_getAvailable(int32_t index)
243 { 241 {
244 242
245 return uloc_getAvailable(index); 243 return uloc_getAvailable(index);
246 } 244 }
247 245
248 U_CAPI int32_t U_EXPORT2 246 U_CAPI int32_t U_EXPORT2
249 ubrk_countAvailable() 247 ubrk_countAvailable()
250 { 248 {
251 249
252 return uloc_countAvailable(); 250 return uloc_countAvailable();
253 } 251 }
254 252
255 253
256 U_CAPI UBool U_EXPORT2 254 U_CAPI UBool U_EXPORT2
257 ubrk_isBoundary(UBreakIterator *bi, int32_t offset) 255 ubrk_isBoundary(UBreakIterator *bi, int32_t offset)
258 { 256 {
259 return ((RuleBasedBreakIterator *)bi)->RuleBasedBreakIterator::isBoundary(of fset); 257 return ((BreakIterator*)bi)->isBoundary(offset);
260 } 258 }
261 259
262 260
263 U_CAPI int32_t U_EXPORT2 261 U_CAPI int32_t U_EXPORT2
264 ubrk_getRuleStatus(UBreakIterator *bi) 262 ubrk_getRuleStatus(UBreakIterator *bi)
265 { 263 {
266 return ((RuleBasedBreakIterator *)bi)->RuleBasedBreakIterator::getRuleStatus (); 264 return ((BreakIterator*)bi)->getRuleStatus();
267 } 265 }
268 266
269 U_CAPI int32_t U_EXPORT2 267 U_CAPI int32_t U_EXPORT2
270 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status) 268 ubrk_getRuleStatusVec(UBreakIterator *bi, int32_t *fillInVec, int32_t capacity, UErrorCode *status)
271 { 269 {
272 return ((RuleBasedBreakIterator *)bi)->RuleBasedBreakIterator::getRuleStatus Vec(fillInVec, capacity, *status); 270 return ((BreakIterator*)bi)->getRuleStatusVec(fillInVec, capacity, *status);
273 } 271 }
274 272
275 273
276 U_CAPI const char* U_EXPORT2 274 U_CAPI const char* U_EXPORT2
277 ubrk_getLocaleByType(const UBreakIterator *bi, 275 ubrk_getLocaleByType(const UBreakIterator *bi,
278 ULocDataLocaleType type, 276 ULocDataLocaleType type,
279 UErrorCode* status) 277 UErrorCode* status)
280 { 278 {
281 if (bi == NULL) { 279 if (bi == NULL) {
282 if (U_SUCCESS(*status)) { 280 if (U_SUCCESS(*status)) {
283 *status = U_ILLEGAL_ARGUMENT_ERROR; 281 *status = U_ILLEGAL_ARGUMENT_ERROR;
284 } 282 }
285 return NULL; 283 return NULL;
286 } 284 }
287 return ((BreakIterator*)bi)->getLocaleID(type, *status); 285 return ((BreakIterator*)bi)->getLocaleID(type, *status);
288 } 286 }
289 287
290 288
291 void ubrk_refreshUText(UBreakIterator *bi, 289 void ubrk_refreshUText(UBreakIterator *bi,
292 UText *text, 290 UText *text,
293 UErrorCode *status) 291 UErrorCode *status)
294 { 292 {
295 BreakIterator *bii = reinterpret_cast<BreakIterator *>(bi); 293 BreakIterator *bii = reinterpret_cast<BreakIterator *>(bi);
296 bii->refreshInputText(text, *status); 294 bii->refreshInputText(text, *status);
297 } 295 }
298 296
299 297
300 298
301 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ 299 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */
OLDNEW
« no previous file with comments | « source/common/ubidiwrt.c ('k') | source/common/ucase_props_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698