OLD | NEW |
1 /* | 1 /* |
2 ****************************************************************************** | 2 ****************************************************************************** |
3 * Copyright (C) 1999-2013, International Business Machines Corporation and | 3 * Copyright (C) 1999-2014, International Business Machines Corporation and |
4 * others. All Rights Reserved. | 4 * others. All Rights Reserved. |
5 ****************************************************************************** | 5 ****************************************************************************** |
6 * | 6 * |
7 * File unistr.cpp | 7 * File unistr.cpp |
8 * | 8 * |
9 * Modification History: | 9 * Modification History: |
10 * | 10 * |
11 * Date Name Description | 11 * Date Name Description |
12 * 09/25/98 stephen Creation. | 12 * 09/25/98 stephen Creation. |
13 * 04/20/99 stephen Overhauled per 4/16 code review. | 13 * 04/20/99 stephen Overhauled per 4/16 code review. |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 } | 452 } |
453 | 453 |
454 UnicodeString & | 454 UnicodeString & |
455 UnicodeString::fastCopyFrom(const UnicodeString &src) { | 455 UnicodeString::fastCopyFrom(const UnicodeString &src) { |
456 return copyFrom(src, TRUE); | 456 return copyFrom(src, TRUE); |
457 } | 457 } |
458 | 458 |
459 UnicodeString & | 459 UnicodeString & |
460 UnicodeString::copyFrom(const UnicodeString &src, UBool fastCopy) { | 460 UnicodeString::copyFrom(const UnicodeString &src, UBool fastCopy) { |
461 // if assigning to ourselves, do nothing | 461 // if assigning to ourselves, do nothing |
462 if(this == 0 || this == &src) { | 462 if(this == &src) { |
463 return *this; | 463 return *this; |
464 } | 464 } |
465 | 465 |
466 // is the right side bogus? | 466 // is the right side bogus? |
467 if(&src == 0 || src.isBogus()) { | 467 if(src.isBogus()) { |
468 setToBogus(); | 468 setToBogus(); |
469 return *this; | 469 return *this; |
470 } | 470 } |
471 | 471 |
472 // delete the current contents | 472 // delete the current contents |
473 releaseArray(); | 473 releaseArray(); |
474 | 474 |
475 if(src.isEmpty()) { | 475 if(src.isEmpty()) { |
476 // empty string - use the stack buffer | 476 // empty string - use the stack buffer |
477 setToEmpty(); | 477 setToEmpty(); |
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1816 This should never be called. It is defined here to make sure that the | 1816 This should never be called. It is defined here to make sure that the |
1817 virtual vector deleting destructor is defined within unistr.cpp. | 1817 virtual vector deleting destructor is defined within unistr.cpp. |
1818 The vector deleting destructor is already a part of UObject, | 1818 The vector deleting destructor is already a part of UObject, |
1819 but defining it here makes sure that it is included with this object file. | 1819 but defining it here makes sure that it is included with this object file. |
1820 This makes sure that static library dependencies are kept to a minimum. | 1820 This makes sure that static library dependencies are kept to a minimum. |
1821 */ | 1821 */ |
1822 static void uprv_UnicodeStringDummy(void) { | 1822 static void uprv_UnicodeStringDummy(void) { |
1823 delete [] (new UnicodeString[2]); | 1823 delete [] (new UnicodeString[2]); |
1824 } | 1824 } |
1825 #endif | 1825 #endif |
OLD | NEW |