| OLD | NEW |
| 1 /* | 1 /* |
| 2 ****************************************************************************** | 2 ****************************************************************************** |
| 3 * Copyright (C) 1997-2010, International Business Machines | 3 * Copyright (C) 1997-2010, International Business Machines |
| 4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
| 5 ****************************************************************************** | 5 ****************************************************************************** |
| 6 * file name: nfsubs.cpp | 6 * file name: nfsubs.cpp |
| 7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
| 8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
| 9 * indentation:4 | 9 * indentation:4 |
| 10 * | 10 * |
| 11 * Modification history | 11 * Modification history |
| 12 * Date Name Comments | 12 * Date Name Comments |
| 13 * 10/11/2001 Doug Ported from ICU4J | 13 * 10/11/2001 Doug Ported from ICU4J |
| 14 */ | 14 */ |
| 15 | 15 |
| 16 #include <stdio.h> | 16 #include <stdio.h> |
| 17 #include <typeinfo> // for 'typeid' to work | |
| 18 | 17 |
| 19 #include "nfsubs.h" | 18 #include "nfsubs.h" |
| 20 #include "digitlst.h" | 19 #include "digitlst.h" |
| 21 | 20 |
| 22 #if U_HAVE_RBNF | 21 #if U_HAVE_RBNF |
| 23 | 22 |
| 24 static const UChar gLessThan = 0x003c; | 23 static const UChar gLessThan = 0x003c; |
| 25 static const UChar gEquals = 0x003d; | 24 static const UChar gEquals = 0x003d; |
| 26 static const UChar gGreaterThan = 0x003e; | 25 static const UChar gGreaterThan = 0x003e; |
| 27 static const UChar gPercent = 0x0025; | 26 static const UChar gPercent = 0x0025; |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 * Compares two substitutions for equality | 518 * Compares two substitutions for equality |
| 520 * @param The substitution to compare this one to | 519 * @param The substitution to compare this one to |
| 521 * @return true if the two substitutions are functionally equivalent | 520 * @return true if the two substitutions are functionally equivalent |
| 522 */ | 521 */ |
| 523 UBool | 522 UBool |
| 524 NFSubstitution::operator==(const NFSubstitution& rhs) const | 523 NFSubstitution::operator==(const NFSubstitution& rhs) const |
| 525 { | 524 { |
| 526 // compare class and all of the fields all substitutions have | 525 // compare class and all of the fields all substitutions have |
| 527 // in common | 526 // in common |
| 528 // this should be called by subclasses before their own equality tests | 527 // this should be called by subclasses before their own equality tests |
| 529 return typeid(*this) == typeid(rhs) | 528 return CR_TYPEID(*this) == CR_TYPEID(rhs) |
| 530 && pos == rhs.pos | 529 && pos == rhs.pos |
| 531 && (ruleSet == NULL) == (rhs.ruleSet == NULL) | 530 && (ruleSet == NULL) == (rhs.ruleSet == NULL) |
| 532 // && ruleSet == rhs.ruleSet causes circularity, other checks to make instead? | 531 // && ruleSet == rhs.ruleSet causes circularity, other checks to make instead? |
| 533 && (numberFormat == NULL | 532 && (numberFormat == NULL |
| 534 ? (rhs.numberFormat == NULL) | 533 ? (rhs.numberFormat == NULL) |
| 535 : (*numberFormat == *rhs.numberFormat)); | 534 : (*numberFormat == *rhs.numberFormat)); |
| 536 } | 535 } |
| 537 | 536 |
| 538 /** | 537 /** |
| 539 * Returns a textual description of the substitution | 538 * Returns a textual description of the substitution |
| (...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1308 // NullSubstitution | 1307 // NullSubstitution |
| 1309 //=================================================================== | 1308 //=================================================================== |
| 1310 | 1309 |
| 1311 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NullSubstitution) | 1310 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(NullSubstitution) |
| 1312 | 1311 |
| 1313 U_NAMESPACE_END | 1312 U_NAMESPACE_END |
| 1314 | 1313 |
| 1315 /* U_HAVE_RBNF */ | 1314 /* U_HAVE_RBNF */ |
| 1316 #endif | 1315 #endif |
| 1317 | 1316 |
| OLD | NEW |