ICU-20783 C++ covariant return types: clone(), freeze() & friends

This commit is contained in:
Markus Scherer 2019-08-21 17:13:18 -07:00
parent deec7ef683
commit f02b496494
156 changed files with 189 additions and 203 deletions

View File

@ -173,7 +173,7 @@ public:
status = U_SAFECLONE_ALLOCATED_WARNING;
return clone();
}
virtual BreakIterator* clone(void) const { return new SimpleFilteredSentenceBreakIterator(*this); }
virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); }
virtual UClassID getDynamicClassID(void) const { return NULL; }
virtual UBool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; }

View File

@ -323,8 +323,8 @@ void RuleBasedBreakIterator::init(UErrorCode &status) {
// Virtual function: does the right thing with subclasses.
//
//-----------------------------------------------------------------------------
BreakIterator*
RuleBasedBreakIterator::clone(void) const {
RuleBasedBreakIterator*
RuleBasedBreakIterator::clone() const {
return new RuleBasedBreakIterator(*this);
}
@ -1079,10 +1079,8 @@ const uint8_t *RuleBasedBreakIterator::getBinaryRules(uint32_t &length) {
}
BreakIterator * RuleBasedBreakIterator::createBufferClone(void * /*stackBuffer*/,
int32_t &bufferSize,
UErrorCode &status)
{
RuleBasedBreakIterator *RuleBasedBreakIterator::createBufferClone(
void * /*stackBuffer*/, int32_t &bufferSize, UErrorCode &status) {
if (U_FAILURE(status)){
return NULL;
}

View File

@ -101,7 +101,7 @@ StringCharacterIterator::operator==(const ForwardCharacterIterator& that) const
&& end == realThat.end;
}
CharacterIterator*
StringCharacterIterator*
StringCharacterIterator::clone() const {
return new StringCharacterIterator(*this);
}

View File

@ -89,7 +89,7 @@ UCharCharacterIterator::hashCode() const {
return ustr_hashUCharsN(text, textLength) ^ pos ^ begin ^ end;
}
CharacterIterator*
UCharCharacterIterator*
UCharCharacterIterator::clone() const {
return new UCharCharacterIterator(*this);
}

View File

@ -139,7 +139,7 @@ public:
* method which subclasses implement.
* @stable ICU 2.0
*/
virtual BreakIterator* clone(void) const = 0;
virtual BreakIterator* clone() const = 0;
/**
* Return a polymorphic class ID for this object. Different subclasses

View File

@ -380,7 +380,7 @@ public:
* @return a pointer to a new CharacterIterator
* @stable ICU 2.0
*/
virtual CharacterIterator* clone(void) const = 0;
virtual CharacterIterator* clone() const = 0;
/**
* Sets the iterator to refer to the first code unit in its

View File

@ -601,7 +601,7 @@ public:
* @return a pointer to a new Normalizer
* @deprecated ICU 56 Use Normalizer2 instead.
*/
Normalizer* clone(void) const;
Normalizer* clone() const;
/**
* Generates a hash code for this iterator.

View File

@ -274,7 +274,7 @@ public:
* @return a newly-constructed RuleBasedBreakIterator
* @stable ICU 2.0
*/
virtual BreakIterator* clone() const;
virtual RuleBasedBreakIterator* clone() const;
/**
* Compute a hash code for this BreakIterator
@ -564,9 +564,9 @@ public:
* or if the stackBuffer was too small to hold the clone.
* @deprecated ICU 52. Use clone() instead.
*/
virtual BreakIterator * createBufferClone(void *stackBuffer,
int32_t &BufferSize,
UErrorCode &status);
virtual RuleBasedBreakIterator *createBufferClone(void *stackBuffer,
int32_t &BufferSize,
UErrorCode &status);
/**

View File

@ -193,9 +193,6 @@ public:
* Clones can be used concurrently in multiple threads.
* If a subclass does not implement clone(), or if an error occurs,
* then NULL is returned.
* The clone functions in all subclasses return a pointer to a Replaceable
* because some compilers do not support covariant (same-as-this)
* return types; cast to the appropriate subclass if necessary.
* The caller must delete the clone.
*
* @return a clone of this object

View File

@ -133,7 +133,7 @@ public:
* @return the newly cloned object.
* @stable ICU 2.0
*/
virtual CharacterIterator* clone(void) const;
virtual StringCharacterIterator* clone() const;
/**
* Sets the iterator to iterate over the provided string.

View File

@ -71,9 +71,6 @@ public:
* Clones can be used concurrently in multiple threads.
* If a subclass does not implement clone(), or if an error occurs,
* then NULL is returned.
* The clone functions in all subclasses return a base class pointer
* because some compilers do not support covariant (same-as-this)
* return types; cast to the appropriate subclass if necessary.
* The caller must delete the clone.
*
* @return a clone of this object

View File

@ -135,7 +135,7 @@ public:
* @return the CharacterIterator newly created
* @stable ICU 2.0
*/
virtual CharacterIterator* clone(void) const;
virtual UCharCharacterIterator* clone() const;
/**
* Sets the iterator to refer to the first code unit in its

View File

@ -505,7 +505,7 @@ public:
* @see cloneAsThawed
* @stable ICU 2.0
*/
virtual UnicodeFunctor* clone() const;
virtual UnicodeSet* clone() const;
/**
* Returns the hash code value for this set.
@ -583,7 +583,7 @@ public:
* @see cloneAsThawed
* @stable ICU 3.8
*/
UnicodeFunctor *freeze();
UnicodeSet *freeze();
/**
* Clone the set and make the clone mutable.
@ -593,7 +593,7 @@ public:
* @see isFrozen
* @stable ICU 3.8
*/
UnicodeFunctor *cloneAsThawed() const;
UnicodeSet *cloneAsThawed() const;
//----------------------------------------------------------------
// Public API

View File

@ -3326,9 +3326,6 @@ public:
* Clones can be used concurrently in multiple threads.
* If a subclass does not implement clone(), or if an error occurs,
* then NULL is returned.
* The clone functions in all subclasses return a pointer to a Replaceable
* because some compilers do not support covariant (same-as-this)
* return types; cast to the appropriate subclass if necessary.
* The caller must delete the clone.
*
* @return a clone of this object
@ -3337,7 +3334,7 @@ public:
* @see getDynamicClassID
* @stable ICU 2.6
*/
virtual Replaceable *clone() const;
virtual UnicodeString *clone() const;
/** Destructor.
* @stable ICU 2.0

View File

@ -215,11 +215,8 @@ public:
* The clone() function is not available in UObject because it is not
* implemented by all ICU classes.
* Many ICU services provide a clone() function for their class trees,
* defined on the service's C++ base class, and all subclasses within that
* service class tree return a pointer to the service base class
* defined on the service's C++ base class
* (which itself is a subclass of UObject).
* This is because some compilers do not support covariant (same-as-this)
* return types; cast to the appropriate subclass if necessary.
*
* @stable ICU 2.2
*/

View File

@ -278,11 +278,11 @@ UnicodeSet& UnicodeSet::copyFrom(const UnicodeSet& o, UBool asThawed) {
* to support cloning in order to allow classes using
* UnicodeMatchers, such as Transliterator, to implement cloning.
*/
UnicodeFunctor* UnicodeSet::clone() const {
UnicodeSet* UnicodeSet::clone() const {
return new UnicodeSet(*this);
}
UnicodeFunctor *UnicodeSet::cloneAsThawed() const {
UnicodeSet *UnicodeSet::cloneAsThawed() const {
return new UnicodeSet(*this, TRUE);
}
@ -2172,7 +2172,7 @@ void UnicodeSet::setPattern(const char16_t *newPat, int32_t newPatLen) {
// We can regenerate an equivalent pattern later when requested.
}
UnicodeFunctor *UnicodeSet::freeze() {
UnicodeSet *UnicodeSet::freeze() {
if(!isFrozen() && !isBogus()) {
compact();

View File

@ -332,7 +332,7 @@ Replaceable::clone() const {
}
// UnicodeString overrides clone() with a real implementation
Replaceable *
UnicodeString *
UnicodeString::clone() const {
return new UnicodeString(*this);
}

View File

@ -45,7 +45,7 @@ public:
WholeStringBreakIterator() : BreakIterator(), length(0) {}
~WholeStringBreakIterator() U_OVERRIDE;
UBool operator==(const BreakIterator&) const U_OVERRIDE;
BreakIterator *clone() const U_OVERRIDE;
WholeStringBreakIterator *clone() const U_OVERRIDE;
static UClassID U_EXPORT2 getStaticClassID();
UClassID getDynamicClassID() const U_OVERRIDE;
CharacterIterator &getText() const U_OVERRIDE;
@ -62,9 +62,9 @@ public:
int32_t preceding(int32_t offset) U_OVERRIDE;
UBool isBoundary(int32_t offset) U_OVERRIDE;
int32_t next(int32_t n) U_OVERRIDE;
BreakIterator *createBufferClone(void *stackBuffer, int32_t &BufferSize,
UErrorCode &errorCode) U_OVERRIDE;
BreakIterator &refreshInputText(UText *input, UErrorCode &errorCode) U_OVERRIDE;
WholeStringBreakIterator *createBufferClone(void *stackBuffer, int32_t &BufferSize,
UErrorCode &errorCode) U_OVERRIDE;
WholeStringBreakIterator &refreshInputText(UText *input, UErrorCode &errorCode) U_OVERRIDE;
private:
int32_t length;
@ -74,7 +74,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(WholeStringBreakIterator)
WholeStringBreakIterator::~WholeStringBreakIterator() {}
UBool WholeStringBreakIterator::operator==(const BreakIterator&) const { return FALSE; }
BreakIterator *WholeStringBreakIterator::clone() const { return nullptr; }
WholeStringBreakIterator *WholeStringBreakIterator::clone() const { return nullptr; }
CharacterIterator &WholeStringBreakIterator::getText() const {
UPRV_UNREACHABLE; // really should not be called
@ -113,14 +113,14 @@ int32_t WholeStringBreakIterator::preceding(int32_t /*offset*/) { return 0; }
UBool WholeStringBreakIterator::isBoundary(int32_t /*offset*/) { return FALSE; }
int32_t WholeStringBreakIterator::next(int32_t /*n*/) { return length; }
BreakIterator *WholeStringBreakIterator::createBufferClone(
WholeStringBreakIterator *WholeStringBreakIterator::createBufferClone(
void * /*stackBuffer*/, int32_t & /*BufferSize*/, UErrorCode &errorCode) {
if (U_SUCCESS(errorCode)) {
errorCode = U_UNSUPPORTED_ERROR;
}
return nullptr;
}
BreakIterator &WholeStringBreakIterator::refreshInputText(
WholeStringBreakIterator &WholeStringBreakIterator::refreshInputText(
UText * /*input*/, UErrorCode &errorCode) {
if (U_SUCCESS(errorCode)) {
errorCode = U_UNSUPPORTED_ERROR;

View File

@ -226,7 +226,7 @@ AnyTransliterator::AnyTransliterator(const AnyTransliterator& o) :
/**
* Transliterator API.
*/
Transliterator* AnyTransliterator::clone() const {
AnyTransliterator* AnyTransliterator::clone() const {
return new AnyTransliterator(*this);
}

View File

@ -66,7 +66,7 @@ public:
/**
* Transliterator API.
*/
virtual Transliterator* clone() const;
virtual AnyTransliterator* clone() const;
/**
* Implements {@link Transliterator#handleTransliterate}.

View File

@ -64,7 +64,7 @@ BreakTransliterator::BreakTransliterator(const BreakTransliterator& o) :
/**
* Transliterator API.
*/
Transliterator* BreakTransliterator::clone(void) const {
BreakTransliterator* BreakTransliterator::clone() const {
return new BreakTransliterator(*this);
}

View File

@ -54,7 +54,7 @@ public:
* Transliterator API.
* @return A copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual BreakTransliterator* clone() const;
virtual const UnicodeString &getInsertion() const;

View File

@ -53,7 +53,7 @@ BuddhistCalendar& BuddhistCalendar::operator= ( const BuddhistCalendar& right)
return *this;
}
Calendar* BuddhistCalendar::clone(void) const
BuddhistCalendar* BuddhistCalendar::clone() const
{
return new BuddhistCalendar(*this);
}

View File

@ -94,7 +94,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone(void) const;
virtual BuddhistCalendar* clone() const;
public:
/**

View File

@ -125,7 +125,7 @@ CaseMapTransliterator::CaseMapTransliterator(const CaseMapTransliterator& o) :
/**
* Transliterator API.
*/
/*Transliterator* CaseMapTransliterator::clone(void) const {
/*CaseMapTransliterator* CaseMapTransliterator::clone() const {
return new CaseMapTransliterator(*this);
}*/

View File

@ -58,7 +58,7 @@ public:
* Transliterator API.
* @return a copy of the object.
*/
virtual Transliterator* clone(void) const = 0;
virtual CaseMapTransliterator* clone() const = 0;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -118,7 +118,7 @@ U_NAMESPACE_BEGIN
//-------------------------------------------------------------------------
Calendar* ChineseCalendar::clone() const {
ChineseCalendar* ChineseCalendar::clone() const {
return new ChineseCalendar(*this);
}

View File

@ -144,7 +144,7 @@ class U_I18N_API ChineseCalendar : public Calendar {
virtual ~ChineseCalendar();
// clone
virtual Calendar* clone() const;
virtual ChineseCalendar* clone() const;
private:

View File

@ -563,7 +563,7 @@ ChoiceFormat::matchStringUntilLimitPart(
// -------------------------------------
Format*
ChoiceFormat*
ChoiceFormat::clone() const
{
ChoiceFormat *aCopy = new ChoiceFormat(*this);

View File

@ -45,7 +45,7 @@ CompactDecimalFormat& CompactDecimalFormat::operator=(const CompactDecimalFormat
return *this;
}
Format* CompactDecimalFormat::clone() const {
CompactDecimalFormat* CompactDecimalFormat::clone() const {
return new CompactDecimalFormat(*this);
}

View File

@ -40,7 +40,7 @@ CopticCalendar::~CopticCalendar()
{
}
Calendar*
CopticCalendar*
CopticCalendar::clone() const
{
return new CopticCalendar(*this);

View File

@ -145,7 +145,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone(void) const;
virtual CopticCalendar* clone() const;
/**
* return the calendar type, "coptic"

View File

@ -323,7 +323,7 @@ CompoundTransliterator& CompoundTransliterator::operator=(
/**
* Transliterator API.
*/
Transliterator* CompoundTransliterator::clone(void) const {
CompoundTransliterator* CompoundTransliterator::clone() const {
return new CompoundTransliterator(*this);
}

View File

@ -98,7 +98,7 @@ public:
/**
* Transliterator API.
*/
virtual Transliterator* clone(void) const;
virtual CompoundTransliterator* clone() const;
/**
* Returns the number of transliterators in this chain.

View File

@ -38,7 +38,7 @@ CurrencyAmount& CurrencyAmount::operator=(const CurrencyAmount& other) {
return *this;
}
UObject* CurrencyAmount::clone() const {
CurrencyAmount* CurrencyAmount::clone() const {
return new CurrencyAmount(*this);
}

View File

@ -33,7 +33,7 @@ CurrencyFormat::CurrencyFormat(const CurrencyFormat& other) :
CurrencyFormat::~CurrencyFormat() {
}
Format* CurrencyFormat::clone() const {
CurrencyFormat* CurrencyFormat::clone() const {
return new CurrencyFormat(*this);
}

View File

@ -57,7 +57,7 @@ class CurrencyFormat : public MeasureFormat {
/**
* Override Format API.
*/
virtual Format* clone() const;
virtual CurrencyFormat* clone() const;
using MeasureFormat::format;

View File

@ -109,7 +109,7 @@ CurrencyUnit& CurrencyUnit::operator=(const CurrencyUnit& other) {
return *this;
}
UObject* CurrencyUnit::clone() const {
CurrencyUnit* CurrencyUnit::clone() const {
return new CurrencyUnit(*this);
}

View File

@ -65,7 +65,7 @@ DangiCalendar::~DangiCalendar()
{
}
Calendar*
DangiCalendar*
DangiCalendar::clone() const
{
return new DangiCalendar(*this);

View File

@ -66,7 +66,7 @@ class DangiCalendar : public ChineseCalendar {
* Clone.
* @internal
*/
virtual Calendar* clone() const;
virtual DangiCalendar* clone() const;
//----------------------------------------------------------------------
// Internal methods & astronomical calculations

View File

@ -485,7 +485,7 @@ DecimalFormat::~DecimalFormat() {
delete fields;
}
Format* DecimalFormat::clone() const {
DecimalFormat* DecimalFormat::clone() const {
// can only clone valid objects.
if (fields == nullptr) {
return nullptr;

View File

@ -215,8 +215,8 @@ DateIntervalFormat::~DateIntervalFormat() {
}
Format*
DateIntervalFormat::clone(void) const {
DateIntervalFormat*
DateIntervalFormat::clone() const {
return new DateIntervalFormat(*this);
}

View File

@ -122,7 +122,7 @@ EscapeTransliterator::~EscapeTransliterator() {
/**
* Transliterator API.
*/
Transliterator* EscapeTransliterator::clone() const {
EscapeTransliterator* EscapeTransliterator::clone() const {
return new EscapeTransliterator(*this);
}

View File

@ -115,7 +115,7 @@ class EscapeTransliterator : public Transliterator {
/**
* Transliterator API.
*/
virtual Transliterator* clone() const;
virtual EscapeTransliterator* clone() const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -46,7 +46,7 @@ EthiopicCalendar::~EthiopicCalendar()
{
}
Calendar*
EthiopicCalendar*
EthiopicCalendar::clone() const
{
return new EthiopicCalendar(*this);

View File

@ -141,7 +141,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone() const;
virtual EthiopicCalendar* clone() const;
/**
* return the calendar type, "ethiopic"

View File

@ -59,7 +59,7 @@ FunctionReplacer::~FunctionReplacer() {
/**
* Implement UnicodeFunctor
*/
UnicodeFunctor* FunctionReplacer::clone() const {
FunctionReplacer* FunctionReplacer::clone() const {
return new FunctionReplacer(*this);
}

View File

@ -70,7 +70,7 @@ class FunctionReplacer : public UnicodeFunctor, public UnicodeReplacer {
/**
* Implement UnicodeFunctor
*/
virtual UnicodeFunctor* clone() const;
virtual FunctionReplacer* clone() const;
/**
* UnicodeFunctor API. Cast 'this' to a UnicodeReplacer* pointer

View File

@ -286,7 +286,7 @@ fIsGregorian(source.fIsGregorian), fInvertGregorian(source.fInvertGregorian)
// -------------------------------------
Calendar* GregorianCalendar::clone() const
GregorianCalendar* GregorianCalendar::clone() const
{
return new GregorianCalendar(*this);
}

View File

@ -169,7 +169,7 @@ const char *HebrewCalendar::getType() const {
return "hebrew";
}
Calendar* HebrewCalendar::clone() const {
HebrewCalendar* HebrewCalendar::clone() const {
return new HebrewCalendar(*this);
}

View File

@ -192,7 +192,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone(void) const;
virtual HebrewCalendar* clone() const;
public:
/**

View File

@ -35,7 +35,7 @@ U_NAMESPACE_BEGIN
//-------------------------------------------------------------------------
Calendar* IndianCalendar::clone() const {
IndianCalendar* IndianCalendar::clone() const {
return new IndianCalendar(*this);
}

View File

@ -186,7 +186,7 @@ public:
// TODO: copy c'tor, etc
// clone
virtual Calendar* clone() const;
virtual IndianCalendar* clone() const;
private:
/**

View File

@ -227,7 +227,7 @@ const char *IslamicCalendar::getType() const {
return sType;
}
Calendar* IslamicCalendar::clone() const {
IslamicCalendar* IslamicCalendar::clone() const {
return new IslamicCalendar(*this);
}

View File

@ -230,7 +230,7 @@ class U_I18N_API IslamicCalendar : public Calendar {
// TODO: copy c'tor, etc
// clone
virtual Calendar* clone() const;
virtual IslamicCalendar* clone() const;
private:
/**

View File

@ -136,7 +136,7 @@ JapaneseCalendar& JapaneseCalendar::operator= ( const JapaneseCalendar& right)
return *this;
}
Calendar* JapaneseCalendar::clone(void) const
JapaneseCalendar* JapaneseCalendar::clone() const
{
return new JapaneseCalendar(*this);
}

View File

@ -116,7 +116,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone(void) const;
virtual JapaneseCalendar* clone() const;
/**
* Return the extended year defined by the current fields. In the

View File

@ -460,7 +460,7 @@ UBool MeasureFormat::operator==(const Format &other) const {
**numberFormat == **rhs.numberFormat);
}
Format *MeasureFormat::clone() const {
MeasureFormat *MeasureFormat::clone() const {
return new MeasureFormat(*this);
}

View File

@ -1923,7 +1923,7 @@ MeasureUnit &MeasureUnit::operator=(const MeasureUnit &other) {
return *this;
}
UObject *MeasureUnit::clone() const {
MeasureUnit *MeasureUnit::clone() const {
return new MeasureUnit(*this);
}

View File

@ -48,7 +48,7 @@ Measure& Measure::operator=(const Measure& other) {
return *this;
}
UObject *Measure::clone() const {
Measure *Measure::clone() const {
return new Measure(*this);
}

View File

@ -436,7 +436,7 @@ MessageFormat::operator==(const Format& rhs) const
// -------------------------------------
// Creates a copy of this MessageFormat, the caller owns the copy.
Format*
MessageFormat*
MessageFormat::clone() const
{
return new MessageFormat(*this);
@ -1873,7 +1873,7 @@ UBool MessageFormat::DummyFormat::operator==(const Format&) const {
return TRUE;
}
Format* MessageFormat::DummyFormat::clone() const {
MessageFormat::DummyFormat* MessageFormat::DummyFormat::clone() const {
return new DummyFormat();
}

View File

@ -100,7 +100,7 @@ NameUnicodeTransliterator::NameUnicodeTransliterator(const NameUnicodeTransliter
/**
* Transliterator API.
*/
Transliterator* NameUnicodeTransliterator::clone(void) const {
NameUnicodeTransliterator* NameUnicodeTransliterator::clone() const {
return new NameUnicodeTransliterator(*this);
}

View File

@ -49,7 +49,7 @@ public:
* Transliterator API.
* @return A copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual NameUnicodeTransliterator* clone() const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -92,7 +92,7 @@ NormalizationTransliterator::NormalizationTransliterator(const NormalizationTran
/**
* Transliterator API.
*/
Transliterator* NormalizationTransliterator::clone(void) const {
NormalizationTransliterator* NormalizationTransliterator::clone() const {
return new NormalizationTransliterator(*this);
}

View File

@ -44,7 +44,7 @@ class NormalizationTransliterator : public Transliterator {
* Transliterator API.
* @return A copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual NormalizationTransliterator* clone() const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -29,7 +29,7 @@ NoUnit::NoUnit(const char* subtype) {
NoUnit::NoUnit(const NoUnit& other) : MeasureUnit(other) {
}
UObject* NoUnit::clone() const {
NoUnit* NoUnit::clone() const {
return new NoUnit(*this);
}

View File

@ -24,7 +24,7 @@ NullTransliterator::NullTransliterator() : Transliterator(UNICODE_STRING_SIMPLE(
NullTransliterator::~NullTransliterator() {}
Transliterator* NullTransliterator::clone(void) const {
NullTransliterator* NullTransliterator::clone() const {
return new NullTransliterator();
}

View File

@ -45,7 +45,7 @@ public:
* Transliterator API.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual Transliterator* clone(void) const;
virtual NullTransliterator* clone() const;
/**
* Implements {@link Transliterator#handleTransliterate}.

View File

@ -43,7 +43,7 @@ UBool LocalizedNumberFormatterAsFormat::operator==(const Format& other) const {
return fFormatter.toSkeleton(localStatus) == _other->fFormatter.toSkeleton(localStatus);
}
Format* LocalizedNumberFormatterAsFormat::clone() const {
LocalizedNumberFormatterAsFormat* LocalizedNumberFormatterAsFormat::clone() const {
return new LocalizedNumberFormatterAsFormat(*this);
}

View File

@ -45,7 +45,7 @@ class U_I18N_API LocalizedNumberFormatterAsFormat : public Format {
/**
* Creates a copy of this object.
*/
Format* clone() const U_OVERRIDE;
LocalizedNumberFormatterAsFormat* clone() const U_OVERRIDE;
/**
* Formats a Number using the wrapped LocalizedNumberFormatter. The provided formattable must be a

View File

@ -319,7 +319,7 @@ UBool OlsonTimeZone::operator==(const TimeZone& other) const {
/**
* TimeZone API.
*/
TimeZone* OlsonTimeZone::clone() const {
OlsonTimeZone* OlsonTimeZone::clone() const {
return new OlsonTimeZone(*this);
}

View File

@ -151,7 +151,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone {
/**
* TimeZone API.
*/
virtual TimeZone* clone() const;
virtual OlsonTimeZone* clone() const;
/**
* TimeZone API.

View File

@ -74,7 +74,7 @@ const char *PersianCalendar::getType() const {
return "persian";
}
Calendar* PersianCalendar::clone() const {
PersianCalendar* PersianCalendar::clone() const {
return new PersianCalendar(*this);
}

View File

@ -164,7 +164,7 @@ class PersianCalendar : public Calendar {
// TODO: copy c'tor, etc
// clone
virtual Calendar* clone() const;
virtual PersianCalendar* clone() const;
private:
/**

View File

@ -362,7 +362,7 @@ PluralFormat::setNumberFormat(const NumberFormat* format, UErrorCode& status) {
}
}
Format*
PluralFormat*
PluralFormat::clone() const
{
return new PluralFormat(*this);

View File

@ -47,7 +47,7 @@ Quantifier::~Quantifier() {
/**
* Implement UnicodeFunctor
*/
UnicodeFunctor* Quantifier::clone() const {
Quantifier* Quantifier::clone() const {
return new Quantifier(*this);
}

View File

@ -45,7 +45,7 @@ class Quantifier : public UnicodeFunctor, public UnicodeMatcher {
* Implement UnicodeFunctor
* @return a copy of the object.
*/
virtual UnicodeFunctor* clone() const;
virtual Quantifier* clone() const;
/**
* Implement UnicodeMatcher

View File

@ -930,8 +930,8 @@ RuleBasedNumberFormat::~RuleBasedNumberFormat()
dispose();
}
Format*
RuleBasedNumberFormat::clone(void) const
RuleBasedNumberFormat*
RuleBasedNumberFormat::clone() const
{
return new RuleBasedNumberFormat(*this);
}

View File

@ -191,8 +191,8 @@ RuleBasedTransliterator::~RuleBasedTransliterator() {
}
}
Transliterator* // Covariant return NOT ALLOWED (for portability)
RuleBasedTransliterator::clone(void) const {
RuleBasedTransliterator*
RuleBasedTransliterator::clone() const {
return new RuleBasedTransliterator(*this);
}

View File

@ -144,7 +144,7 @@ public:
* Implement Transliterator API.
* @internal Use transliterator factory methods instead since this class will be removed in that release.
*/
virtual Transliterator* clone(void) const;
virtual RuleBasedTransliterator* clone() const;
protected:
/**

View File

@ -356,8 +356,8 @@ cleanup:
fUpToDate = FALSE;
}
TimeZone*
RuleBasedTimeZone::clone(void) const {
RuleBasedTimeZone*
RuleBasedTimeZone::clone() const {
return new RuleBasedTimeZone(*this);
}

View File

@ -131,7 +131,7 @@ RelativeDateFormat::~RelativeDateFormat() {
}
Format* RelativeDateFormat::clone(void) const {
RelativeDateFormat* RelativeDateFormat::clone() const {
return new RelativeDateFormat(*this);
}

View File

@ -71,7 +71,7 @@ public:
* @return A copy of the object.
* @internal ICU 3.8
*/
virtual Format* clone(void) const;
virtual RelativeDateFormat* clone() const;
/**
* Return true if the given Format objects are semantically equal. Objects

View File

@ -48,8 +48,8 @@ RemoveTransliterator::RemoveTransliterator() : Transliterator(UnicodeString(TRUE
RemoveTransliterator::~RemoveTransliterator() {}
Transliterator* RemoveTransliterator::clone(void) const {
Transliterator* result = new RemoveTransliterator();
RemoveTransliterator* RemoveTransliterator::clone() const {
RemoveTransliterator* result = new RemoveTransliterator();
if (result != NULL && getFilter() != 0) {
result->adoptFilter((UnicodeFilter*)(getFilter()->clone()));
}

View File

@ -47,7 +47,7 @@ public:
* Transliterator API.
* @return A copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual RemoveTransliterator* clone() const;
/**
* Implements {@link Transliterator#handleTransliterate}.

View File

@ -220,7 +220,7 @@ RuleBasedCollator::adoptTailoring(CollationTailoring *t, UErrorCode &errorCode)
actualLocaleIsSameAsValid = FALSE;
}
Collator *
RuleBasedCollator *
RuleBasedCollator::clone() const {
return new RuleBasedCollator(*this);
}

View File

@ -121,7 +121,7 @@ ScientificNumberFormatter *ScientificNumberFormatter::createInstance(
return result;
}
ScientificNumberFormatter::Style *ScientificNumberFormatter::SuperscriptStyle::clone() const {
ScientificNumberFormatter::SuperscriptStyle *ScientificNumberFormatter::SuperscriptStyle::clone() const {
return new ScientificNumberFormatter::SuperscriptStyle(*this);
}
@ -195,7 +195,7 @@ UnicodeString &ScientificNumberFormatter::SuperscriptStyle::format(
return appendTo;
}
ScientificNumberFormatter::Style *ScientificNumberFormatter::MarkupStyle::clone() const {
ScientificNumberFormatter::MarkupStyle *ScientificNumberFormatter::MarkupStyle::clone() const {
return new ScientificNumberFormatter::MarkupStyle(*this);
}

View File

@ -151,7 +151,7 @@ int32_t SelectFormat::findSubMessage(const MessagePattern& pattern, int32_t part
return msgStart;
}
Format* SelectFormat::clone() const
SelectFormat* SelectFormat::clone() const
{
return new SelectFormat(*this);
}

View File

@ -243,7 +243,7 @@ SimpleTimeZone::operator==(const TimeZone& that) const
// -------------------------------------
// Called by TimeZone::createDefault() inside a Mutex - be careful.
TimeZone*
SimpleTimeZone*
SimpleTimeZone::clone() const
{
return new SimpleTimeZone(*this);

View File

@ -620,7 +620,7 @@ SimpleDateFormat& SimpleDateFormat::operator=(const SimpleDateFormat& other)
//----------------------------------------------------------------------
Format*
SimpleDateFormat*
SimpleDateFormat::clone() const
{
return new SimpleDateFormat(*this);

View File

@ -58,7 +58,7 @@ StringMatcher::~StringMatcher() {
/**
* Implement UnicodeFunctor
*/
UnicodeFunctor* StringMatcher::clone() const {
StringMatcher* StringMatcher::clone() const {
return new StringMatcher(*this);
}

View File

@ -78,7 +78,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico
* Implement UnicodeFunctor
* @return a copy of the object.
*/
virtual UnicodeFunctor* clone() const;
virtual StringMatcher* clone() const;
/**
* UnicodeFunctor API. Cast 'this' to a UnicodeMatcher* pointer

View File

@ -87,7 +87,7 @@ StringReplacer::~StringReplacer() {
/**
* Implement UnicodeFunctor
*/
UnicodeFunctor* StringReplacer::clone() const {
StringReplacer* StringReplacer::clone() const {
return new StringReplacer(*this);
}

View File

@ -111,7 +111,7 @@ class StringReplacer : public UnicodeFunctor, public UnicodeReplacer {
/**
* Implement UnicodeFunctor
*/
virtual UnicodeFunctor* clone() const;
virtual StringReplacer* clone() const;
/**
* UnicodeFunctor API. Cast 'this' to a UnicodeReplacer* pointer

View File

@ -282,7 +282,7 @@ void StringSearch::reset()
usearch_reset(m_strsrch_);
}
SearchIterator * StringSearch::safeClone(void) const
StringSearch * StringSearch::safeClone() const
{
UErrorCode status = U_ZERO_ERROR;
StringSearch *result = new StringSearch(m_pattern_, m_text_,

View File

@ -53,7 +53,7 @@ TaiwanCalendar& TaiwanCalendar::operator= ( const TaiwanCalendar& right)
return *this;
}
Calendar* TaiwanCalendar::clone(void) const
TaiwanCalendar* TaiwanCalendar::clone() const
{
return new TaiwanCalendar(*this);
}

View File

@ -91,7 +91,7 @@ public:
* @return return a polymorphic copy of this calendar.
* @internal
*/
virtual Calendar* clone(void) const;
virtual TaiwanCalendar* clone() const;
public:
/**

View File

@ -60,7 +60,7 @@ TitlecaseTransliterator::TitlecaseTransliterator(const TitlecaseTransliterator&
/**
* Transliterator API.
*/
Transliterator* TitlecaseTransliterator::clone(void) const {
TitlecaseTransliterator* TitlecaseTransliterator::clone() const {
return new TitlecaseTransliterator(*this);
}

View File

@ -52,7 +52,7 @@ class TitlecaseTransliterator : public CaseMapTransliterator {
* Transliterator API.
* @return a copy of the object.
*/
virtual Transliterator* clone(void) const;
virtual TitlecaseTransliterator* clone() const;
/**
* ICU "poor man's RTTI", returns a UClassID for the actual class.

View File

@ -102,7 +102,7 @@ TimeUnit::TimeUnit(const TimeUnit& other)
: MeasureUnit(other), fTimeUnitField(other.fTimeUnitField) {
}
UObject*
TimeUnit*
TimeUnit::clone() const {
return new TimeUnit(*this);
}

Some files were not shown because too many files have changed in this diff Show More