OLD | NEW |
1 /* | 1 /* |
2 *************************************************************************** | 2 *************************************************************************** |
3 * Copyright (C) 1999-2010 International Business Machines Corporation | 3 * Copyright (C) 1999-2010 International Business Machines Corporation |
4 * and others. All rights reserved. | 4 * and others. All rights reserved. |
5 *************************************************************************** | 5 *************************************************************************** |
6 */ | 6 */ |
7 // | 7 // |
8 // file: rbbi.c Contains the implementation of the rule based break iterato
r | 8 // file: rbbi.c Contains the implementation of the rule based break iterato
r |
9 // runtime engine and the API implementation for | 9 // runtime engine and the API implementation for |
10 // class RuleBasedBreakIterator | 10 // class RuleBasedBreakIterator |
11 // | 11 // |
12 | 12 |
13 #include <typeinfo> // for 'typeid' to work | |
14 | 13 |
15 #include "unicode/utypes.h" | 14 #include "unicode/utypes.h" |
16 | 15 |
17 #if !UCONFIG_NO_BREAK_ITERATION | 16 #if !UCONFIG_NO_BREAK_ITERATION |
18 | 17 |
19 #include "unicode/rbbi.h" | 18 #include "unicode/rbbi.h" |
20 #include "unicode/schriter.h" | 19 #include "unicode/schriter.h" |
21 #include "unicode/uchriter.h" | 20 #include "unicode/uchriter.h" |
22 #include "unicode/udata.h" | 21 #include "unicode/udata.h" |
23 #include "unicode/uclean.h" | 22 #include "unicode/uclean.h" |
(...skipping 261 matching lines...) Loading... |
285 RuleBasedBreakIterator::clone(void) const { | 284 RuleBasedBreakIterator::clone(void) const { |
286 return new RuleBasedBreakIterator(*this); | 285 return new RuleBasedBreakIterator(*this); |
287 } | 286 } |
288 | 287 |
289 /** | 288 /** |
290 * Equality operator. Returns TRUE if both BreakIterators are of the | 289 * Equality operator. Returns TRUE if both BreakIterators are of the |
291 * same class, have the same behavior, and iterate over the same text. | 290 * same class, have the same behavior, and iterate over the same text. |
292 */ | 291 */ |
293 UBool | 292 UBool |
294 RuleBasedBreakIterator::operator==(const BreakIterator& that) const { | 293 RuleBasedBreakIterator::operator==(const BreakIterator& that) const { |
295 if (typeid(*this) != typeid(that)) { | 294 if (CR_TYPEID(*this) != CR_TYPEID(that)) { |
296 return FALSE; | 295 return FALSE; |
297 } | 296 } |
298 | 297 |
299 const RuleBasedBreakIterator& that2 = (const RuleBasedBreakIterator&) that; | 298 const RuleBasedBreakIterator& that2 = (const RuleBasedBreakIterator&) that; |
300 | 299 |
301 if (!utext_equals(fText, that2.fText)) { | 300 if (!utext_equals(fText, that2.fText)) { |
302 // The two break iterators are operating on different text, | 301 // The two break iterators are operating on different text, |
303 // or have a different interation position. | 302 // or have a different interation position. |
304 return FALSE; | 303 return FALSE; |
305 }; | 304 }; |
(...skipping 1566 matching lines...) Loading... |
1872 }*/ | 1871 }*/ |
1873 | 1872 |
1874 void RuleBasedBreakIterator::setBreakType(int32_t type) { | 1873 void RuleBasedBreakIterator::setBreakType(int32_t type) { |
1875 fBreakType = type; | 1874 fBreakType = type; |
1876 reset(); | 1875 reset(); |
1877 } | 1876 } |
1878 | 1877 |
1879 U_NAMESPACE_END | 1878 U_NAMESPACE_END |
1880 | 1879 |
1881 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ | 1880 #endif /* #if !UCONFIG_NO_BREAK_ITERATION */ |
OLD | NEW |