diff --git a/icu4c/source/common/brkeng.h b/icu4c/source/common/brkeng.h index f6b64c83e25..6843f1cc953 100644 --- a/icu4c/source/common/brkeng.h +++ b/icu4c/source/common/brkeng.h @@ -176,7 +176,7 @@ class UnhandledEngine : public LanguageBreakEngine { * @return true if this engine handles the particular character and break * type. */ - virtual UBool handles(UChar32 c) const; + virtual UBool handles(UChar32 c) const override; /** *

Find any breaks within a run in the supplied text.

@@ -194,7 +194,7 @@ class UnhandledEngine : public LanguageBreakEngine { int32_t startPos, int32_t endPos, UVector32 &foundBreaks, - UErrorCode &status) const; + UErrorCode &status) const override; /** *

Tell the engine to handle a particular character and break type.

@@ -247,7 +247,7 @@ class ICULanguageBreakFactory : public LanguageBreakFactory { * sought. * @return A LanguageBreakEngine with the desired characteristics, or 0. */ - virtual const LanguageBreakEngine *getEngineFor(UChar32 c); + virtual const LanguageBreakEngine *getEngineFor(UChar32 c) override; protected: /** diff --git a/icu4c/source/common/brkiter.cpp b/icu4c/source/common/brkiter.cpp index b9b6ca65cd4..8b228acf2c3 100644 --- a/icu4c/source/common/brkiter.cpp +++ b/icu4c/source/common/brkiter.cpp @@ -234,7 +234,7 @@ class ICUBreakIteratorFactory : public ICUResourceBundleFactory { public: virtual ~ICUBreakIteratorFactory(); protected: - virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /*service*/, UErrorCode& status) const { + virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /*service*/, UErrorCode& status) const override { return BreakIterator::makeInstance(loc, kind, status); } }; @@ -254,11 +254,11 @@ public: virtual ~ICUBreakIteratorService(); - virtual UObject* cloneInstance(UObject* instance) const { + virtual UObject* cloneInstance(UObject* instance) const override { return ((BreakIterator*)instance)->clone(); } - virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const { + virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const override { LocaleKey& lkey = (LocaleKey&)key; int32_t kind = lkey.kind(); Locale loc; @@ -266,7 +266,7 @@ public: return BreakIterator::makeInstance(loc, kind, status); } - virtual UBool isDefault() const { + virtual UBool isDefault() const override { return countFactories() == 1; } }; diff --git a/icu4c/source/common/dictbe.h b/icu4c/source/common/dictbe.h index 4adaaa4f09d..4e70ed38171 100644 --- a/icu4c/source/common/dictbe.h +++ b/icu4c/source/common/dictbe.h @@ -62,7 +62,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine { * @return true if this engine handles the particular character and break * type. */ - virtual UBool handles(UChar32 c) const; + virtual UBool handles(UChar32 c) const override; /** *

Find any breaks within a run in the supplied text.

@@ -80,7 +80,7 @@ class DictionaryBreakEngine : public LanguageBreakEngine { int32_t startPos, int32_t endPos, UVector32 &foundBreaks, - UErrorCode& status ) const; + UErrorCode& status ) const override; protected: @@ -164,7 +164,7 @@ class ThaiBreakEngine : public DictionaryBreakEngine { int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; }; @@ -222,7 +222,7 @@ class LaoBreakEngine : public DictionaryBreakEngine { int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; }; @@ -280,7 +280,7 @@ class BurmeseBreakEngine : public DictionaryBreakEngine { int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; }; @@ -338,7 +338,7 @@ class KhmerBreakEngine : public DictionaryBreakEngine { int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; }; @@ -404,7 +404,7 @@ class CjkBreakEngine : public DictionaryBreakEngine { int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; }; diff --git a/icu4c/source/common/dictionarydata.h b/icu4c/source/common/dictionarydata.h index 0d303d9a8dc..33e4fdc1065 100644 --- a/icu4c/source/common/dictionarydata.h +++ b/icu4c/source/common/dictionarydata.h @@ -107,8 +107,8 @@ public: virtual ~UCharsDictionaryMatcher(); virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit, int32_t *lengths, int32_t *cpLengths, int32_t *values, - int32_t *prefix) const; - virtual int32_t getType() const; + int32_t *prefix) const override; + virtual int32_t getType() const override; private: const UChar *characters; UDataMemory *file; @@ -125,8 +125,8 @@ public: virtual ~BytesDictionaryMatcher(); virtual int32_t matches(UText *text, int32_t maxLength, int32_t limit, int32_t *lengths, int32_t *cpLengths, int32_t *values, - int32_t *prefix) const; - virtual int32_t getType() const; + int32_t *prefix) const override; + virtual int32_t getType() const override; private: UChar32 transform(UChar32 c) const; diff --git a/icu4c/source/common/filteredbrk.cpp b/icu4c/source/common/filteredbrk.cpp index 9bced688702..e4817367a5a 100644 --- a/icu4c/source/common/filteredbrk.cpp +++ b/icu4c/source/common/filteredbrk.cpp @@ -185,37 +185,37 @@ public: /* -- cloning and other subclass stuff -- */ virtual BreakIterator * createBufferClone(void * /*stackBuffer*/, int32_t &/*BufferSize*/, - UErrorCode &status) { + UErrorCode &status) override { // for now - always deep clone status = U_SAFECLONE_ALLOCATED_WARNING; return clone(); } - virtual SimpleFilteredSentenceBreakIterator* clone() const { return new SimpleFilteredSentenceBreakIterator(*this); } - virtual UClassID getDynamicClassID(void) const { return NULL; } - virtual bool operator==(const BreakIterator& o) const { if(this==&o) return true; return false; } + virtual SimpleFilteredSentenceBreakIterator* clone() const override { return new SimpleFilteredSentenceBreakIterator(*this); } + virtual UClassID getDynamicClassID(void) const override { return NULL; } + virtual bool operator==(const BreakIterator& o) const override { if(this==&o) return true; return false; } /* -- text modifying -- */ - virtual void setText(UText *text, UErrorCode &status) { fDelegate->setText(text,status); } - virtual BreakIterator &refreshInputText(UText *input, UErrorCode &status) { fDelegate->refreshInputText(input,status); return *this; } - virtual void adoptText(CharacterIterator* it) { fDelegate->adoptText(it); } - virtual void setText(const UnicodeString &text) { fDelegate->setText(text); } + virtual void setText(UText *text, UErrorCode &status) override { fDelegate->setText(text,status); } + virtual BreakIterator &refreshInputText(UText *input, UErrorCode &status) override { fDelegate->refreshInputText(input,status); return *this; } + virtual void adoptText(CharacterIterator* it) override { fDelegate->adoptText(it); } + virtual void setText(const UnicodeString &text) override { fDelegate->setText(text); } /* -- other functions that are just delegated -- */ - virtual UText *getUText(UText *fillIn, UErrorCode &status) const { return fDelegate->getUText(fillIn,status); } - virtual CharacterIterator& getText(void) const { return fDelegate->getText(); } + virtual UText *getUText(UText *fillIn, UErrorCode &status) const override { return fDelegate->getUText(fillIn,status); } + virtual CharacterIterator& getText(void) const override { return fDelegate->getText(); } /* -- ITERATION -- */ - virtual int32_t first(void); - virtual int32_t preceding(int32_t offset); - virtual int32_t previous(void); - virtual UBool isBoundary(int32_t offset); - virtual int32_t current(void) const { return fDelegate->current(); } // we keep the delegate current, so this should be correct. + virtual int32_t first(void) override; + virtual int32_t preceding(int32_t offset) override; + virtual int32_t previous(void) override; + virtual UBool isBoundary(int32_t offset) override; + virtual int32_t current(void) const override { return fDelegate->current(); } // we keep the delegate current, so this should be correct. - virtual int32_t next(void); + virtual int32_t next(void) override; - virtual int32_t next(int32_t n); - virtual int32_t following(int32_t offset); - virtual int32_t last(void); + virtual int32_t next(int32_t n) override; + virtual int32_t following(int32_t offset) override; + virtual int32_t last(void) override; private: /** @@ -487,9 +487,9 @@ public: virtual ~SimpleFilteredBreakIteratorBuilder(); SimpleFilteredBreakIteratorBuilder(const Locale &fromLocale, UErrorCode &status); SimpleFilteredBreakIteratorBuilder(UErrorCode &status); - virtual UBool suppressBreakAfter(const UnicodeString& exception, UErrorCode& status); - virtual UBool unsuppressBreakAfter(const UnicodeString& exception, UErrorCode& status); - virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status); + virtual UBool suppressBreakAfter(const UnicodeString& exception, UErrorCode& status) override; + virtual UBool unsuppressBreakAfter(const UnicodeString& exception, UErrorCode& status) override; + virtual BreakIterator *build(BreakIterator* adoptBreakIterator, UErrorCode& status) override; private: UStringSet fSet; }; diff --git a/icu4c/source/common/locdspnm.cpp b/icu4c/source/common/locdspnm.cpp index 43334f51964..c4c04702e64 100644 --- a/icu4c/source/common/locdspnm.cpp +++ b/icu4c/source/common/locdspnm.cpp @@ -313,29 +313,29 @@ public: LocaleDisplayNamesImpl(const Locale& locale, UDisplayContext *contexts, int32_t length); virtual ~LocaleDisplayNamesImpl(); - virtual const Locale& getLocale() const; - virtual UDialectHandling getDialectHandling() const; - virtual UDisplayContext getContext(UDisplayContextType type) const; + virtual const Locale& getLocale() const override; + virtual UDialectHandling getDialectHandling() const override; + virtual UDisplayContext getContext(UDisplayContextType type) const override; virtual UnicodeString& localeDisplayName(const Locale& locale, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& localeDisplayName(const char* localeId, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& languageDisplayName(const char* lang, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& scriptDisplayName(const char* script, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& scriptDisplayName(UScriptCode scriptCode, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& regionDisplayName(const char* region, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& variantDisplayName(const char* variant, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& keyDisplayName(const char* key, - UnicodeString& result) const; + UnicodeString& result) const override; virtual UnicodeString& keyValueDisplayName(const char* key, const char* value, - UnicodeString& result) const; + UnicodeString& result) const override; private: UnicodeString& localeIdName(const char* localeId, UnicodeString& result, bool substitute) const; @@ -407,7 +407,7 @@ struct LocaleDisplayNamesImpl::CapitalizationContextSink : public ResourceSink { virtual ~CapitalizationContextSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { ResourceTable contexts = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } for (int i = 0; contexts.getKeyAndValue(i, key, value); ++i) { diff --git a/icu4c/source/common/locid.cpp b/icu4c/source/common/locid.cpp index cff1d07e1c9..e8859c7048b 100644 --- a/icu4c/source/common/locid.cpp +++ b/icu4c/source/common/locid.cpp @@ -2418,7 +2418,7 @@ private: public: static UClassID U_EXPORT2 getStaticClassID(void) { return (UClassID)&fgClassID; } - virtual UClassID getDynamicClassID(void) const { return getStaticClassID(); } + virtual UClassID getDynamicClassID(void) const override { return getStaticClassID(); } public: KeywordEnumeration(const char *keys, int32_t keywordLen, int32_t currentIndex, UErrorCode &status) : keywords((char *)&fgClassID), current((char *)&fgClassID), length(0) { @@ -2442,13 +2442,13 @@ public: virtual ~KeywordEnumeration(); - virtual StringEnumeration * clone() const + virtual StringEnumeration * clone() const override { UErrorCode status = U_ZERO_ERROR; return new KeywordEnumeration(keywords, length, (int32_t)(current - keywords), status); } - virtual int32_t count(UErrorCode &/*status*/) const { + virtual int32_t count(UErrorCode &/*status*/) const override { char *kw = keywords; int32_t result = 0; while(*kw) { @@ -2458,7 +2458,7 @@ public: return result; } - virtual const char* next(int32_t* resultLength, UErrorCode& status) { + virtual const char* next(int32_t* resultLength, UErrorCode& status) override { const char* result; int32_t len; if(U_SUCCESS(status) && *current != 0) { @@ -2477,13 +2477,13 @@ public: return result; } - virtual const UnicodeString* snext(UErrorCode& status) { + virtual const UnicodeString* snext(UErrorCode& status) override { int32_t resultLength = 0; const char *s = next(&resultLength, status); return setChars(s, resultLength, status); } - virtual void reset(UErrorCode& /*status*/) { + virtual void reset(UErrorCode& /*status*/) override { current = keywords; } }; @@ -2501,7 +2501,7 @@ public: using KeywordEnumeration::KeywordEnumeration; virtual ~UnicodeKeywordEnumeration(); - virtual const char* next(int32_t* resultLength, UErrorCode& status) { + virtual const char* next(int32_t* resultLength, UErrorCode& status) override { const char* legacy_key = KeywordEnumeration::next(nullptr, status); while (U_SUCCESS(status) && legacy_key != nullptr) { const char* key = uloc_toUnicodeLocaleKey(legacy_key); diff --git a/icu4c/source/common/lstmbe.cpp b/icu4c/source/common/lstmbe.cpp index df742c812b3..2987da003d1 100644 --- a/icu4c/source/common/lstmbe.cpp +++ b/icu4c/source/common/lstmbe.cpp @@ -93,8 +93,8 @@ public: } // ReadArray1D methods. - virtual int32_t d1() const { return d1_; } - virtual float get(int32_t i) const { + virtual int32_t d1() const override { return d1_; } + virtual float get(int32_t i) const override { U_ASSERT(i < d1_); return data_[i]; } @@ -131,9 +131,9 @@ public: } // ReadArray2D methods. - inline int32_t d1() const { return d1_; } - inline int32_t d2() const { return d2_; } - float get(int32_t i, int32_t j) const { + inline int32_t d1() const override { return d1_; } + inline int32_t d2() const override { return d2_; } + float get(int32_t i, int32_t j) const override { U_ASSERT(i < d1_); U_ASSERT(j < d2_); return data_[i * d2_ + j]; @@ -182,8 +182,8 @@ public: : memory_(nullptr), data_(data), d1_(d1) {} // ReadArray1D methods. - virtual int32_t d1() const { return d1_; } - virtual float get(int32_t i) const { + virtual int32_t d1() const override { return d1_; } + virtual float get(int32_t i) const override { U_ASSERT(i < d1_); return data_[i]; } @@ -313,9 +313,9 @@ public: virtual ~Array2D(); // ReadArray2D methods. - virtual int32_t d1() const { return d1_; } - virtual int32_t d2() const { return d2_; } - virtual float get(int32_t i, int32_t j) const { + virtual int32_t d1() const override { return d1_; } + virtual int32_t d2() const override { return d2_; } + virtual float get(int32_t i, int32_t j) const override { U_ASSERT(i < d1_); U_ASSERT(j < d2_); return data_[i * d2_ + j]; @@ -508,7 +508,7 @@ public: virtual ~CodePointsVectorizer(); virtual void vectorize(UText *text, int32_t startPos, int32_t endPos, UVector32 &offsets, UVector32 &indices, - UErrorCode &status) const; + UErrorCode &status) const override; }; CodePointsVectorizer::~CodePointsVectorizer() @@ -547,7 +547,7 @@ public: virtual ~GraphemeClusterVectorizer(); virtual void vectorize(UText *text, int32_t startPos, int32_t endPos, UVector32 &offsets, UVector32 &indices, - UErrorCode &status) const; + UErrorCode &status) const override; }; GraphemeClusterVectorizer::~GraphemeClusterVectorizer() diff --git a/icu4c/source/common/lstmbe.h b/icu4c/source/common/lstmbe.h index 84015e3a1fc..c3f7ecf8154 100644 --- a/icu4c/source/common/lstmbe.h +++ b/icu4c/source/common/lstmbe.h @@ -62,7 +62,7 @@ protected: int32_t rangeStart, int32_t rangeEnd, UVector32 &foundBreaks, - UErrorCode& status) const; + UErrorCode& status) const override; private: const LSTMData* fData; const Vectorizer* fVectorizer; diff --git a/icu4c/source/common/rbbirb.h b/icu4c/source/common/rbbirb.h index 037c1dc2ce8..11dbf343ece 100644 --- a/icu4c/source/common/rbbirb.h +++ b/icu4c/source/common/rbbirb.h @@ -73,10 +73,10 @@ private: public: // API inherited from class SymbolTable - virtual const UnicodeString* lookup(const UnicodeString& s) const; - virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const; + virtual const UnicodeString* lookup(const UnicodeString& s) const override; + virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const override; virtual UnicodeString parseReference(const UnicodeString& text, - ParsePosition& pos, int32_t limit) const; + ParsePosition& pos, int32_t limit) const override; // Additional Functions RBBISymbolTable(RBBIRuleScanner *, const UnicodeString &fRules, UErrorCode &status); diff --git a/icu4c/source/common/serv.h b/icu4c/source/common/serv.h index 4a6a0fffb82..3bd3d9a9b9e 100644 --- a/icu4c/source/common/serv.h +++ b/icu4c/source/common/serv.h @@ -191,7 +191,7 @@ public: /** * UObject RTTI boilerplate. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #ifdef SERVICE_DEBUG public: @@ -315,7 +315,7 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory { * @param status the error code status. * @return the service object, or NULL if the factory does not support the key. */ - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const; + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override; /** *

This implementation adds a mapping from ID -> this to result if visible is true, @@ -324,7 +324,7 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory { * @param result the mapping table to update. * @param status the error code status. */ - virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const; + virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override; /** *

This implementation returns the factory ID if it equals id and visible is true, @@ -336,7 +336,7 @@ class U_COMMON_API SimpleFactory : public ICUServiceFactory { * @param result output parameter to hold the display name. * @return result. */ - virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const; + virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const override; public: /** @@ -347,7 +347,7 @@ public: /** * UObject RTTI boilerplate. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #ifdef SERVICE_DEBUG public: @@ -390,7 +390,7 @@ public: /** * UObject RTTI boilerplate. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; }; @@ -930,7 +930,7 @@ class U_COMMON_API ICUService : public ICUNotifier { * @param l the listener to test. * @return true if the service accepts the listener. */ - virtual UBool acceptsListener(const EventListener& l) const; + virtual UBool acceptsListener(const EventListener& l) const override; /** *

Notify the listener of a service change.

@@ -941,7 +941,7 @@ class U_COMMON_API ICUService : public ICUNotifier { * * @param l the listener to notify. */ - virtual void notifyListener(EventListener& l) const; + virtual void notifyListener(EventListener& l) const override; /************************************************************************ * Utilities for subclasses. diff --git a/icu4c/source/common/servloc.h b/icu4c/source/common/servloc.h index ccf6433379d..29c50a27d1a 100644 --- a/icu4c/source/common/servloc.h +++ b/icu4c/source/common/servloc.h @@ -106,7 +106,7 @@ class U_COMMON_API LocaleKey : public ICUServiceKey { /** * Append the prefix associated with the kind, or nothing if the kind is KIND_ANY. */ - virtual UnicodeString& prefix(UnicodeString& result) const; + virtual UnicodeString& prefix(UnicodeString& result) const override; /** * Return the kind code associated with this key. @@ -116,17 +116,17 @@ class U_COMMON_API LocaleKey : public ICUServiceKey { /** * Return the canonicalID. */ - virtual UnicodeString& canonicalID(UnicodeString& result) const; + virtual UnicodeString& canonicalID(UnicodeString& result) const override; /** * Return the currentID. */ - virtual UnicodeString& currentID(UnicodeString& result) const; + virtual UnicodeString& currentID(UnicodeString& result) const override; /** * Return the (canonical) current descriptor, or null if no current id. */ - virtual UnicodeString& currentDescriptor(UnicodeString& result) const; + virtual UnicodeString& currentDescriptor(UnicodeString& result) const override; /** * Convenience method to return the locale corresponding to the (canonical) original ID. @@ -147,13 +147,13 @@ class U_COMMON_API LocaleKey : public ICUServiceKey { * unless the primary id was the empty string, in which case * there is no fallback. */ - virtual UBool fallback(); + virtual UBool fallback() override; /** * Return true if a key created from id matches, or would eventually * fallback to match, the canonical ID of this key. */ - virtual UBool isFallbackOf(const UnicodeString& id) const; + virtual UBool isFallbackOf(const UnicodeString& id) const override; public: /** @@ -161,7 +161,7 @@ class U_COMMON_API LocaleKey : public ICUServiceKey { */ static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * Destructor. @@ -238,7 +238,7 @@ protected: * kind off to handleCreate (which subclasses must implement). */ public: - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const; + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override; protected: virtual UBool handlesKey(const ICUServiceKey& key, UErrorCode& status) const; @@ -248,12 +248,12 @@ public: * Override of superclass method. This adjusts the result based * on the coverage rule for this factory. */ - virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const; + virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override; /** * Return a localized name for the locale represented by id. */ - virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const; + virtual UnicodeString& getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const override; protected: /** @@ -281,7 +281,7 @@ public: */ static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #ifdef SERVICE_DEBUG public: @@ -324,13 +324,13 @@ class U_COMMON_API SimpleLocaleKeyFactory : public LocaleKeyFactory { /** * Override of superclass method. Returns the service object if kind/locale match. Service is not used. */ - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const; + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override; /** * Override of superclass method. This adjusts the result based * on the coverage rule for this factory. */ - virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const; + virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override; protected: /** @@ -345,7 +345,7 @@ public: */ static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #ifdef SERVICE_DEBUG public: @@ -394,20 +394,20 @@ protected: /** * Return the supported IDs. This is the set of all locale names in ICULocaleData. */ - virtual const Hashtable* getSupportedIDs(UErrorCode& status) const; + virtual const Hashtable* getSupportedIDs(UErrorCode& status) const override; /** * Create the service. The default implementation returns the resource bundle * for the locale, ignoring kind, and service. */ - virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* service, UErrorCode& status) const; + virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* service, UErrorCode& status) const override; public: /** * UObject boilerplate. */ static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #ifdef SERVICE_DEBUG @@ -512,7 +512,7 @@ class U_COMMON_API ICULocaleService : public ICUService * We really need a flag that is understood by all compilers that will suppress the warning about * hidden overrides. */ - virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status); + virtual URegistryKey registerInstance(UObject* objToAdopt, const UnicodeString& locale, UBool visible, UErrorCode& status) override; /** * Convenience method for callers using locales. This returns the standard @@ -531,7 +531,7 @@ class U_COMMON_API ICULocaleService : public ICUService /** * Override superclass createKey method. */ - virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const; + virtual ICUServiceKey* createKey(const UnicodeString* id, UErrorCode& status) const override; /** * Additional createKey that takes a kind. diff --git a/icu4c/source/common/servls.cpp b/icu4c/source/common/servls.cpp index b6e27507a6f..7108afd4a52 100644 --- a/icu4c/source/common/servls.cpp +++ b/icu4c/source/common/servls.cpp @@ -201,7 +201,7 @@ public: virtual ~ServiceEnumeration(); - virtual StringEnumeration *clone() const { + virtual StringEnumeration *clone() const override { UErrorCode status = U_ZERO_ERROR; ServiceEnumeration *cl = new ServiceEnumeration(*this, status); if(U_FAILURE(status)) { @@ -221,18 +221,18 @@ public: return FALSE; } - virtual int32_t count(UErrorCode& status) const { + virtual int32_t count(UErrorCode& status) const override { return upToDate(status) ? _ids.size() : 0; } - virtual const UnicodeString* snext(UErrorCode& status) { + virtual const UnicodeString* snext(UErrorCode& status) override { if (upToDate(status) && (_pos < _ids.size())) { return (const UnicodeString*)_ids[_pos++]; } return NULL; } - virtual void reset(UErrorCode& status) { + virtual void reset(UErrorCode& status) override { if (status == U_ENUM_OUT_OF_SYNC_ERROR) { status = U_ZERO_ERROR; } @@ -245,7 +245,7 @@ public: public: static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; ServiceEnumeration::~ServiceEnumeration() {} diff --git a/icu4c/source/common/servnotf.h b/icu4c/source/common/servnotf.h index 73ce38c772e..e3b2cac32e4 100644 --- a/icu4c/source/common/servnotf.h +++ b/icu4c/source/common/servnotf.h @@ -40,7 +40,7 @@ public: public: static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; public: #ifdef SERVICE_DEBUG diff --git a/icu4c/source/common/unicode/appendable.h b/icu4c/source/common/unicode/appendable.h index fc99254de14..f77df88e39c 100644 --- a/icu4c/source/common/unicode/appendable.h +++ b/icu4c/source/common/unicode/appendable.h @@ -174,7 +174,7 @@ public: * @return true if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendCodeUnit(char16_t c); + virtual UBool appendCodeUnit(char16_t c) override; /** * Appends a code point to the string. @@ -182,7 +182,7 @@ public: * @return true if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendCodePoint(UChar32 c); + virtual UBool appendCodePoint(UChar32 c) override; /** * Appends a string to the UnicodeString. @@ -191,7 +191,7 @@ public: * @return true if the operation succeeded * @stable ICU 4.8 */ - virtual UBool appendString(const char16_t *s, int32_t length); + virtual UBool appendString(const char16_t *s, int32_t length) override; /** * Tells the UnicodeString that the caller is going to append roughly @@ -200,7 +200,7 @@ public: * @return true if the operation succeeded * @stable ICU 4.8 */ - virtual UBool reserveAppendCapacity(int32_t appendCapacity); + virtual UBool reserveAppendCapacity(int32_t appendCapacity) override; /** * Returns a writable buffer for appending and writes the buffer's capacity to @@ -226,7 +226,7 @@ public: virtual char16_t *getAppendBuffer(int32_t minCapacity, int32_t desiredCapacityHint, char16_t *scratch, int32_t scratchCapacity, - int32_t *resultCapacity); + int32_t *resultCapacity) override; private: UnicodeString &str; diff --git a/icu4c/source/common/unicode/bytestream.h b/icu4c/source/common/unicode/bytestream.h index 9735ee0bf86..997746e4280 100644 --- a/icu4c/source/common/unicode/bytestream.h +++ b/icu4c/source/common/unicode/bytestream.h @@ -206,7 +206,7 @@ public: * @param n the number of bytes; must be non-negative * @stable ICU 4.2 */ - virtual void Append(const char* bytes, int32_t n); + virtual void Append(const char* bytes, int32_t n) override; /** * Returns a writable buffer for appending and writes the buffer's capacity to * *result_capacity. For details see the base class documentation. @@ -224,7 +224,7 @@ public: virtual char* GetAppendBuffer(int32_t min_capacity, int32_t desired_capacity_hint, char* scratch, int32_t scratch_capacity, - int32_t* result_capacity); + int32_t* result_capacity) override; /** * Returns the number of bytes actually written to the sink. * @return number of bytes written to the buffer @@ -291,7 +291,7 @@ class StringByteSink : public ByteSink { * @param n the number of bytes; must be non-negative * @stable ICU 4.2 */ - virtual void Append(const char* data, int32_t n) { dest_->append(data, n); } + virtual void Append(const char* data, int32_t n) override { dest_->append(data, n); } private: StringClass* dest_; diff --git a/icu4c/source/common/unicode/bytestriebuilder.h b/icu4c/source/common/unicode/bytestriebuilder.h index d0a53acbb5c..382f5e0095f 100644 --- a/icu4c/source/common/unicode/bytestriebuilder.h +++ b/icu4c/source/common/unicode/bytestriebuilder.h @@ -134,21 +134,21 @@ private: void buildBytes(UStringTrieBuildOption buildOption, UErrorCode &errorCode); - virtual int32_t getElementStringLength(int32_t i) const; - virtual char16_t getElementUnit(int32_t i, int32_t byteIndex) const; - virtual int32_t getElementValue(int32_t i) const; + virtual int32_t getElementStringLength(int32_t i) const override; + virtual char16_t getElementUnit(int32_t i, int32_t byteIndex) const override; + virtual int32_t getElementValue(int32_t i) const override; - virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t byteIndex) const; + virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t byteIndex) const override; - virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t byteIndex) const; - virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t byteIndex, int32_t count) const; - virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, char16_t byte) const; + virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t byteIndex) const override; + virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t byteIndex, int32_t count) const override; + virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t byteIndex, char16_t byte) const override; - virtual UBool matchNodesCanHaveValues() const { return false; } + virtual UBool matchNodesCanHaveValues() const override { return false; } - virtual int32_t getMaxBranchLinearSubNodeLength() const { return BytesTrie::kMaxBranchLinearSubNodeLength; } - virtual int32_t getMinLinearMatch() const { return BytesTrie::kMinLinearMatch; } - virtual int32_t getMaxLinearMatchLength() const { return BytesTrie::kMaxLinearMatchLength; } + virtual int32_t getMaxBranchLinearSubNodeLength() const override { return BytesTrie::kMaxBranchLinearSubNodeLength; } + virtual int32_t getMinLinearMatch() const override { return BytesTrie::kMinLinearMatch; } + virtual int32_t getMaxLinearMatchLength() const override { return BytesTrie::kMaxLinearMatchLength; } /** * @internal (private) @@ -156,22 +156,22 @@ private: class BTLinearMatchNode : public LinearMatchNode { public: BTLinearMatchNode(const char *units, int32_t len, Node *nextNode); - virtual bool operator==(const Node &other) const; - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual void write(StringTrieBuilder &builder) override; private: const char *s; }; virtual Node *createLinearMatchNode(int32_t i, int32_t byteIndex, int32_t length, - Node *nextNode) const; + Node *nextNode) const override; UBool ensureCapacity(int32_t length); - virtual int32_t write(int32_t byte); + virtual int32_t write(int32_t byte) override; int32_t write(const char *b, int32_t length); - virtual int32_t writeElementUnits(int32_t i, int32_t byteIndex, int32_t length); - virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal); - virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node); - virtual int32_t writeDeltaTo(int32_t jumpTarget); + virtual int32_t writeElementUnits(int32_t i, int32_t byteIndex, int32_t length) override; + virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal) override; + virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node) override; + virtual int32_t writeDeltaTo(int32_t jumpTarget) override; static int32_t internalEncodeDelta(int32_t i, char intBytes[]); CharString *strings; // Pointer not object so we need not #include internal charstr.h. diff --git a/icu4c/source/common/unicode/caniter.h b/icu4c/source/common/unicode/caniter.h index 205eaaa8316..6e57ef5e3ba 100644 --- a/icu4c/source/common/unicode/caniter.h +++ b/icu4c/source/common/unicode/caniter.h @@ -145,7 +145,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: // ===================== PRIVATES ============================== diff --git a/icu4c/source/common/unicode/dtintrv.h b/icu4c/source/common/unicode/dtintrv.h index 5aee5c7a49d..46a94ce3495 100644 --- a/icu4c/source/common/unicode/dtintrv.h +++ b/icu4c/source/common/unicode/dtintrv.h @@ -89,7 +89,7 @@ public: * other classes have different class IDs. * @stable ICU 4.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** diff --git a/icu4c/source/common/unicode/locid.h b/icu4c/source/common/unicode/locid.h index af1fbc37b26..2f2b3998a78 100644 --- a/icu4c/source/common/unicode/locid.h +++ b/icu4c/source/common/unicode/locid.h @@ -1005,7 +1005,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * A Locale iterator interface similar to a Java Iterator. diff --git a/icu4c/source/common/unicode/normlzr.h b/icu4c/source/common/unicode/normlzr.h index d071182050f..93661990fec 100644 --- a/icu4c/source/common/unicode/normlzr.h +++ b/icu4c/source/common/unicode/normlzr.h @@ -732,7 +732,7 @@ public: * @return a UClassID for the actual class. * @deprecated ICU 56 Use Normalizer2 instead. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; #endif // U_FORCE_HIDE_DEPRECATED_API private: diff --git a/icu4c/source/common/unicode/parsepos.h b/icu4c/source/common/unicode/parsepos.h index 67397e45b0a..73945f5f97b 100644 --- a/icu4c/source/common/unicode/parsepos.h +++ b/icu4c/source/common/unicode/parsepos.h @@ -166,7 +166,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: /** diff --git a/icu4c/source/common/unicode/rbbi.h b/icu4c/source/common/unicode/rbbi.h index 6108261e963..0ce93819f54 100644 --- a/icu4c/source/common/unicode/rbbi.h +++ b/icu4c/source/common/unicode/rbbi.h @@ -260,7 +260,7 @@ public: * same class, have the same behavior, and iterate over the same text. * @stable ICU 2.0 */ - virtual bool operator==(const BreakIterator& that) const; + virtual bool operator==(const BreakIterator& that) const override; /** * Not-equal operator. If operator== returns true, this returns false, @@ -281,7 +281,7 @@ public: * @return a newly-constructed RuleBasedBreakIterator * @stable ICU 2.0 */ - virtual RuleBasedBreakIterator* clone() const; + virtual RuleBasedBreakIterator* clone() const override; /** * Compute a hash code for this BreakIterator @@ -326,7 +326,7 @@ public: * @return An iterator over the text being analyzed. * @stable ICU 2.0 */ - virtual CharacterIterator& getText(void) const; + virtual CharacterIterator& getText(void) const override; /** @@ -343,7 +343,7 @@ public: * UText was provided, it will always be returned. * @stable ICU 3.4 */ - virtual UText *getUText(UText *fillIn, UErrorCode &status) const; + virtual UText *getUText(UText *fillIn, UErrorCode &status) const override; /** * Set the iterator to analyze a new piece of text. This function resets @@ -352,7 +352,7 @@ public: * takes ownership of the character iterator. The caller MUST NOT delete it! * @stable ICU 2.0 */ - virtual void adoptText(CharacterIterator* newText); + virtual void adoptText(CharacterIterator* newText) override; /** * Set the iterator to analyze a new piece of text. This function resets @@ -365,7 +365,7 @@ public: * @param newText The text to analyze. * @stable ICU 2.0 */ - virtual void setText(const UnicodeString& newText); + virtual void setText(const UnicodeString& newText) override; /** * Reset the break iterator to operate over the text represented by @@ -380,21 +380,21 @@ public: * @param status Receives any error codes. * @stable ICU 3.4 */ - virtual void setText(UText *text, UErrorCode &status); + virtual void setText(UText *text, UErrorCode &status) override; /** * Sets the current iteration position to the beginning of the text, position zero. * @return The offset of the beginning of the text, zero. * @stable ICU 2.0 */ - virtual int32_t first(void); + virtual int32_t first(void) override; /** * Sets the current iteration position to the end of the text. * @return The text's past-the-end offset. * @stable ICU 2.0 */ - virtual int32_t last(void); + virtual int32_t last(void) override; /** * Advances the iterator either forward or backward the specified number of steps. @@ -406,21 +406,21 @@ public: * the current one. * @stable ICU 2.0 */ - virtual int32_t next(int32_t n); + virtual int32_t next(int32_t n) override; /** * Advances the iterator to the next boundary position. * @return The position of the first boundary after this one. * @stable ICU 2.0 */ - virtual int32_t next(void); + virtual int32_t next(void) override; /** * Moves the iterator backwards, to the last boundary preceding this one. * @return The position of the last boundary position preceding this one. * @stable ICU 2.0 */ - virtual int32_t previous(void); + virtual int32_t previous(void) override; /** * Sets the iterator to refer to the first boundary position following @@ -429,7 +429,7 @@ public: * @return The position of the first break after the current position. * @stable ICU 2.0 */ - virtual int32_t following(int32_t offset); + virtual int32_t following(int32_t offset) override; /** * Sets the iterator to refer to the last boundary position before the @@ -438,7 +438,7 @@ public: * @return The position of the last boundary before the starting position. * @stable ICU 2.0 */ - virtual int32_t preceding(int32_t offset); + virtual int32_t preceding(int32_t offset) override; /** * Returns true if the specified position is a boundary position. As a side @@ -448,7 +448,7 @@ public: * @return True if "offset" is a boundary position. * @stable ICU 2.0 */ - virtual UBool isBoundary(int32_t offset); + virtual UBool isBoundary(int32_t offset) override; /** * Returns the current iteration position. Note that UBRK_DONE is never @@ -458,7 +458,7 @@ public: * @return The current iteration position. * @stable ICU 2.0 */ - virtual int32_t current(void) const; + virtual int32_t current(void) const override; /** @@ -492,7 +492,7 @@ public: * @see UWordBreak * @stable ICU 2.2 */ - virtual int32_t getRuleStatus() const; + virtual int32_t getRuleStatus() const override; /** * Get the status (tag) values from the break rule(s) that determined the boundary @@ -517,7 +517,7 @@ public: * @see getRuleStatus * @stable ICU 3.0 */ - virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status); + virtual int32_t getRuleStatusVec(int32_t *fillInVec, int32_t capacity, UErrorCode &status) override; /** * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. @@ -530,7 +530,7 @@ public: * other classes have different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Returns the class ID for this class. This is useful only for @@ -574,7 +574,7 @@ public: */ virtual RuleBasedBreakIterator *createBufferClone(void *stackBuffer, int32_t &BufferSize, - UErrorCode &status); + UErrorCode &status) override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -621,7 +621,7 @@ public: * * @stable ICU 49 */ - virtual RuleBasedBreakIterator &refreshInputText(UText *input, UErrorCode &status); + virtual RuleBasedBreakIterator &refreshInputText(UText *input, UErrorCode &status) override; private: diff --git a/icu4c/source/common/unicode/resbund.h b/icu4c/source/common/unicode/resbund.h index 1cae05c376c..74c8b7ba57d 100644 --- a/icu4c/source/common/unicode/resbund.h +++ b/icu4c/source/common/unicode/resbund.h @@ -474,7 +474,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/common/unicode/schriter.h b/icu4c/source/common/unicode/schriter.h index b7a3e366f38..9dac0999677 100644 --- a/icu4c/source/common/unicode/schriter.h +++ b/icu4c/source/common/unicode/schriter.h @@ -124,7 +124,7 @@ public: * same string and are pointing at the same character. * @stable ICU 2.0 */ - virtual bool operator==(const ForwardCharacterIterator& that) const; + virtual bool operator==(const ForwardCharacterIterator& that) const override; /** * Returns a new StringCharacterIterator referring to the same @@ -133,7 +133,7 @@ public: * @return the newly cloned object. * @stable ICU 2.0 */ - virtual StringCharacterIterator* clone() const; + virtual StringCharacterIterator* clone() const override; /** * Sets the iterator to iterate over the provided string. @@ -149,14 +149,14 @@ public: * @param result Receives a copy of the text under iteration. * @stable ICU 2.0 */ - virtual void getText(UnicodeString& result); + virtual void getText(UnicodeString& result) override; /** * Return a class ID for this object (not really public) * @return a class ID for this object. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return a class ID for this class (not really public) diff --git a/icu4c/source/common/unicode/stringtriebuilder.h b/icu4c/source/common/unicode/stringtriebuilder.h index 9ef2a437d48..b7a9b23d22b 100644 --- a/icu4c/source/common/unicode/stringtriebuilder.h +++ b/icu4c/source/common/unicode/stringtriebuilder.h @@ -265,8 +265,8 @@ protected: class FinalValueNode : public Node { public: FinalValueNode(int32_t v) : Node(0x111111u*37u+v), value(v) {} - virtual bool operator==(const Node &other) const; - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual void write(StringTrieBuilder &builder) override; protected: int32_t value; }; @@ -280,7 +280,7 @@ protected: class ValueNode : public Node { public: ValueNode(int32_t initialHash) : Node(initialHash), hasValue(false), value(0) {} - virtual bool operator==(const Node &other) const; + virtual bool operator==(const Node &other) const override; void setValue(int32_t v) { hasValue=true; value=v; @@ -299,9 +299,9 @@ protected: public: IntermediateValueNode(int32_t v, Node *nextNode) : ValueNode(0x222222u*37u+hashCode(nextNode)), next(nextNode) { setValue(v); } - virtual bool operator==(const Node &other) const; - virtual int32_t markRightEdgesFirst(int32_t edgeNumber); - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual int32_t markRightEdgesFirst(int32_t edgeNumber) override; + virtual void write(StringTrieBuilder &builder) override; protected: Node *next; }; @@ -317,8 +317,8 @@ protected: LinearMatchNode(int32_t len, Node *nextNode) : ValueNode((0x333333u*37u+len)*37u+hashCode(nextNode)), length(len), next(nextNode) {} - virtual bool operator==(const Node &other) const; - virtual int32_t markRightEdgesFirst(int32_t edgeNumber); + virtual bool operator==(const Node &other) const override; + virtual int32_t markRightEdgesFirst(int32_t edgeNumber) override; protected: int32_t length; Node *next; @@ -341,9 +341,9 @@ protected: class ListBranchNode : public BranchNode { public: ListBranchNode() : BranchNode(0x444444), length(0) {} - virtual bool operator==(const Node &other) const; - virtual int32_t markRightEdgesFirst(int32_t edgeNumber); - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual int32_t markRightEdgesFirst(int32_t edgeNumber) override; + virtual void write(StringTrieBuilder &builder) override; // Adds a unit with a final value. void add(int32_t c, int32_t value) { units[length]=(char16_t)c; @@ -376,9 +376,9 @@ protected: : BranchNode(((0x555555u*37u+middleUnit)*37u+ hashCode(lessThanNode))*37u+hashCode(greaterOrEqualNode)), unit(middleUnit), lessThan(lessThanNode), greaterOrEqual(greaterOrEqualNode) {} - virtual bool operator==(const Node &other) const; - virtual int32_t markRightEdgesFirst(int32_t edgeNumber); - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual int32_t markRightEdgesFirst(int32_t edgeNumber) override; + virtual void write(StringTrieBuilder &builder) override; protected: char16_t unit; Node *lessThan; @@ -392,9 +392,9 @@ protected: BranchHeadNode(int32_t len, Node *subNode) : ValueNode((0x666666u*37u+len)*37u+hashCode(subNode)), length(len), next(subNode) {} - virtual bool operator==(const Node &other) const; - virtual int32_t markRightEdgesFirst(int32_t edgeNumber); - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual int32_t markRightEdgesFirst(int32_t edgeNumber) override; + virtual void write(StringTrieBuilder &builder) override; protected: int32_t length; Node *next; // A branch sub-node. diff --git a/icu4c/source/common/unicode/ucharstriebuilder.h b/icu4c/source/common/unicode/ucharstriebuilder.h index 4cf3dcdddff..e0cb0acdc53 100644 --- a/icu4c/source/common/unicode/ucharstriebuilder.h +++ b/icu4c/source/common/unicode/ucharstriebuilder.h @@ -138,41 +138,41 @@ private: void buildUChars(UStringTrieBuildOption buildOption, UErrorCode &errorCode); - virtual int32_t getElementStringLength(int32_t i) const; - virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const; - virtual int32_t getElementValue(int32_t i) const; + virtual int32_t getElementStringLength(int32_t i) const override; + virtual char16_t getElementUnit(int32_t i, int32_t unitIndex) const override; + virtual int32_t getElementValue(int32_t i) const override; - virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex) const; + virtual int32_t getLimitOfLinearMatch(int32_t first, int32_t last, int32_t unitIndex) const override; - virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex) const; - virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const; - virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const; + virtual int32_t countElementUnits(int32_t start, int32_t limit, int32_t unitIndex) const override; + virtual int32_t skipElementsBySomeUnits(int32_t i, int32_t unitIndex, int32_t count) const override; + virtual int32_t indexOfElementWithNextUnit(int32_t i, int32_t unitIndex, char16_t unit) const override; - virtual UBool matchNodesCanHaveValues() const { return true; } + virtual UBool matchNodesCanHaveValues() const override { return true; } - virtual int32_t getMaxBranchLinearSubNodeLength() const { return UCharsTrie::kMaxBranchLinearSubNodeLength; } - virtual int32_t getMinLinearMatch() const { return UCharsTrie::kMinLinearMatch; } - virtual int32_t getMaxLinearMatchLength() const { return UCharsTrie::kMaxLinearMatchLength; } + virtual int32_t getMaxBranchLinearSubNodeLength() const override { return UCharsTrie::kMaxBranchLinearSubNodeLength; } + virtual int32_t getMinLinearMatch() const override { return UCharsTrie::kMinLinearMatch; } + virtual int32_t getMaxLinearMatchLength() const override { return UCharsTrie::kMaxLinearMatchLength; } class UCTLinearMatchNode : public LinearMatchNode { public: UCTLinearMatchNode(const char16_t *units, int32_t len, Node *nextNode); - virtual bool operator==(const Node &other) const; - virtual void write(StringTrieBuilder &builder); + virtual bool operator==(const Node &other) const override; + virtual void write(StringTrieBuilder &builder) override; private: const char16_t *s; }; virtual Node *createLinearMatchNode(int32_t i, int32_t unitIndex, int32_t length, - Node *nextNode) const; + Node *nextNode) const override; UBool ensureCapacity(int32_t length); - virtual int32_t write(int32_t unit); + virtual int32_t write(int32_t unit) override; int32_t write(const char16_t *s, int32_t length); - virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length); - virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal); - virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node); - virtual int32_t writeDeltaTo(int32_t jumpTarget); + virtual int32_t writeElementUnits(int32_t i, int32_t unitIndex, int32_t length) override; + virtual int32_t writeValueAndFinal(int32_t i, UBool isFinal) override; + virtual int32_t writeValueAndType(UBool hasValue, int32_t value, int32_t node) override; + virtual int32_t writeDeltaTo(int32_t jumpTarget) override; UnicodeString strings; UCharsTrieElement *elements; diff --git a/icu4c/source/common/unicode/uchriter.h b/icu4c/source/common/unicode/uchriter.h index 76c73546444..9fae5e7de08 100644 --- a/icu4c/source/common/unicode/uchriter.h +++ b/icu4c/source/common/unicode/uchriter.h @@ -119,14 +119,14 @@ public: * same string and are pointing at the same character. * @stable ICU 2.0 */ - virtual bool operator==(const ForwardCharacterIterator& that) const; + virtual bool operator==(const ForwardCharacterIterator& that) const override; /** * Generates a hash code for this iterator. * @return the hash code. * @stable ICU 2.0 */ - virtual int32_t hashCode(void) const; + virtual int32_t hashCode(void) const override; /** * Returns a new UCharCharacterIterator referring to the same @@ -135,7 +135,7 @@ public: * @return the CharacterIterator newly created * @stable ICU 2.0 */ - virtual UCharCharacterIterator* clone() const; + virtual UCharCharacterIterator* clone() const override; /** * Sets the iterator to refer to the first code unit in its @@ -144,7 +144,7 @@ public: * @return the first code unit in its iteration range. * @stable ICU 2.0 */ - virtual char16_t first(void); + virtual char16_t first(void) override; /** * Sets the iterator to refer to the first code unit in its @@ -154,7 +154,7 @@ public: * @return the first code unit in its iteration range * @stable ICU 2.0 */ - virtual char16_t firstPostInc(void); + virtual char16_t firstPostInc(void) override; /** * Sets the iterator to refer to the first code point in its @@ -165,7 +165,7 @@ public: * @return the first code point in its iteration range * @stable ICU 2.0 */ - virtual UChar32 first32(void); + virtual UChar32 first32(void) override; /** * Sets the iterator to refer to the first code point in its @@ -175,7 +175,7 @@ public: * @return the first code point in its iteration range. * @stable ICU 2.0 */ - virtual UChar32 first32PostInc(void); + virtual UChar32 first32PostInc(void) override; /** * Sets the iterator to refer to the last code unit in its @@ -184,7 +184,7 @@ public: * @return the last code unit in its iteration range. * @stable ICU 2.0 */ - virtual char16_t last(void); + virtual char16_t last(void) override; /** * Sets the iterator to refer to the last code point in its @@ -193,7 +193,7 @@ public: * @return the last code point in its iteration range. * @stable ICU 2.0 */ - virtual UChar32 last32(void); + virtual UChar32 last32(void) override; /** * Sets the iterator to refer to the "position"-th code unit @@ -203,7 +203,7 @@ public: * @return the code unit * @stable ICU 2.0 */ - virtual char16_t setIndex(int32_t position); + virtual char16_t setIndex(int32_t position) override; /** * Sets the iterator to refer to the beginning of the code point @@ -216,21 +216,21 @@ public: * @return the code unit * @stable ICU 2.0 */ - virtual UChar32 setIndex32(int32_t position); + virtual UChar32 setIndex32(int32_t position) override; /** * Returns the code unit the iterator currently refers to. * @return the code unit the iterator currently refers to. * @stable ICU 2.0 */ - virtual char16_t current(void) const; + virtual char16_t current(void) const override; /** * Returns the code point the iterator currently refers to. * @return the code point the iterator currently refers to. * @stable ICU 2.0 */ - virtual UChar32 current32(void) const; + virtual UChar32 current32(void) const override; /** * Advances to the next code unit in the iteration range (toward @@ -239,7 +239,7 @@ public: * @return the next code unit in the iteration range. * @stable ICU 2.0 */ - virtual char16_t next(void); + virtual char16_t next(void) override; /** * Gets the current code unit for returning and advances to the next code unit @@ -249,7 +249,7 @@ public: * @return the current code unit. * @stable ICU 2.0 */ - virtual char16_t nextPostInc(void); + virtual char16_t nextPostInc(void) override; /** * Advances to the next code point in the iteration range (toward @@ -261,7 +261,7 @@ public: * @return the next code point in the iteration range. * @stable ICU 2.0 */ - virtual UChar32 next32(void); + virtual UChar32 next32(void) override; /** * Gets the current code point for returning and advances to the next code point @@ -271,7 +271,7 @@ public: * @return the current point. * @stable ICU 2.0 */ - virtual UChar32 next32PostInc(void); + virtual UChar32 next32PostInc(void) override; /** * Returns false if there are no more code units or code points @@ -282,7 +282,7 @@ public: * at or after the current position in the iteration range. * @stable ICU 2.0 */ - virtual UBool hasNext(); + virtual UBool hasNext() override; /** * Advances to the previous code unit in the iteration range (toward @@ -291,7 +291,7 @@ public: * @return the previous code unit in the iteration range. * @stable ICU 2.0 */ - virtual char16_t previous(void); + virtual char16_t previous(void) override; /** * Advances to the previous code point in the iteration range (toward @@ -300,7 +300,7 @@ public: * @return the previous code point in the iteration range. * @stable ICU 2.0 */ - virtual UChar32 previous32(void); + virtual UChar32 previous32(void) override; /** * Returns false if there are no more code units or code points @@ -311,7 +311,7 @@ public: * before the current position in the iteration range. * @stable ICU 2.0 */ - virtual UBool hasPrevious(); + virtual UBool hasPrevious() override; /** * Moves the current position relative to the start or end of the @@ -324,7 +324,7 @@ public: * @return the new position * @stable ICU 2.0 */ - virtual int32_t move(int32_t delta, EOrigin origin); + virtual int32_t move(int32_t delta, EOrigin origin) override; /** * Moves the current position relative to the start or end of the @@ -341,7 +341,7 @@ public: // One of the system headers right now is sometimes defining a conflicting macro we don't use #undef move32 #endif - virtual int32_t move32(int32_t delta, EOrigin origin); + virtual int32_t move32(int32_t delta, EOrigin origin) override; /** * Sets the iterator to iterate over a new range of text @@ -356,7 +356,7 @@ public: * @param result Receives a copy of the text under iteration. * @stable ICU 2.0 */ - virtual void getText(UnicodeString& result); + virtual void getText(UnicodeString& result) override; /** * Return a class ID for this class (not really public) @@ -370,7 +370,7 @@ public: * @return a class ID for this object. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; protected: /** diff --git a/icu4c/source/common/unicode/uniset.h b/icu4c/source/common/unicode/uniset.h index dc3e0b24594..d0cc86e02d2 100644 --- a/icu4c/source/common/unicode/uniset.h +++ b/icu4c/source/common/unicode/uniset.h @@ -502,7 +502,7 @@ public: * @see cloneAsThawed * @stable ICU 2.0 */ - virtual UnicodeSet* clone() const; + virtual UnicodeSet* clone() const override; /** * Returns the hash code value for this set. @@ -704,7 +704,7 @@ public: * @stable ICU 2.0 */ virtual UnicodeString& toPattern(UnicodeString& result, - UBool escapeUnprintable = false) const; + UBool escapeUnprintable = false) const override; /** * Modifies this set to contain those code points which have the given value @@ -802,7 +802,7 @@ public: * @return true if the test condition is met * @stable ICU 2.0 */ - virtual UBool contains(UChar32 c) const; + virtual UBool contains(UChar32 c) const override; /** * Returns true if this set contains every character @@ -1011,7 +1011,7 @@ public: virtual UMatchDegree matches(const Replaceable& text, int32_t& offset, int32_t limit, - UBool incremental); + UBool incremental) override; private: /** @@ -1060,7 +1060,7 @@ public: * @param toUnionTo the set into which to union the source characters * @stable ICU 2.4 */ - virtual void addMatchSetTo(UnicodeSet& toUnionTo) const; + virtual void addMatchSetTo(UnicodeSet& toUnionTo) const override; /** * Returns the index of the given character within this set, where @@ -1521,7 +1521,7 @@ public: * different class IDs. * @stable ICU 2.4 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; private: @@ -1542,7 +1542,7 @@ private: * is the given value. This is used by RuleBasedTransliterator for * indexing. */ - virtual UBool matchesIndexValue(uint8_t v) const; + virtual UBool matchesIndexValue(uint8_t v) const override; private: friend class RBBIRuleScanner; diff --git a/icu4c/source/common/unicode/unistr.h b/icu4c/source/common/unicode/unistr.h index 936a631fcb6..b3c99481079 100644 --- a/icu4c/source/common/unicode/unistr.h +++ b/icu4c/source/common/unicode/unistr.h @@ -1526,7 +1526,7 @@ public: */ virtual void extractBetween(int32_t start, int32_t limit, - UnicodeString& target) const; + UnicodeString& target) const override; /** * Copy the characters in the range @@ -2456,14 +2456,14 @@ public: */ virtual void handleReplaceBetween(int32_t start, int32_t limit, - const UnicodeString& text); + const UnicodeString& text) override; /** * Replaceable API * @return true if it has MetaData * @stable ICU 2.4 */ - virtual UBool hasMetaData() const; + virtual UBool hasMetaData() const override; /** * Copy a substring of this object, retaining attribute (out-of-band) @@ -2478,7 +2478,7 @@ public: * dest >= limit`. * @stable ICU 2.0 */ - virtual void copy(int32_t start, int32_t limit, int32_t dest); + virtual void copy(int32_t start, int32_t limit, int32_t dest) override; /* Search and replace operations */ @@ -3338,7 +3338,7 @@ public: * @see getDynamicClassID * @stable ICU 2.6 */ - virtual UnicodeString *clone() const; + virtual UnicodeString *clone() const override; /** Destructor. * @stable ICU 2.0 @@ -3444,7 +3444,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; //======================================== // Implementation methods @@ -3455,21 +3455,21 @@ protected: * Implement Replaceable::getLength() (see jitterbug 1027). * @stable ICU 2.4 */ - virtual int32_t getLength() const; + virtual int32_t getLength() const override; /** * The change in Replaceable to use virtual getCharAt() allows * UnicodeString::charAt() to be inline again (see jitterbug 709). * @stable ICU 2.4 */ - virtual char16_t getCharAt(int32_t offset) const; + virtual char16_t getCharAt(int32_t offset) const override; /** * The change in Replaceable to use virtual getChar32At() allows * UnicodeString::char32At() to be inline again (see jitterbug 709). * @stable ICU 2.4 */ - virtual UChar32 getChar32At(int32_t offset) const; + virtual UChar32 getChar32At(int32_t offset) const override; private: // For char* constructors. Could be made public. diff --git a/icu4c/source/common/unicode/usetiter.h b/icu4c/source/common/unicode/usetiter.h index 95226d97b15..5834c308e41 100644 --- a/icu4c/source/common/unicode/usetiter.h +++ b/icu4c/source/common/unicode/usetiter.h @@ -255,7 +255,7 @@ class U_COMMON_API UnicodeSetIterator U_FINAL : public UObject { * * @stable ICU 2.4 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; // ======================= PRIVATES =========================== diff --git a/icu4c/source/common/unifiedcache.h b/icu4c/source/common/unifiedcache.h index f22481b348c..07a734b8bd5 100644 --- a/icu4c/source/common/unifiedcache.h +++ b/icu4c/source/common/unifiedcache.h @@ -107,7 +107,7 @@ class CacheKey : public CacheKeyBase { /** * The template parameter, T, determines the hash code returned. */ - virtual int32_t hashCode() const { + virtual int32_t hashCode() const override { const char *s = typeid(T).name(); return ustr_hashCharsN(s, static_cast(uprv_strlen(s))); } @@ -115,7 +115,7 @@ class CacheKey : public CacheKeyBase { /** * Use the value type, T, as the description. */ - virtual char *writeDescription(char *buffer, int32_t bufLen) const { + virtual char *writeDescription(char *buffer, int32_t bufLen) const override { const char *s = typeid(T).name(); uprv_strncpy(buffer, s, bufLen); buffer[bufLen - 1] = 0; @@ -126,7 +126,7 @@ class CacheKey : public CacheKeyBase { /** * Two objects are equal if they are of the same type. */ - virtual bool equals(const CacheKeyBase &other) const { + virtual bool equals(const CacheKeyBase &other) const override { return this == &other || typeid(*this) == typeid(other); } }; @@ -139,7 +139,7 @@ template class LocaleCacheKey : public CacheKey { protected: Locale fLoc; - virtual bool equals(const CacheKeyBase &other) const { + virtual bool equals(const CacheKeyBase &other) const override { if (!CacheKey::equals(other)) { return false; } @@ -152,21 +152,21 @@ class LocaleCacheKey : public CacheKey { LocaleCacheKey(const LocaleCacheKey &other) : CacheKey(other), fLoc(other.fLoc) { } virtual ~LocaleCacheKey() { } - virtual int32_t hashCode() const { + virtual int32_t hashCode() const override { return (int32_t)(37u * (uint32_t)CacheKey::hashCode() + (uint32_t)fLoc.hashCode()); } inline bool operator == (const LocaleCacheKey &other) const { return fLoc == other.fLoc; } - virtual CacheKeyBase *clone() const { + virtual CacheKeyBase *clone() const override { return new LocaleCacheKey(*this); } virtual const T *createObject( - const void *creationContext, UErrorCode &status) const; + const void *creationContext, UErrorCode &status) const override; /** * Use the locale id as the description. */ - virtual char *writeDescription(char *buffer, int32_t bufLen) const { + virtual char *writeDescription(char *buffer, int32_t bufLen) const override { const char *s = fLoc.getName(); uprv_strncpy(buffer, s, bufLen); buffer[bufLen - 1] = 0; @@ -341,7 +341,7 @@ class U_COMMON_API UnifiedCache : public UnifiedCacheBase { */ int32_t unusedCount() const; - virtual void handleUnreferencedObject() const; + virtual void handleUnreferencedObject() const override; virtual ~UnifiedCache(); private: diff --git a/icu4c/source/common/uresdata.h b/icu4c/source/common/uresdata.h index 8f6ba64dcd6..b8a3adba634 100644 --- a/icu4c/source/common/uresdata.h +++ b/icu4c/source/common/uresdata.h @@ -535,21 +535,21 @@ public: const ResourceData &getData() const { return *pResData; } UResourceDataEntry *getValidLocaleDataEntry() const { return validLocaleDataEntry; } Resource getResource() const { return res; } - virtual UResType getType() const; - virtual const UChar *getString(int32_t &length, UErrorCode &errorCode) const; - virtual const UChar *getAliasString(int32_t &length, UErrorCode &errorCode) const; - virtual int32_t getInt(UErrorCode &errorCode) const; - virtual uint32_t getUInt(UErrorCode &errorCode) const; - virtual const int32_t *getIntVector(int32_t &length, UErrorCode &errorCode) const; - virtual const uint8_t *getBinary(int32_t &length, UErrorCode &errorCode) const; - virtual ResourceArray getArray(UErrorCode &errorCode) const; - virtual ResourceTable getTable(UErrorCode &errorCode) const; - virtual UBool isNoInheritanceMarker() const; + virtual UResType getType() const override; + virtual const UChar *getString(int32_t &length, UErrorCode &errorCode) const override; + virtual const UChar *getAliasString(int32_t &length, UErrorCode &errorCode) const override; + virtual int32_t getInt(UErrorCode &errorCode) const override; + virtual uint32_t getUInt(UErrorCode &errorCode) const override; + virtual const int32_t *getIntVector(int32_t &length, UErrorCode &errorCode) const override; + virtual const uint8_t *getBinary(int32_t &length, UErrorCode &errorCode) const override; + virtual ResourceArray getArray(UErrorCode &errorCode) const override; + virtual ResourceTable getTable(UErrorCode &errorCode) const override; + virtual UBool isNoInheritanceMarker() const override; virtual int32_t getStringArray(UnicodeString *dest, int32_t capacity, - UErrorCode &errorCode) const; + UErrorCode &errorCode) const override; virtual int32_t getStringArrayOrStringAsArray(UnicodeString *dest, int32_t capacity, - UErrorCode &errorCode) const; - virtual UnicodeString getStringOrFirstOfArray(UErrorCode &errorCode) const; + UErrorCode &errorCode) const override; + virtual UnicodeString getStringOrFirstOfArray(UErrorCode &errorCode) const override; private: const ResourceData *pResData; diff --git a/icu4c/source/common/ustrenum.h b/icu4c/source/common/ustrenum.h index a82162e2bde..3703dedb97d 100644 --- a/icu4c/source/common/ustrenum.h +++ b/icu4c/source/common/ustrenum.h @@ -47,9 +47,9 @@ public: * @param status the error code. * @return number of elements in the iterator. */ - virtual int32_t count(UErrorCode& status) const; + virtual int32_t count(UErrorCode& status) const override; - virtual const char* next(int32_t *resultLength, UErrorCode& status); + virtual const char* next(int32_t *resultLength, UErrorCode& status) override; /** * Returns the next element a UnicodeString*. If there are no @@ -57,18 +57,18 @@ public: * @param status the error code. * @return a pointer to the string, or NULL. */ - virtual const UnicodeString* snext(UErrorCode& status); + virtual const UnicodeString* snext(UErrorCode& status) override; /** * Resets the iterator. * @param status the error code. */ - virtual void reset(UErrorCode& status); + virtual void reset(UErrorCode& status) override; /** * ICU4C "poor man's RTTI", returns a UClassID for the actual ICU class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU4C "poor man's RTTI", returns a UClassID for this ICU class. diff --git a/icu4c/source/common/uts46.cpp b/icu4c/source/common/uts46.cpp index f25b4e12f12..6f930703390 100644 --- a/icu4c/source/common/uts46.cpp +++ b/icu4c/source/common/uts46.cpp @@ -118,35 +118,35 @@ public: virtual UnicodeString & labelToASCII(const UnicodeString &label, UnicodeString &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual UnicodeString & labelToUnicode(const UnicodeString &label, UnicodeString &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual UnicodeString & nameToASCII(const UnicodeString &name, UnicodeString &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual UnicodeString & nameToUnicode(const UnicodeString &name, UnicodeString &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual void labelToASCII_UTF8(StringPiece label, ByteSink &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual void labelToUnicodeUTF8(StringPiece label, ByteSink &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual void nameToASCII_UTF8(StringPiece name, ByteSink &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; virtual void nameToUnicodeUTF8(StringPiece name, ByteSink &dest, - IDNAInfo &info, UErrorCode &errorCode) const; + IDNAInfo &info, UErrorCode &errorCode) const override; private: UnicodeString & diff --git a/icu4c/source/common/uvector.h b/icu4c/source/common/uvector.h index ff086308594..66ddcd22f79 100644 --- a/icu4c/source/common/uvector.h +++ b/icu4c/source/common/uvector.h @@ -292,7 +292,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: int32_t indexOf(UElement key, int32_t startIndex = 0, int8_t hint = 0) const; @@ -374,7 +374,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; // Disallow UStack(const UStack&) = delete; diff --git a/icu4c/source/common/uvectr32.h b/icu4c/source/common/uvectr32.h index bb829ca4a13..f08c2ade765 100644 --- a/icu4c/source/common/uvectr32.h +++ b/icu4c/source/common/uvectr32.h @@ -181,7 +181,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: void _init(int32_t initialCapacity, UErrorCode &status); diff --git a/icu4c/source/common/uvectr64.h b/icu4c/source/common/uvectr64.h index 3ccca65c571..ba3eca268df 100644 --- a/icu4c/source/common/uvectr64.h +++ b/icu4c/source/common/uvectr64.h @@ -170,7 +170,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: void _init(int32_t initialCapacity, UErrorCode &status); diff --git a/icu4c/source/extra/scrptrun/scrptrun.h b/icu4c/source/extra/scrptrun/scrptrun.h index ac6bfe327e8..7f033a72834 100644 --- a/icu4c/source/extra/scrptrun/scrptrun.h +++ b/icu4c/source/extra/scrptrun/scrptrun.h @@ -62,7 +62,7 @@ public: * * @stable ICU 2.2 */ - virtual inline UClassID getDynamicClassID() const { return getStaticClassID(); } + virtual inline UClassID getDynamicClassID() const override { return getStaticClassID(); } /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/anytrans.h b/icu4c/source/i18n/anytrans.h index 627dee3c814..67ebb2e7d2f 100644 --- a/icu4c/source/i18n/anytrans.h +++ b/icu4c/source/i18n/anytrans.h @@ -66,18 +66,18 @@ public: /** * Transliterator API. */ - virtual AnyTransliterator* clone() const; + virtual AnyTransliterator* clone() const override; /** * Implements {@link Transliterator#handleTransliterate}. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& index, - UBool incremental) const; + UBool incremental) const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/astro.cpp b/icu4c/source/i18n/astro.cpp index f6e494de920..6dc463b4ca4 100644 --- a/icu4c/source/i18n/astro.cpp +++ b/icu4c/source/i18n/astro.cpp @@ -723,7 +723,7 @@ CalendarAstronomer::AngleFunc::~AngleFunc() {} class SunTimeAngleFunc : public CalendarAstronomer::AngleFunc { public: virtual ~SunTimeAngleFunc(); - virtual double eval(CalendarAstronomer& a) { return a.getSunLongitude(); } + virtual double eval(CalendarAstronomer& a) override { return a.getSunLongitude(); } }; SunTimeAngleFunc::~SunTimeAngleFunc() {} @@ -743,7 +743,7 @@ CalendarAstronomer::CoordFunc::~CoordFunc() {} class RiseSetCoordFunc : public CalendarAstronomer::CoordFunc { public: virtual ~RiseSetCoordFunc(); - virtual void eval(CalendarAstronomer::Equatorial& result, CalendarAstronomer&a) { a.getSunPosition(result); } + virtual void eval(CalendarAstronomer::Equatorial& result, CalendarAstronomer& a) override { a.getSunPosition(result); } }; RiseSetCoordFunc::~RiseSetCoordFunc() {} @@ -1225,7 +1225,7 @@ const CalendarAstronomer::MoonAge CalendarAstronomer::FULL_MOON() { class MoonTimeAngleFunc : public CalendarAstronomer::AngleFunc { public: virtual ~MoonTimeAngleFunc(); - virtual double eval(CalendarAstronomer&a) { return a.getMoonAge(); } + virtual double eval(CalendarAstronomer& a) override { return a.getMoonAge(); } }; MoonTimeAngleFunc::~MoonTimeAngleFunc() {} @@ -1271,7 +1271,7 @@ UDate CalendarAstronomer::getMoonTime(const CalendarAstronomer::MoonAge& desired class MoonRiseSetCoordFunc : public CalendarAstronomer::CoordFunc { public: virtual ~MoonRiseSetCoordFunc(); - virtual void eval(CalendarAstronomer::Equatorial& result, CalendarAstronomer&a) { result = a.getMoonPosition(); } + virtual void eval(CalendarAstronomer::Equatorial& result, CalendarAstronomer& a) override { result = a.getMoonPosition(); } }; MoonRiseSetCoordFunc::~MoonRiseSetCoordFunc() {} diff --git a/icu4c/source/i18n/brktrans.h b/icu4c/source/i18n/brktrans.h index cb3def9e926..5dcc8c50c02 100644 --- a/icu4c/source/i18n/brktrans.h +++ b/icu4c/source/i18n/brktrans.h @@ -54,7 +54,7 @@ public: * Transliterator API. * @return A copy of the object. */ - virtual BreakTransliterator* clone() const; + virtual BreakTransliterator* clone() const override; virtual const UnicodeString &getInsertion() const; @@ -63,7 +63,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -82,7 +82,7 @@ public: * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; private: LocalPointer cachedBI; diff --git a/icu4c/source/i18n/buddhcal.h b/icu4c/source/i18n/buddhcal.h index 7fc686dcde2..2ef5c524935 100644 --- a/icu4c/source/i18n/buddhcal.h +++ b/icu4c/source/i18n/buddhcal.h @@ -94,7 +94,7 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual BuddhistCalendar* clone() const; + virtual BuddhistCalendar* clone() const override; public: /** @@ -107,7 +107,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -128,7 +128,7 @@ public: * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; private: BuddhistCalendar(); // default constructor not implemented @@ -142,13 +142,13 @@ private: * @return the extended year * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Subclasses may override this method to compute several fields * specific to each calendar system. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode& status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode& status) override; /** * Subclass API for defining limits of different types. * @param field one of the field numbers @@ -156,7 +156,7 @@ private: * LEAST_MAXIMUM, or MAXIMUM * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the Julian day number of day before the first day of the * given month in the given extended year. Subclasses should override @@ -171,26 +171,26 @@ private: * @internal */ virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, - UBool useMonth) const; + UBool useMonth) const override; /** * Returns true because the Buddhist Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/calendar.cpp b/icu4c/source/i18n/calendar.cpp index 0bf074e5c7c..8405d08d3cf 100644 --- a/icu4c/source/i18n/calendar.cpp +++ b/icu4c/source/i18n/calendar.cpp @@ -427,7 +427,7 @@ protected: // return isStandardSupportedKeyword(keyword, status); //} - virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const + virtual void updateVisibleIDs(Hashtable& result, UErrorCode& status) const override { if (U_SUCCESS(status)) { for(int32_t i=0;gCalTypes[i] != NULL;i++) { @@ -439,7 +439,7 @@ protected: } } - virtual UObject* create(const ICUServiceKey& key, const ICUService* /*service*/, UErrorCode& status) const { + virtual UObject* create(const ICUServiceKey& key, const ICUService* /*service*/, UErrorCode& status) const override { #ifdef U_DEBUG_CALSVC if(dynamic_cast(&key) == NULL) { fprintf(stderr, "::create - not a LocaleKey!\n"); @@ -485,7 +485,7 @@ public: DefaultCalendarFactory() : ICUResourceBundleFactory() { } virtual ~DefaultCalendarFactory(); protected: - virtual UObject* create(const ICUServiceKey& key, const ICUService* /*service*/, UErrorCode& status) const { + virtual UObject* create(const ICUServiceKey& key, const ICUService* /*service*/, UErrorCode& status) const override { LocaleKey &lkey = (LocaleKey&)key; Locale loc; @@ -517,7 +517,7 @@ public: virtual ~CalendarService(); - virtual UObject* cloneInstance(UObject* instance) const { + virtual UObject* cloneInstance(UObject* instance) const override { UnicodeString *s = dynamic_cast(instance); if(s != NULL) { return s->clone(); @@ -530,7 +530,7 @@ public: } } - virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const { + virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /*actualID*/, UErrorCode& status) const override { LocaleKey& lkey = (LocaleKey&)key; //int32_t kind = lkey.kind(); @@ -555,7 +555,7 @@ public: return nc; } - virtual UBool isDefault() const { + virtual UBool isDefault() const override { return countFactories() == 1; } }; diff --git a/icu4c/source/i18n/cecal.h b/icu4c/source/i18n/cecal.h index 80dab70f6ff..9ac71f6ba38 100644 --- a/icu4c/source/i18n/cecal.h +++ b/icu4c/source/i18n/cecal.h @@ -68,13 +68,13 @@ protected: * Return JD of start of given month/extended year * @internal */ - virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; + virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override; /** * Calculate the limit for a specified type of limit and field * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * (Overrides Calendar) Return true if the current date for this Calendar is in @@ -85,13 +85,13 @@ protected: * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode&) const; + virtual UBool inDaylightTime(UErrorCode&) const override; /** * Returns true because Coptic/Ethiopic Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; protected: /** diff --git a/icu4c/source/i18n/chnsecal.h b/icu4c/source/i18n/chnsecal.h index 910afd2f599..61ef2d3cad5 100644 --- a/icu4c/source/i18n/chnsecal.h +++ b/icu4c/source/i18n/chnsecal.h @@ -144,7 +144,7 @@ class U_I18N_API ChineseCalendar : public Calendar { virtual ~ChineseCalendar(); // clone - virtual ChineseCalendar* clone() const; + virtual ChineseCalendar* clone() const override; private: @@ -162,18 +162,18 @@ class U_I18N_API ChineseCalendar : public Calendar { //---------------------------------------------------------------------- protected: - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; - virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; - virtual int32_t handleGetExtendedYear(); - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); - virtual const UFieldResolutionTable* getFieldResolutionTable() const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; + virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override; + virtual int32_t handleGetExtendedYear() override; + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; + virtual const UFieldResolutionTable* getFieldResolutionTable() const override; public: - virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode &status); - virtual void add(EDateFields field, int32_t amount, UErrorCode &status); - virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode &status); - virtual void roll(EDateFields field, int32_t amount, UErrorCode &status); + virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode &status) override; + virtual void add(EDateFields field, int32_t amount, UErrorCode &status) override; + virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode &status) override; + virtual void roll(EDateFields field, int32_t amount, UErrorCode &status) override; //---------------------------------------------------------------------- // Internal methods & astronomical calculations @@ -204,7 +204,7 @@ class U_I18N_API ChineseCalendar : public Calendar { * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -225,7 +225,7 @@ class U_I18N_API ChineseCalendar : public Calendar { * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; protected: @@ -238,27 +238,27 @@ class U_I18N_API ChineseCalendar : public Calendar { * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; /** * Returns true because the Islamic Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; private: // default century stuff. diff --git a/icu4c/source/i18n/coleitr.cpp b/icu4c/source/i18n/coleitr.cpp index 9d4b1ad24f1..48c1da9015a 100644 --- a/icu4c/source/i18n/coleitr.cpp +++ b/icu4c/source/i18n/coleitr.cpp @@ -398,8 +398,8 @@ class MaxExpSink : public ContractionsAndExpansions::CESink { public: MaxExpSink(UHashtable *h, UErrorCode &ec) : maxExpansions(h), errorCode(ec) {} virtual ~MaxExpSink(); - virtual void handleCE(int64_t /*ce*/) {} - virtual void handleExpansion(const int64_t ces[], int32_t length) { + virtual void handleCE(int64_t /*ce*/) override {} + virtual void handleExpansion(const int64_t ces[], int32_t length) override { if (length <= 1) { // We do not need to add single CEs into the map. return; diff --git a/icu4c/source/i18n/coll.cpp b/icu4c/source/i18n/coll.cpp index 55f59ce6ecc..fe73118da03 100644 --- a/icu4c/source/i18n/coll.cpp +++ b/icu4c/source/i18n/coll.cpp @@ -129,7 +129,7 @@ class ICUCollatorFactory : public ICUResourceBundleFactory { ICUCollatorFactory() : ICUResourceBundleFactory(UnicodeString(U_ICUDATA_COLL, -1, US_INV)) { } virtual ~ICUCollatorFactory(); protected: - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const; + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override; }; ICUCollatorFactory::~ICUCollatorFactory() {} @@ -162,11 +162,11 @@ public: virtual ~ICUCollatorService(); - virtual UObject* cloneInstance(UObject* instance) const { + virtual UObject* cloneInstance(UObject* instance) const override { return ((Collator*)instance)->clone(); } - virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* actualID, UErrorCode& status) const { + virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* actualID, UErrorCode& status) const override { LocaleKey& lkey = (LocaleKey&)key; if (actualID) { // Ugly Hack Alert! We return an empty actualID to signal @@ -179,7 +179,7 @@ public: return Collator::makeInstance(loc, status); } - virtual UObject* getKey(ICUServiceKey& key, UnicodeString* actualReturn, UErrorCode& status) const { + virtual UObject* getKey(ICUServiceKey& key, UnicodeString* actualReturn, UErrorCode& status) const override { UnicodeString ar; if (actualReturn == NULL) { actualReturn = &ar; @@ -187,7 +187,7 @@ public: return (Collator*)ICULocaleService::getKey(key, actualReturn, status); } - virtual UBool isDefault() const { + virtual UBool isDefault() const override { return countFactories() == 1; } }; @@ -721,10 +721,10 @@ public: virtual ~CFactory(); - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const; + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override; protected: - virtual const Hashtable* getSupportedIDs(UErrorCode& status) const + virtual const Hashtable* getSupportedIDs(UErrorCode& status) const override { if (U_SUCCESS(status)) { return _ids; @@ -733,7 +733,7 @@ protected: } virtual UnicodeString& - getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const; + getDisplayName(const UnicodeString& id, const Locale& locale, UnicodeString& result) const override; }; CFactory::~CFactory() @@ -803,7 +803,7 @@ private: int32_t index; public: static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; public: CollationLocaleListEnumeration() : index(0) @@ -814,7 +814,7 @@ public: virtual ~CollationLocaleListEnumeration(); - virtual StringEnumeration * clone() const + virtual StringEnumeration * clone() const override { CollationLocaleListEnumeration *result = new CollationLocaleListEnumeration(); if (result) { @@ -823,11 +823,11 @@ public: return result; } - virtual int32_t count(UErrorCode &/*status*/) const { + virtual int32_t count(UErrorCode &/*status*/) const override { return availableLocaleListCount; } - virtual const char* next(int32_t* resultLength, UErrorCode& /*status*/) { + virtual const char* next(int32_t* resultLength, UErrorCode& /*status*/) override { const char* result; if(index < availableLocaleListCount) { result = availableLocaleList[index++].getName(); @@ -843,13 +843,13 @@ public: return result; } - virtual const UnicodeString* snext(UErrorCode& status) { + virtual const UnicodeString* snext(UErrorCode& status) override { int32_t resultLength = 0; const char *s = next(&resultLength, status); return setChars(s, resultLength, status); } - virtual void reset(UErrorCode& /*status*/) { + virtual void reset(UErrorCode& /*status*/) override { index = 0; } }; diff --git a/icu4c/source/i18n/collationbuilder.cpp b/icu4c/source/i18n/collationbuilder.cpp index b411b4f12f6..f5b29d1c372 100644 --- a/icu4c/source/i18n/collationbuilder.cpp +++ b/icu4c/source/i18n/collationbuilder.cpp @@ -59,7 +59,7 @@ public: virtual void getRules( const char *localeID, const char *collationType, UnicodeString &rules, - const char *&errorReason, UErrorCode &errorCode); + const char *&errorReason, UErrorCode &errorCode) override; }; BundleImporter::~BundleImporter() {} @@ -1581,7 +1581,7 @@ class CEFinalizer : public CollationDataBuilder::CEModifier { public: CEFinalizer(const int64_t *ces) : finalCEs(ces) {} virtual ~CEFinalizer(); - virtual int64_t modifyCE32(uint32_t ce32) const { + virtual int64_t modifyCE32(uint32_t ce32) const override { U_ASSERT(!Collation::isSpecialCE32(ce32)); if(CollationBuilder::isTempCE32(ce32)) { // retain case bits @@ -1590,7 +1590,7 @@ public: return Collation::NO_CE; } } - virtual int64_t modifyCE(int64_t ce) const { + virtual int64_t modifyCE(int64_t ce) const override { if(CollationBuilder::isTempCE(ce)) { // retain case bits return finalCEs[CollationBuilder::indexFromTempCE(ce)] | (ce & 0xc000); diff --git a/icu4c/source/i18n/collationbuilder.h b/icu4c/source/i18n/collationbuilder.h index 82f0459748f..59d3c5d24b0 100644 --- a/icu4c/source/i18n/collationbuilder.h +++ b/icu4c/source/i18n/collationbuilder.h @@ -57,7 +57,7 @@ private: /** Implements CollationRuleParser::Sink. */ virtual void addReset(int32_t strength, const UnicodeString &str, - const char *&errorReason, UErrorCode &errorCode); + const char *&errorReason, UErrorCode &errorCode) override; /** * Returns the secondary or tertiary weight preceding the current node's weight. * node=nodes[index]. @@ -70,7 +70,7 @@ private: /** Implements CollationRuleParser::Sink. */ virtual void addRelation(int32_t strength, const UnicodeString &prefix, const UnicodeString &str, const UnicodeString &extension, - const char *&errorReason, UErrorCode &errorCode); + const char *&errorReason, UErrorCode &errorCode) override; /** * Picks one of the current CEs and finds or inserts a node in the graph @@ -115,11 +115,11 @@ private: /** Implements CollationRuleParser::Sink. */ virtual void suppressContractions(const UnicodeSet &set, const char *&parserErrorReason, - UErrorCode &errorCode); + UErrorCode &errorCode) override; /** Implements CollationRuleParser::Sink. */ virtual void optimize(const UnicodeSet &set, const char *&parserErrorReason, - UErrorCode &errorCode); + UErrorCode &errorCode) override; /** * Adds the mapping and its canonical closure. diff --git a/icu4c/source/i18n/collationdatabuilder.cpp b/icu4c/source/i18n/collationdatabuilder.cpp index 1d42fbc94bd..a1f3225dfdd 100644 --- a/icu4c/source/i18n/collationdatabuilder.cpp +++ b/icu4c/source/i18n/collationdatabuilder.cpp @@ -131,18 +131,18 @@ public: int32_t fetchCEs(const UnicodeString &str, int32_t start, int64_t ces[], int32_t cesLength); - virtual void resetToOffset(int32_t newOffset); - virtual int32_t getOffset() const; + virtual void resetToOffset(int32_t newOffset) override; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual uint32_t getDataCE32(UChar32 c) const; - virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode); + virtual uint32_t getDataCE32(UChar32 c) const override; + virtual uint32_t getCE32FromBuilderData(uint32_t ce32, UErrorCode &errorCode) override; CollationDataBuilder &builder; CollationData builderData; diff --git a/icu4c/source/i18n/collationkeys.h b/icu4c/source/i18n/collationkeys.h index c526a4f14f2..5b41d14c0b6 100644 --- a/icu4c/source/i18n/collationkeys.h +++ b/icu4c/source/i18n/collationkeys.h @@ -38,7 +38,7 @@ public: void IgnoreBytes(int32_t numIgnore) { ignore_ = numIgnore; } - virtual void Append(const char *bytes, int32_t n); + virtual void Append(const char *bytes, int32_t n) override; void Append(uint32_t b) { if (ignore_ > 0) { --ignore_; @@ -52,7 +52,7 @@ public: virtual char *GetAppendBuffer(int32_t min_capacity, int32_t desired_capacity_hint, char *scratch, int32_t scratch_capacity, - int32_t *result_capacity); + int32_t *result_capacity) override; int32_t NumberOfBytesAppended() const { return appended_; } /** diff --git a/icu4c/source/i18n/coptccal.h b/icu4c/source/i18n/coptccal.h index e9e812dbc7f..5c51af04ca0 100644 --- a/icu4c/source/i18n/coptccal.h +++ b/icu4c/source/i18n/coptccal.h @@ -145,14 +145,14 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual CopticCalendar* clone() const; + virtual CopticCalendar* clone() const override; /** * return the calendar type, "coptic" * @return calendar type * @internal */ - const char * getType() const; + const char * getType() const override; protected: //------------------------------------------------------------------------- @@ -163,32 +163,32 @@ protected: * Return the extended year defined by the current fields. * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Compute fields from the JD * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; /** * Return the date offset from Julian * @internal */ - virtual int32_t getJDEpochOffset() const; + virtual int32_t getJDEpochOffset() const override; public: @@ -202,7 +202,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return diff --git a/icu4c/source/i18n/cpdtrans.h b/icu4c/source/i18n/cpdtrans.h index 5ed74fcdd12..af60cb827e3 100644 --- a/icu4c/source/i18n/cpdtrans.h +++ b/icu4c/source/i18n/cpdtrans.h @@ -98,7 +98,7 @@ public: /** * Transliterator API. */ - virtual CompoundTransliterator* clone() const; + virtual CompoundTransliterator* clone() const override; /** * Returns the number of transliterators in this chain. @@ -137,33 +137,33 @@ public: * U+000A, U+0020..U+007E. */ virtual UnicodeString& toRules(UnicodeString& result, - UBool escapeUnprintable) const; + UBool escapeUnprintable) const override; protected: /** * Implement Transliterator framework */ - virtual void handleGetSourceSet(UnicodeSet& result) const; + virtual void handleGetSourceSet(UnicodeSet& result) const override; public: /** * Override Transliterator framework */ - virtual UnicodeSet& getTargetSet(UnicodeSet& result) const; + virtual UnicodeSet& getTargetSet(UnicodeSet& result) const override; protected: /** * Implements {@link Transliterator#handleTransliterate}. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& idx, - UBool incremental) const; + UBool incremental) const override; public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/csr2022.h b/icu4c/source/i18n/csr2022.h index aa803ce9a4d..4418728f0ec 100644 --- a/icu4c/source/i18n/csr2022.h +++ b/icu4c/source/i18n/csr2022.h @@ -62,9 +62,9 @@ class CharsetRecog_2022JP :public CharsetRecog_2022 public: virtual ~CharsetRecog_2022JP(); - const char *getName() const; + const char *getName() const override; - UBool match(InputText *textIn, CharsetMatch *results) const; + UBool match(InputText *textIn, CharsetMatch *results) const override; }; #if !UCONFIG_ONLY_HTML_CONVERSION @@ -72,9 +72,9 @@ class CharsetRecog_2022KR :public CharsetRecog_2022 { public: virtual ~CharsetRecog_2022KR(); - const char *getName() const; + const char *getName() const override; - UBool match(InputText *textIn, CharsetMatch *results) const; + UBool match(InputText *textIn, CharsetMatch *results) const override; }; @@ -83,9 +83,9 @@ class CharsetRecog_2022CN :public CharsetRecog_2022 public: virtual ~CharsetRecog_2022CN(); - const char* getName() const; + const char* getName() const override; - UBool match(InputText *textIn, CharsetMatch *results) const; + UBool match(InputText *textIn, CharsetMatch *results) const override; }; #endif diff --git a/icu4c/source/i18n/csrsbcs.h b/icu4c/source/i18n/csrsbcs.h index 18908efe71e..96f982c59bd 100644 --- a/icu4c/source/i18n/csrsbcs.h +++ b/icu4c/source/i18n/csrsbcs.h @@ -63,8 +63,8 @@ public: private: int32_t alef; int32_t isLamAlef(int32_t b); - int32_t nextByte(InputText *det); - void parseCharacters(InputText *det); + int32_t nextByte(InputText *det) override; + void parseCharacters(InputText *det) override; }; #endif @@ -83,23 +83,23 @@ class CharsetRecog_8859_1 : public CharsetRecog_sbcs { public: virtual ~CharsetRecog_8859_1(); - const char *getName() const; - virtual UBool match(InputText *det, CharsetMatch *results) const; + const char *getName() const override; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_2 : public CharsetRecog_sbcs { public: virtual ~CharsetRecog_8859_2(); - const char *getName() const; - virtual UBool match(InputText *det, CharsetMatch *results) const; + const char *getName() const override; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_5 : public CharsetRecog_sbcs { public: virtual ~CharsetRecog_8859_5(); - const char *getName() const; + const char *getName() const override; }; class CharsetRecog_8859_6 : public CharsetRecog_sbcs @@ -107,7 +107,7 @@ class CharsetRecog_8859_6 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_8859_6(); - const char *getName() const; + const char *getName() const override; }; class CharsetRecog_8859_7 : public CharsetRecog_sbcs @@ -115,7 +115,7 @@ class CharsetRecog_8859_7 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_8859_7(); - const char *getName() const; + const char *getName() const override; }; class CharsetRecog_8859_8 : public CharsetRecog_sbcs @@ -123,7 +123,7 @@ class CharsetRecog_8859_8 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_8859_8(); - virtual const char *getName() const; + virtual const char *getName() const override; }; class CharsetRecog_8859_9 : public CharsetRecog_sbcs @@ -131,7 +131,7 @@ class CharsetRecog_8859_9 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_8859_9(); - const char *getName() const; + const char *getName() const override; }; @@ -141,9 +141,9 @@ class CharsetRecog_8859_5_ru : public CharsetRecog_8859_5 public: virtual ~CharsetRecog_8859_5_ru(); - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_6_ar : public CharsetRecog_8859_6 @@ -151,9 +151,9 @@ class CharsetRecog_8859_6_ar : public CharsetRecog_8859_6 public: virtual ~CharsetRecog_8859_6_ar(); - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_7_el : public CharsetRecog_8859_7 @@ -161,9 +161,9 @@ class CharsetRecog_8859_7_el : public CharsetRecog_8859_7 public: virtual ~CharsetRecog_8859_7_el(); - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_8_I_he : public CharsetRecog_8859_8 @@ -171,11 +171,11 @@ class CharsetRecog_8859_8_I_he : public CharsetRecog_8859_8 public: virtual ~CharsetRecog_8859_8_I_he(); - const char *getName() const; + const char *getName() const override; - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_8_he : public CharsetRecog_8859_8 @@ -183,9 +183,9 @@ class CharsetRecog_8859_8_he : public CharsetRecog_8859_8 public: virtual ~CharsetRecog_8859_8_he (); - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_8859_9_tr : public CharsetRecog_8859_9 @@ -193,9 +193,9 @@ class CharsetRecog_8859_9_tr : public CharsetRecog_8859_9 public: virtual ~CharsetRecog_8859_9_tr (); - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_windows_1256 : public CharsetRecog_sbcs @@ -203,11 +203,11 @@ class CharsetRecog_windows_1256 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_windows_1256(); - const char *getName() const; + const char *getName() const override; - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_windows_1251 : public CharsetRecog_sbcs @@ -215,11 +215,11 @@ class CharsetRecog_windows_1251 : public CharsetRecog_sbcs public: virtual ~CharsetRecog_windows_1251(); - const char *getName() const; + const char *getName() const override; - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; @@ -228,11 +228,11 @@ class CharsetRecog_KOI8_R : public CharsetRecog_sbcs public: virtual ~CharsetRecog_KOI8_R(); - const char *getName() const; + const char *getName() const override; - const char *getLanguage() const; + const char *getLanguage() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; #if !UCONFIG_ONLY_HTML_CONVERSION @@ -241,24 +241,24 @@ class CharsetRecog_IBM424_he : public CharsetRecog_sbcs public: virtual ~CharsetRecog_IBM424_he(); - const char *getLanguage() const; + const char *getLanguage() const override; }; class CharsetRecog_IBM424_he_rtl : public CharsetRecog_IBM424_he { public: virtual ~CharsetRecog_IBM424_he_rtl(); - const char *getName() const; + const char *getName() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_IBM424_he_ltr : public CharsetRecog_IBM424_he { virtual ~CharsetRecog_IBM424_he_ltr(); - const char *getName() const; + const char *getName() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_IBM420_ar : public CharsetRecog_sbcs @@ -266,8 +266,8 @@ class CharsetRecog_IBM420_ar : public CharsetRecog_sbcs public: virtual ~CharsetRecog_IBM420_ar(); - const char *getLanguage() const; - int32_t match_sbcs(InputText *det, const int32_t ngrams[], const uint8_t charMap[]) const; + const char *getLanguage() const override; + int32_t match_sbcs(InputText *det, const int32_t ngrams[], const uint8_t charMap[]) const override; }; @@ -275,17 +275,17 @@ class CharsetRecog_IBM420_ar_rtl : public CharsetRecog_IBM420_ar { public: virtual ~CharsetRecog_IBM420_ar_rtl(); - const char *getName() const; + const char *getName() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; class CharsetRecog_IBM420_ar_ltr : public CharsetRecog_IBM420_ar { virtual ~CharsetRecog_IBM420_ar_ltr(); - const char *getName() const; + const char *getName() const override; - virtual UBool match(InputText *det, CharsetMatch *results) const; + virtual UBool match(InputText *det, CharsetMatch *results) const override; }; #endif diff --git a/icu4c/source/i18n/csrutf8.h b/icu4c/source/i18n/csrutf8.h index 6089eb6f75c..bcfb38ac951 100644 --- a/icu4c/source/i18n/csrutf8.h +++ b/icu4c/source/i18n/csrutf8.h @@ -29,12 +29,12 @@ class CharsetRecog_UTF8: public CharsetRecognizer { virtual ~CharsetRecog_UTF8(); - const char *getName() const; + const char *getName() const override; /* (non-Javadoc) * @see com.ibm.icu.text.CharsetRecognizer#match(com.ibm.icu.text.CharsetDetector) */ - UBool match(InputText *input, CharsetMatch *results) const; + UBool match(InputText *input, CharsetMatch *results) const override; }; diff --git a/icu4c/source/i18n/currfmt.h b/icu4c/source/i18n/currfmt.h index 69a031957bc..2a75cae2bb3 100644 --- a/icu4c/source/i18n/currfmt.h +++ b/icu4c/source/i18n/currfmt.h @@ -57,7 +57,7 @@ class CurrencyFormat : public MeasureFormat { /** * Override Format API. */ - virtual CurrencyFormat* clone() const; + virtual CurrencyFormat* clone() const override; using MeasureFormat::format; @@ -68,19 +68,19 @@ class CurrencyFormat : public MeasureFormat { virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& ec) const; + UErrorCode& ec) const override; /** * Override Format API. */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& pos) const; + ParsePosition& pos) const override; /** * Override Format API. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * Returns the class ID for this class. diff --git a/icu4c/source/i18n/dangical.h b/icu4c/source/i18n/dangical.h index ece805e36d3..4d55a5b59ee 100644 --- a/icu4c/source/i18n/dangical.h +++ b/icu4c/source/i18n/dangical.h @@ -66,7 +66,7 @@ class DangiCalendar : public ChineseCalendar { * Clone. * @internal */ - virtual DangiCalendar* clone() const; + virtual DangiCalendar* clone() const override; //---------------------------------------------------------------------- // Internal methods & astronomical calculations @@ -83,7 +83,7 @@ class DangiCalendar : public ChineseCalendar { * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -104,7 +104,7 @@ class DangiCalendar : public ChineseCalendar { * @return calendar type * @internal */ - const char * getType() const; + const char * getType() const override; private: diff --git a/icu4c/source/i18n/datefmt.cpp b/icu4c/source/i18n/datefmt.cpp index 46d5f110a6b..fed8f79aa0f 100644 --- a/icu4c/source/i18n/datefmt.cpp +++ b/icu4c/source/i18n/datefmt.cpp @@ -69,7 +69,7 @@ class U_I18N_API DateFmtBestPatternKey : public LocaleCacheKey::equals(other)) { return false; } @@ -87,17 +87,17 @@ public: LocaleCacheKey(other), fSkeleton(other.fSkeleton) { } virtual ~DateFmtBestPatternKey(); - virtual int32_t hashCode() const { + virtual int32_t hashCode() const override { return (int32_t)(37u * (uint32_t)LocaleCacheKey::hashCode() + (uint32_t)fSkeleton.hashCode()); } inline bool operator==(const DateFmtBestPatternKey &other) const { return fSkeleton == other.fSkeleton; } - virtual CacheKeyBase *clone() const { + virtual CacheKeyBase *clone() const override { return new DateFmtBestPatternKey(*this); } virtual const DateFmtBestPattern *createObject( - const void * /*unused*/, UErrorCode &status) const { + const void * /*unused*/, UErrorCode &status) const override { LocalPointer dtpg( DateTimePatternGenerator::createInstance(fLoc, status)); if (U_FAILURE(status)) { diff --git a/icu4c/source/i18n/dayperiodrules.cpp b/icu4c/source/i18n/dayperiodrules.cpp index e364ecb708c..efe92dd794b 100644 --- a/icu4c/source/i18n/dayperiodrules.cpp +++ b/icu4c/source/i18n/dayperiodrules.cpp @@ -50,7 +50,7 @@ struct DayPeriodRulesDataSink : public ResourceSink { } virtual ~DayPeriodRulesDataSink(); - virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) { + virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) override { ResourceTable dayPeriodData = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } @@ -282,7 +282,7 @@ struct DayPeriodRulesDataSink : public ResourceSink { struct DayPeriodRulesCountSink : public ResourceSink { virtual ~DayPeriodRulesCountSink(); - virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) { + virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) override { ResourceTable rules = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } diff --git a/icu4c/source/i18n/dcfmtsym.cpp b/icu4c/source/i18n/dcfmtsym.cpp index 96be4388efe..4f5bae4e11e 100644 --- a/icu4c/source/i18n/dcfmtsym.cpp +++ b/icu4c/source/i18n/dcfmtsym.cpp @@ -232,7 +232,7 @@ struct DecFmtSymDataSink : public ResourceSink { virtual ~DecFmtSymDataSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { ResourceTable symbolsTable = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } for (int32_t j = 0; symbolsTable.getKeyAndValue(j, key, value); ++j) { @@ -287,7 +287,7 @@ struct CurrencySpacingSink : public ResourceSink { virtual ~CurrencySpacingSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { ResourceTable spacingTypesTable = value.getTable(errorCode); for (int32_t i = 0; spacingTypesTable.getKeyAndValue(i, key, value); ++i) { UBool beforeCurrency; diff --git a/icu4c/source/i18n/dtfmtsym.cpp b/icu4c/source/i18n/dtfmtsym.cpp index 501c9a19535..ab5f2b612c1 100644 --- a/icu4c/source/i18n/dtfmtsym.cpp +++ b/icu4c/source/i18n/dtfmtsym.cpp @@ -1545,7 +1545,7 @@ struct CalendarDataSink : public ResourceSink { aliasPathPairs.removeAllElements(); } - virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) { + virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) override { if (U_FAILURE(errorCode)) { return; } U_ASSERT(!currentCalendarType.isEmpty()); diff --git a/icu4c/source/i18n/dtitvinf.cpp b/icu4c/source/i18n/dtitvinf.cpp index 3a85658095c..cd3ef6a57b0 100644 --- a/icu4c/source/i18n/dtitvinf.cpp +++ b/icu4c/source/i18n/dtitvinf.cpp @@ -240,7 +240,7 @@ struct DateIntervalInfo::DateIntervalSink : public ResourceSink { : dateIntervalInfo(diInfo), nextCalendarType(currentCalendarType, -1, US_INV) { } virtual ~DateIntervalSink(); - virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &errorCode) { + virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &errorCode) override { if (U_FAILURE(errorCode)) { return; } // Iterate over all the calendar entries and only pick the 'intervalFormats' table. diff --git a/icu4c/source/i18n/dtptngen.cpp b/icu4c/source/i18n/dtptngen.cpp index a74add021cf..2acbca16eda 100644 --- a/icu4c/source/i18n/dtptngen.cpp +++ b/icu4c/source/i18n/dtptngen.cpp @@ -525,7 +525,7 @@ struct AllowedHourFormatsSink : public ResourceSink { virtual ~AllowedHourFormatsSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { ResourceTable timeData = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } for (int32_t i = 0; timeData.getKeyAndValue(i, key, value); ++i) { @@ -933,7 +933,7 @@ struct DateTimePatternGenerator::AppendItemFormatsSink : public ResourceSink { virtual ~AppendItemFormatsSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { UDateTimePatternField field = dtpg.getAppendFormatNumber(key); if (field == UDATPG_FIELD_COUNT) { return; } const UnicodeString& valueStr = value.getUnicodeString(errorCode); @@ -962,7 +962,7 @@ struct DateTimePatternGenerator::AppendItemNamesSink : public ResourceSink { virtual ~AppendItemNamesSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { UDateTimePGDisplayWidth width; UDateTimePatternField field = dtpg.getFieldAndWidthIndices(key, &width); if (field == UDATPG_FIELD_COUNT) { return; } @@ -1014,7 +1014,7 @@ struct DateTimePatternGenerator::AvailableFormatsSink : public ResourceSink { virtual ~AvailableFormatsSink(); virtual void put(const char *key, ResourceValue &value, UBool isRoot, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { const UnicodeString formatKey(key, -1, US_INV); if (!dtpg.isAvailableFormatSet(formatKey) ) { dtpg.setAvailableFormat(formatKey, errorCode); diff --git a/icu4c/source/i18n/dtptngen_impl.h b/icu4c/source/i18n/dtptngen_impl.h index 7692689c15b..5caae11654b 100644 --- a/icu4c/source/i18n/dtptngen_impl.h +++ b/icu4c/source/i18n/dtptngen_impl.h @@ -279,10 +279,10 @@ public: DTSkeletonEnumeration(PatternMap& patternMap, dtStrEnum type, UErrorCode& status); virtual ~DTSkeletonEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: int32_t pos; UBool isCanonicalItem(const UnicodeString& item); @@ -294,10 +294,10 @@ public: DTRedundantEnumeration(); virtual ~DTRedundantEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; void add(const UnicodeString &pattern, UErrorCode& status); private: int32_t pos; diff --git a/icu4c/source/i18n/esctrn.h b/icu4c/source/i18n/esctrn.h index 2a2c6dcfe9a..a4282ea86a2 100644 --- a/icu4c/source/i18n/esctrn.h +++ b/icu4c/source/i18n/esctrn.h @@ -115,12 +115,12 @@ class EscapeTransliterator : public Transliterator { /** * Transliterator API. */ - virtual EscapeTransliterator* clone() const; + virtual EscapeTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -133,7 +133,7 @@ class EscapeTransliterator : public Transliterator { * Implements {@link Transliterator#handleTransliterate}. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; }; diff --git a/icu4c/source/i18n/ethpccal.h b/icu4c/source/i18n/ethpccal.h index d1e8f424b57..0cc5b6c535e 100644 --- a/icu4c/source/i18n/ethpccal.h +++ b/icu4c/source/i18n/ethpccal.h @@ -141,14 +141,14 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual EthiopicCalendar* clone() const; + virtual EthiopicCalendar* clone() const override; /** * return the calendar type, "ethiopic" * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; /** * Set Alem or Mihret era. @@ -173,38 +173,38 @@ protected: * Return the extended year defined by the current fields. * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Compute fields from the JD * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; /** * Calculate the limit for a specified type of limit and field * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; /** * Return the date offset from Julian * @internal */ - virtual int32_t getJDEpochOffset() const; + virtual int32_t getJDEpochOffset() const override; private: /** @@ -229,7 +229,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return diff --git a/icu4c/source/i18n/funcrepl.h b/icu4c/source/i18n/funcrepl.h index fe41f6caaa6..529a10ebbf5 100644 --- a/icu4c/source/i18n/funcrepl.h +++ b/icu4c/source/i18n/funcrepl.h @@ -70,13 +70,13 @@ class FunctionReplacer : public UnicodeFunctor, public UnicodeReplacer { /** * Implement UnicodeFunctor */ - virtual FunctionReplacer* clone() const; + virtual FunctionReplacer* clone() const override; /** * UnicodeFunctor API. Cast 'this' to a UnicodeReplacer* pointer * and return the pointer. */ - virtual UnicodeReplacer* toReplacer() const; + virtual UnicodeReplacer* toReplacer() const override; /** * UnicodeReplacer API @@ -84,28 +84,28 @@ class FunctionReplacer : public UnicodeFunctor, public UnicodeReplacer { virtual int32_t replace(Replaceable& text, int32_t start, int32_t limit, - int32_t& cursor); + int32_t& cursor) override; /** * UnicodeReplacer API */ virtual UnicodeString& toReplacerPattern(UnicodeString& rule, - UBool escapeUnprintable) const; + UBool escapeUnprintable) const override; /** * Implement UnicodeReplacer */ - virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const; + virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const override; /** * UnicodeFunctor API */ - virtual void setData(const TransliterationRuleData*); + virtual void setData(const TransliterationRuleData*) override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/hebrwcal.h b/icu4c/source/i18n/hebrwcal.h index d27e6b879d6..ae4401832d4 100644 --- a/icu4c/source/i18n/hebrwcal.h +++ b/icu4c/source/i18n/hebrwcal.h @@ -192,7 +192,7 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual HebrewCalendar* clone() const; + virtual HebrewCalendar* clone() const override; public: /** @@ -205,7 +205,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -226,7 +226,7 @@ public: * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; // Calendar API @@ -242,11 +242,11 @@ public: * previously set in the time field is invalid, this will be set to * an error status. */ - virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode& status); + virtual void add(UCalendarDateFields field, int32_t amount, UErrorCode& status) override; /** * @deprecated ICU 2.6 use UCalendarDateFields instead of EDateFields */ - virtual void add(EDateFields field, int32_t amount, UErrorCode& status); + virtual void add(EDateFields field, int32_t amount, UErrorCode& status) override; /** @@ -260,7 +260,7 @@ public: * an error status. * @internal */ - virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status); + virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) override; /** * (Overrides Calendar) Rolls up or down by the given amount in the specified field. @@ -273,7 +273,7 @@ public: * an error status. * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. ` */ - virtual void roll(EDateFields field, int32_t amount, UErrorCode& status); + virtual void roll(EDateFields field, int32_t amount, UErrorCode& status) override; /** * @internal @@ -303,7 +303,7 @@ public: * LEAST_MAXIMUM, or MAXIMUM * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the number of days in the given month of the given extended @@ -312,7 +312,7 @@ public: * implementation than the default implementation in Calendar. * @internal */ - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; /** * Return the number of days in the given extended year of this @@ -321,7 +321,7 @@ public: * default implementation in Calendar. * @stable ICU 2.0 */ - virtual int32_t handleGetYearLength(int32_t eyear) const; + virtual int32_t handleGetYearLength(int32_t eyear) const override; /** * Subclasses may override this method to compute several fields * specific to each calendar system. These are: @@ -337,7 +337,7 @@ public: * a calendar with the specified Julian/Gregorian cutover date. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; /** * Return the extended year defined by the current fields. This will * use the UCAL_EXTENDED_YEAR field or the UCAL_YEAR and supra-year fields (such @@ -346,7 +346,7 @@ public: * @return the extended year * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Return the Julian day number of day before the first day of the * given month in the given extended year. Subclasses should override @@ -361,7 +361,7 @@ public: * @internal */ virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, - UBool useMonth) const; + UBool useMonth) const override; /** @@ -370,7 +370,7 @@ public: * special handling for month validation for Hebrew calendar. * @internal */ - virtual void validateField(UCalendarDateFields field, UErrorCode &status); + virtual void validateField(UCalendarDateFields field, UErrorCode &status) override; protected: @@ -383,26 +383,26 @@ public: * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; - /** - * Returns true because the Hebrew Calendar does have a default century - * @internal - */ - virtual UBool haveDefaultCentury() const; + /** + * Returns true because the Hebrew Calendar does have a default century + * @internal + */ + virtual UBool haveDefaultCentury() const override; - /** - * Returns the date of the start of the default century - * @return start of century - in milliseconds since epoch, 1970 - * @internal - */ - virtual UDate defaultCenturyStart() const; + /** + * Returns the date of the start of the default century + * @return start of century - in milliseconds since epoch, 1970 + * @internal + */ + virtual UDate defaultCenturyStart() const override; - /** - * Returns the year in which the default century begins - * @internal - */ - virtual int32_t defaultCenturyStartYear() const; + /** + * Returns the year in which the default century begins + * @internal + */ + virtual int32_t defaultCenturyStartYear() const override; private: // Calendar-specific implementation /** diff --git a/icu4c/source/i18n/indiancal.h b/icu4c/source/i18n/indiancal.h index 1ada0a47028..029515cf547 100644 --- a/icu4c/source/i18n/indiancal.h +++ b/icu4c/source/i18n/indiancal.h @@ -186,7 +186,7 @@ public: // TODO: copy c'tor, etc // clone - virtual IndianCalendar* clone() const; + virtual IndianCalendar* clone() const override; private: /** @@ -200,7 +200,7 @@ public: /** * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the length (in days) of the given month. @@ -209,13 +209,13 @@ public: * @param year The month(0-based) in Indian year * @internal */ - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; /** * Return the number of days in the given Indian year * @internal */ - virtual int32_t handleGetYearLength(int32_t extendedYear) const; + virtual int32_t handleGetYearLength(int32_t extendedYear) const override; //------------------------------------------------------------------------- // Functions for converting from field values to milliseconds.... @@ -225,7 +225,7 @@ public: /** * @internal */ - virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; + virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override; //------------------------------------------------------------------------- // Functions for converting from milliseconds to field values @@ -234,7 +234,7 @@ public: /** * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Override Calendar to compute several fields specific to the Indian @@ -252,7 +252,7 @@ public: * calendar equivalents for the given Julian day. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; // UObject stuff public: @@ -261,7 +261,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -282,7 +282,7 @@ public: * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; private: IndianCalendar(); // default constructor not implemented @@ -299,27 +299,27 @@ protected: * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; /** * Returns true because the Indian Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/islamcal.h b/icu4c/source/i18n/islamcal.h index 7a360e1076b..a29b7daa086 100644 --- a/icu4c/source/i18n/islamcal.h +++ b/icu4c/source/i18n/islamcal.h @@ -230,7 +230,7 @@ class U_I18N_API IslamicCalendar : public Calendar { // TODO: copy c'tor, etc // clone - virtual IslamicCalendar* clone() const; + virtual IslamicCalendar* clone() const override; private: /** @@ -292,7 +292,7 @@ class U_I18N_API IslamicCalendar : public Calendar { /** * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the length (in days) of the given month. @@ -301,13 +301,13 @@ class U_I18N_API IslamicCalendar : public Calendar { * @param year The hijri month, 0-based * @internal */ - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; /** * Return the number of days in the given Islamic year * @internal */ - virtual int32_t handleGetYearLength(int32_t extendedYear) const; + virtual int32_t handleGetYearLength(int32_t extendedYear) const override; //------------------------------------------------------------------------- // Functions for converting from field values to milliseconds.... @@ -317,7 +317,7 @@ class U_I18N_API IslamicCalendar : public Calendar { /** * @internal */ - virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; + virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override; //------------------------------------------------------------------------- // Functions for converting from milliseconds to field values @@ -326,7 +326,7 @@ class U_I18N_API IslamicCalendar : public Calendar { /** * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Override Calendar to compute several fields specific to the Islamic @@ -344,7 +344,7 @@ class U_I18N_API IslamicCalendar : public Calendar { * calendar equivalents for the given Julian day. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; // UObject stuff public: @@ -353,7 +353,7 @@ class U_I18N_API IslamicCalendar : public Calendar { * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -374,7 +374,7 @@ class U_I18N_API IslamicCalendar : public Calendar { * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; private: IslamicCalendar(); // default constructor not implemented @@ -391,27 +391,27 @@ class U_I18N_API IslamicCalendar : public Calendar { * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; /** * Returns true because the Islamic Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; private: /** diff --git a/icu4c/source/i18n/japancal.h b/icu4c/source/i18n/japancal.h index e5b95d732c0..88513440528 100644 --- a/icu4c/source/i18n/japancal.h +++ b/icu4c/source/i18n/japancal.h @@ -116,20 +116,20 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual JapaneseCalendar* clone() const; + virtual JapaneseCalendar* clone() const override; /** * Return the extended year defined by the current fields. In the * Japanese calendar case, this is equal to the equivalent extended Gregorian year. * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Return the maximum value that this field could have, given the current date. * @internal */ - virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const; + virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const override; public: @@ -143,7 +143,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -164,24 +164,24 @@ public: * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; /** * @return false - no default century in Japanese * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Not used - no default century. * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Not used - no default century. * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; private: JapaneseCalendar(); // default constructor not implemented @@ -191,19 +191,19 @@ protected: * Calculate the era for internal computation * @internal */ - virtual int32_t internalGetEra() const; + virtual int32_t internalGetEra() const override; /** * Compute fields from the JD * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode& status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode& status) override; /** * Calculate the limit for a specified type of limit and field * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /*** * Called by computeJulianDay. Returns the default month (0-based) for the year, @@ -212,7 +212,7 @@ protected: * @param eyear the extended year * @internal */ - virtual int32_t getDefaultMonthInYear(int32_t eyear); + virtual int32_t getDefaultMonthInYear(int32_t eyear) override; /*** * Called by computeJulianDay. Returns the default day (1-based) for the month, @@ -222,7 +222,7 @@ protected: * @param mon the month in the year * @internal */ - virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month); + virtual int32_t getDefaultDayInMonth(int32_t eyear, int32_t month) override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/listformatter.cpp b/icu4c/source/i18n/listformatter.cpp index e5c01c0ab32..4142fa461da 100644 --- a/icu4c/source/i18n/listformatter.cpp +++ b/icu4c/source/i18n/listformatter.cpp @@ -444,7 +444,7 @@ struct ListFormatter::ListPatternsSink : public ResourceSink { } virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { aliasedStyle[0] = 0; if (value.getType() == URES_ALIAS) { setAliasedStyle(value.getAliasUnicodeString(errorCode)); diff --git a/icu4c/source/i18n/measunit_extra.cpp b/icu4c/source/i18n/measunit_extra.cpp index 6c82ffbc8e0..e543c745681 100644 --- a/icu4c/source/i18n/measunit_extra.cpp +++ b/icu4c/source/i18n/measunit_extra.cpp @@ -187,7 +187,7 @@ class SimpleUnitIdentifiersSink : public icu::ResourceSink { * @param noFallback Ignored. * @param status The standard ICU error code output parameter. */ - void put(const char * /*key*/, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) { + void put(const char * /*key*/, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) override { ResourceTable table = value.getTable(status); if (U_FAILURE(status)) return; @@ -275,7 +275,7 @@ class CategoriesSink : public icu::ResourceSink { explicit CategoriesSink(const UChar **out, int32_t &outSize, BytesTrieBuilder &trieBuilder) : outQuantitiesArray(out), outSize(outSize), trieBuilder(trieBuilder), outIndex(0) {} - void put(const char * /*key*/, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) { + void put(const char * /*key*/, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) override { ResourceArray array = value.getArray(status); if (U_FAILURE(status)) { return; diff --git a/icu4c/source/i18n/msgfmt_impl.h b/icu4c/source/i18n/msgfmt_impl.h index 1cece1a0943..57988389132 100644 --- a/icu4c/source/i18n/msgfmt_impl.h +++ b/icu4c/source/i18n/msgfmt_impl.h @@ -29,10 +29,10 @@ public: FormatNameEnumeration(UVector *fFormatNames, UErrorCode& status); virtual ~FormatNameEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: int32_t pos; UVector *fFormatNames; diff --git a/icu4c/source/i18n/name2uni.h b/icu4c/source/i18n/name2uni.h index 44ad85fb822..6881c6bc857 100644 --- a/icu4c/source/i18n/name2uni.h +++ b/icu4c/source/i18n/name2uni.h @@ -49,12 +49,12 @@ public: * Transliterator API. * @return A copy of the object. */ - virtual NameUnicodeTransliterator* clone() const; + virtual NameUnicodeTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -73,7 +73,7 @@ public: * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; /** * Set of characters which occur in Unicode character names. diff --git a/icu4c/source/i18n/nfsubs.cpp b/icu4c/source/i18n/nfsubs.cpp index a40a27694d7..70ac18be468 100644 --- a/icu4c/source/i18n/nfsubs.cpp +++ b/icu4c/source/i18n/nfsubs.cpp @@ -58,15 +58,15 @@ public: UErrorCode& status); virtual ~SameValueSubstitution(); - virtual int64_t transformNumber(int64_t number) const { return number; } - virtual double transformNumber(double number) const { return number; } - virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const { return newRuleValue; } - virtual double calcUpperBound(double oldUpperBound) const { return oldUpperBound; } - virtual UChar tokenChar() const { return (UChar)0x003d; } // '=' + virtual int64_t transformNumber(int64_t number) const override { return number; } + virtual double transformNumber(double number) const override { return number; } + virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const override { return newRuleValue; } + virtual double calcUpperBound(double oldUpperBound) const override { return oldUpperBound; } + virtual UChar tokenChar() const override { return (UChar)0x003d; } // '=' public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; SameValueSubstitution::~SameValueSubstitution() {} @@ -88,7 +88,7 @@ public: } virtual ~MultiplierSubstitution(); - virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) { + virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) override { divisor = util64_pow(radix, exponent); if(divisor == 0) { @@ -96,13 +96,13 @@ public: } } - virtual bool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const override; - virtual int64_t transformNumber(int64_t number) const { + virtual int64_t transformNumber(int64_t number) const override { return number / divisor; } - virtual double transformNumber(double number) const { + virtual double transformNumber(double number) const override { if (getRuleSet()) { return uprv_floor(number / divisor); } else { @@ -110,17 +110,17 @@ public: } } - virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const { + virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const override { return newRuleValue * divisor; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return static_cast(divisor); } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return static_cast(divisor); } - virtual UChar tokenChar() const { return (UChar)0x003c; } // '<' + virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<' public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; MultiplierSubstitution::~MultiplierSubstitution() {} @@ -137,7 +137,7 @@ public: UErrorCode& status); virtual ~ModulusSubstitution(); - virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) { + virtual void setDivisor(int32_t radix, int16_t exponent, UErrorCode& status) override { divisor = util64_pow(radix, exponent); if (divisor == 0) { @@ -145,13 +145,13 @@ public: } } - virtual bool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const override; - virtual void doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; - virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; + virtual void doSubstitution(int64_t number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const override; + virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const override; - virtual int64_t transformNumber(int64_t number) const { return number % divisor; } - virtual double transformNumber(double number) const { return uprv_fmod(number, static_cast(divisor)); } + virtual int64_t transformNumber(int64_t number) const override { return number % divisor; } + virtual double transformNumber(double number) const override { return uprv_fmod(number, static_cast(divisor)); } virtual UBool doParse(const UnicodeString& text, ParsePosition& parsePosition, @@ -159,23 +159,23 @@ public: double upperBound, UBool lenientParse, uint32_t nonNumericalExecutedRuleMask, - Formattable& result) const; + Formattable& result) const override; - virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { + virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return oldRuleValue - uprv_fmod(oldRuleValue, static_cast(divisor)) + newRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return static_cast(divisor); } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return static_cast(divisor); } - virtual UBool isModulusSubstitution() const { return TRUE; } + virtual UBool isModulusSubstitution() const override { return TRUE; } - virtual UChar tokenChar() const { return (UChar)0x003e; } // '>' + virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>' - virtual void toString(UnicodeString& result) const; + virtual void toString(UnicodeString& result) const override; public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; ModulusSubstitution::~ModulusSubstitution() {} @@ -189,15 +189,15 @@ public: : NFSubstitution(_pos, _ruleSet, description, status) {} virtual ~IntegralPartSubstitution(); - virtual int64_t transformNumber(int64_t number) const { return number; } - virtual double transformNumber(double number) const { return uprv_floor(number); } - virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { return newRuleValue + oldRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return DBL_MAX; } - virtual UChar tokenChar() const { return (UChar)0x003c; } // '<' + virtual int64_t transformNumber(int64_t number) const override { return number; } + virtual double transformNumber(double number) const override { return uprv_floor(number); } + virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue + oldRuleValue; } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return DBL_MAX; } + virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<' public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; IntegralPartSubstitution::~IntegralPartSubstitution() {} @@ -213,12 +213,12 @@ public: UErrorCode& status); virtual ~FractionalPartSubstitution(); - virtual bool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const override; - virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; - virtual void doSubstitution(int64_t /*number*/, UnicodeString& /*toInsertInto*/, int32_t /*_pos*/, int32_t /*recursionCount*/, UErrorCode& /*status*/) const {} - virtual int64_t transformNumber(int64_t /*number*/) const { return 0; } - virtual double transformNumber(double number) const { return number - uprv_floor(number); } + virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const override; + virtual void doSubstitution(int64_t /*number*/, UnicodeString& /*toInsertInto*/, int32_t /*_pos*/, int32_t /*recursionCount*/, UErrorCode& /*status*/) const override {} + virtual int64_t transformNumber(int64_t /*number*/) const override { return 0; } + virtual double transformNumber(double number) const override { return number - uprv_floor(number); } virtual UBool doParse(const UnicodeString& text, ParsePosition& parsePosition, @@ -226,15 +226,15 @@ public: double upperBound, UBool lenientParse, uint32_t nonNumericalExecutedRuleMask, - Formattable& result) const; + Formattable& result) const override; - virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { return newRuleValue + oldRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return 0.0; } - virtual UChar tokenChar() const { return (UChar)0x003e; } // '>' + virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue + oldRuleValue; } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return 0.0; } + virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>' public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; FractionalPartSubstitution::~FractionalPartSubstitution() {} @@ -248,15 +248,15 @@ public: : NFSubstitution(_pos, _ruleSet, description, status) {} virtual ~AbsoluteValueSubstitution(); - virtual int64_t transformNumber(int64_t number) const { return number >= 0 ? number : -number; } - virtual double transformNumber(double number) const { return uprv_fabs(number); } - virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const { return -newRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return DBL_MAX; } - virtual UChar tokenChar() const { return (UChar)0x003e; } // '>' + virtual int64_t transformNumber(int64_t number) const override { return number >= 0 ? number : -number; } + virtual double transformNumber(double number) const override { return uprv_fabs(number); } + virtual double composeRuleValue(double newRuleValue, double /*oldRuleValue*/) const override { return -newRuleValue; } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return DBL_MAX; } + virtual UChar tokenChar() const override { return (UChar)0x003e; } // '>' public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; AbsoluteValueSubstitution::~AbsoluteValueSubstitution() {} @@ -285,30 +285,30 @@ public: } virtual ~NumeratorSubstitution(); - virtual bool operator==(const NFSubstitution& rhs) const; + virtual bool operator==(const NFSubstitution& rhs) const override; - virtual int64_t transformNumber(int64_t number) const { return number * ldenominator; } - virtual double transformNumber(double number) const { return uprv_round(number * denominator); } + virtual int64_t transformNumber(int64_t number) const override { return number * ldenominator; } + virtual double transformNumber(double number) const override { return uprv_round(number * denominator); } - virtual void doSubstitution(int64_t /*number*/, UnicodeString& /*toInsertInto*/, int32_t /*_pos*/, int32_t /*recursionCount*/, UErrorCode& /*status*/) const {} - virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const; + virtual void doSubstitution(int64_t /*number*/, UnicodeString& /*toInsertInto*/, int32_t /*_pos*/, int32_t /*recursionCount*/, UErrorCode& /*status*/) const override {} + virtual void doSubstitution(double number, UnicodeString& toInsertInto, int32_t pos, int32_t recursionCount, UErrorCode& status) const override; virtual UBool doParse(const UnicodeString& text, ParsePosition& parsePosition, double baseValue, double upperBound, UBool /*lenientParse*/, uint32_t nonNumericalExecutedRuleMask, - Formattable& result) const; + Formattable& result) const override; - virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const { return newRuleValue / oldRuleValue; } - virtual double calcUpperBound(double /*oldUpperBound*/) const { return denominator; } - virtual UChar tokenChar() const { return (UChar)0x003c; } // '<' + virtual double composeRuleValue(double newRuleValue, double oldRuleValue) const override { return newRuleValue / oldRuleValue; } + virtual double calcUpperBound(double /*oldUpperBound*/) const override { return denominator; } + virtual UChar tokenChar() const override { return (UChar)0x003c; } // '<' private: static const UChar LTLT[2]; public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; NumeratorSubstitution::~NumeratorSubstitution() {} diff --git a/icu4c/source/i18n/nfsubs.h b/icu4c/source/i18n/nfsubs.h index 49eb0a07042..0abd98be097 100644 --- a/icu4c/source/i18n/nfsubs.h +++ b/icu4c/source/i18n/nfsubs.h @@ -250,7 +250,7 @@ private: public: static UClassID getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/nortrans.h b/icu4c/source/i18n/nortrans.h index 198ed29c95e..01cb97ab38b 100644 --- a/icu4c/source/i18n/nortrans.h +++ b/icu4c/source/i18n/nortrans.h @@ -44,12 +44,12 @@ class NormalizationTransliterator : public Transliterator { * Transliterator API. * @return A copy of the object. */ - virtual NormalizationTransliterator* clone() const; + virtual NormalizationTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -68,7 +68,7 @@ class NormalizationTransliterator : public Transliterator { * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; public: /** diff --git a/icu4c/source/i18n/nultrans.h b/icu4c/source/i18n/nultrans.h index 36c92fa7b18..f5f2fbc9117 100644 --- a/icu4c/source/i18n/nultrans.h +++ b/icu4c/source/i18n/nultrans.h @@ -45,19 +45,19 @@ public: * Transliterator API. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ - virtual NullTransliterator* clone() const; + virtual NullTransliterator* clone() const override; /** * Implements {@link Transliterator#handleTransliterate}. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/numfmt.cpp b/icu4c/source/i18n/numfmt.cpp index bbc9c78b408..b8ce1c930f9 100644 --- a/icu4c/source/i18n/numfmt.cpp +++ b/icu4c/source/i18n/numfmt.cpp @@ -860,7 +860,7 @@ class ICUNumberFormatFactory : public ICUResourceBundleFactory { public: virtual ~ICUNumberFormatFactory(); protected: - virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /* service */, UErrorCode& status) const { + virtual UObject* handleCreate(const Locale& loc, int32_t kind, const ICUService* /* service */, UErrorCode& status) const override { return NumberFormat::makeInstance(loc, (UNumberFormatStyle)kind, status); } }; @@ -884,7 +884,7 @@ public: virtual ~NFFactory(); - virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const + virtual UObject* create(const ICUServiceKey& key, const ICUService* service, UErrorCode& status) const override { if (handlesKey(key, status)) { const LocaleKey& lkey = (const LocaleKey&)key; @@ -907,7 +907,7 @@ protected: * otherwise). This can be called often and might need to be * cached if it is expensive to create. */ - virtual const Hashtable* getSupportedIDs(UErrorCode& status) const + virtual const Hashtable* getSupportedIDs(UErrorCode& status) const override { if (U_SUCCESS(status)) { if (!_ids) { @@ -943,11 +943,11 @@ public: virtual ~ICUNumberFormatService(); - virtual UObject* cloneInstance(UObject* instance) const { + virtual UObject* cloneInstance(UObject* instance) const override { return ((NumberFormat*)instance)->clone(); } - virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /* actualID */, UErrorCode& status) const { + virtual UObject* handleDefault(const ICUServiceKey& key, UnicodeString* /* actualID */, UErrorCode& status) const override { LocaleKey& lkey = (LocaleKey&)key; int32_t kind = lkey.kind(); Locale loc; @@ -955,7 +955,7 @@ public: return NumberFormat::makeInstance(loc, (UNumberFormatStyle)kind, status); } - virtual UBool isDefault() const { + virtual UBool isDefault() const override { return countFactories() == 1; } }; diff --git a/icu4c/source/i18n/olsontz.h b/icu4c/source/i18n/olsontz.h index 207fa8144f7..75d86781edd 100644 --- a/icu4c/source/i18n/olsontz.h +++ b/icu4c/source/i18n/olsontz.h @@ -146,12 +146,12 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { /** * Returns true if the two TimeZone objects are equal. */ - virtual bool operator==(const TimeZone& other) const; + virtual bool operator==(const TimeZone& other) const override; /** * TimeZone API. */ - virtual OlsonTimeZone* clone() const; + virtual OlsonTimeZone* clone() const override; /** * TimeZone API. @@ -161,14 +161,14 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { /** * TimeZone API. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * TimeZone API. Do not call this; prefer getOffset(UDate,...). */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, - int32_t millis, UErrorCode& ec) const; + int32_t millis, UErrorCode& ec) const override; /** * TimeZone API. Do not call this; prefer getOffset(UDate,...). @@ -176,13 +176,13 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, int32_t monthLength, - UErrorCode& ec) const; + UErrorCode& ec) const override; /** * TimeZone API. */ virtual void getOffset(UDate date, UBool local, int32_t& rawOffset, - int32_t& dstOffset, UErrorCode& ec) const; + int32_t& dstOffset, UErrorCode& ec) const override; /** * BasicTimeZone API. @@ -190,14 +190,14 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { virtual void getOffsetFromLocal( UDate date, UTimeZoneLocalOption nonExistingTimeOpt, UTimeZoneLocalOption duplicatedTimeOpt, - int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const; + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const override; /** * TimeZone API. This method has no effect since objects of this * class are quasi-immutable (the base class allows the ID to be * changed). */ - virtual void setRawOffset(int32_t offsetMillis); + virtual void setRawOffset(int32_t offsetMillis) override; /** * TimeZone API. For a historical zone, the raw offset can change @@ -205,7 +205,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * expected behavior, this method returns the raw offset for the * current moment in time. */ - virtual int32_t getRawOffset() const; + virtual int32_t getRawOffset() const override; /** * TimeZone API. For a historical zone, whether DST is used or @@ -213,22 +213,22 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * behavior, this method returns true if DST is observed at any * point in the current year. */ - virtual UBool useDaylightTime() const; + virtual UBool useDaylightTime() const override; /** * TimeZone API. */ - virtual UBool inDaylightTime(UDate date, UErrorCode& ec) const; + virtual UBool inDaylightTime(UDate date, UErrorCode& ec) const override; /** * TimeZone API. */ - virtual int32_t getDSTSavings() const; + virtual int32_t getDSTSavings() const override; /** * TimeZone API. Also comare historic transitions. */ - virtual UBool hasSameRules(const TimeZone& other) const; + virtual UBool hasSameRules(const TimeZone& other) const override; /** * BasicTimeZone API. @@ -238,7 +238,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * @param result Receives the first transition after the base time. * @return true if the transition is found. */ - virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * BasicTimeZone API. @@ -248,7 +248,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * @param result Receives the most recent transition before the base time. * @return true if the transition is found. */ - virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * BasicTimeZone API. @@ -258,7 +258,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * @param status Receives error status code. * @return The number of TimeZoneRules representing time transitions. */ - virtual int32_t countTransitionRules(UErrorCode& status) const; + virtual int32_t countTransitionRules(UErrorCode& status) const override; /** * Gets the InitialTimeZoneRule and the set of TimeZoneRule @@ -276,7 +276,7 @@ class U_I18N_API OlsonTimeZone: public BasicTimeZone { * @param status Receives error status code. */ virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, - const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const; + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const override; /** * Internal API returning the canonical ID of this zone. diff --git a/icu4c/source/i18n/persncal.h b/icu4c/source/i18n/persncal.h index c9eff1c3058..d0f2ee5ec20 100644 --- a/icu4c/source/i18n/persncal.h +++ b/icu4c/source/i18n/persncal.h @@ -164,7 +164,7 @@ class PersianCalendar : public Calendar { // TODO: copy c'tor, etc // clone - virtual PersianCalendar* clone() const; + virtual PersianCalendar* clone() const override; private: /** @@ -194,7 +194,7 @@ class PersianCalendar : public Calendar { /** * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the length (in days) of the given month. @@ -203,13 +203,13 @@ class PersianCalendar : public Calendar { * @param year The hijri shamsi month, 0-based * @internal */ - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; /** * Return the number of days in the given Persian year * @internal */ - virtual int32_t handleGetYearLength(int32_t extendedYear) const; + virtual int32_t handleGetYearLength(int32_t extendedYear) const override; //------------------------------------------------------------------------- // Functions for converting from field values to milliseconds.... @@ -219,7 +219,7 @@ class PersianCalendar : public Calendar { /** * @internal */ - virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const; + virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, UBool useMonth) const override; //------------------------------------------------------------------------- // Functions for converting from milliseconds to field values @@ -228,7 +228,7 @@ class PersianCalendar : public Calendar { /** * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Override Calendar to compute several fields specific to the Persian @@ -246,7 +246,7 @@ class PersianCalendar : public Calendar { * calendar equivalents for the given Julian day. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; // UObject stuff public: @@ -255,7 +255,7 @@ class PersianCalendar : public Calendar { * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -276,7 +276,7 @@ class PersianCalendar : public Calendar { * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; private: PersianCalendar(); // default constructor not implemented @@ -292,26 +292,26 @@ class PersianCalendar : public Calendar { * false, otherwise. * @internal */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; /** * Returns true because the Persian Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/plurrule_impl.h b/icu4c/source/i18n/plurrule_impl.h index 5668e42be9a..1a30096f2f4 100644 --- a/icu4c/source/i18n/plurrule_impl.h +++ b/icu4c/source/i18n/plurrule_impl.h @@ -408,10 +408,10 @@ public: PluralKeywordEnumeration(RuleChain *header, UErrorCode& status); virtual ~PluralKeywordEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: int32_t pos; UVector fKeywordNames; @@ -422,9 +422,9 @@ class U_I18N_API PluralAvailableLocalesEnumeration: public StringEnumeration { public: PluralAvailableLocalesEnumeration(UErrorCode &status); virtual ~PluralAvailableLocalesEnumeration(); - virtual const char* next(int32_t *resultLength, UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual const char* next(int32_t *resultLength, UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: UErrorCode fOpenStatus; UResourceBundle *fLocales = nullptr; diff --git a/icu4c/source/i18n/quant.h b/icu4c/source/i18n/quant.h index df6924cc127..427a6b04808 100644 --- a/icu4c/source/i18n/quant.h +++ b/icu4c/source/i18n/quant.h @@ -39,13 +39,13 @@ class Quantifier : public UnicodeFunctor, public UnicodeMatcher { * and return the pointer. * @return the UnicodeMatcher pointer. */ - virtual UnicodeMatcher* toMatcher() const; + virtual UnicodeMatcher* toMatcher() const override; /** * Implement UnicodeFunctor * @return a copy of the object. */ - virtual Quantifier* clone() const; + virtual Quantifier* clone() const override; /** * Implement UnicodeMatcher @@ -72,7 +72,7 @@ class Quantifier : public UnicodeFunctor, public UnicodeMatcher { virtual UMatchDegree matches(const Replaceable& text, int32_t& offset, int32_t limit, - UBool incremental); + UBool incremental) override; /** * Implement UnicodeMatcher @@ -81,29 +81,29 @@ class Quantifier : public UnicodeFunctor, public UnicodeMatcher { * @return A reference to 'result'. */ virtual UnicodeString& toPattern(UnicodeString& result, - UBool escapeUnprintable = false) const; + UBool escapeUnprintable = false) const override; /** * Implement UnicodeMatcher * @param v the given index value. * @return true if this rule matches the given index value. */ - virtual UBool matchesIndexValue(uint8_t v) const; + virtual UBool matchesIndexValue(uint8_t v) const override; /** * Implement UnicodeMatcher */ - virtual void addMatchSetTo(UnicodeSet& toUnionTo) const; + virtual void addMatchSetTo(UnicodeSet& toUnionTo) const override; /** * UnicodeFunctor API */ - virtual void setData(const TransliterationRuleData*); + virtual void setData(const TransliterationRuleData*) override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/rbnf.cpp b/icu4c/source/i18n/rbnf.cpp index 4d5ca403f20..7f54fd7a33f 100644 --- a/icu4c/source/i18n/rbnf.cpp +++ b/icu4c/source/i18n/rbnf.cpp @@ -271,11 +271,11 @@ public: static StringLocalizationInfo* create(const UnicodeString& info, UParseError& perror, UErrorCode& status); virtual ~StringLocalizationInfo(); - virtual int32_t getNumberOfRuleSets(void) const { return numRuleSets; } - virtual const UChar* getRuleSetName(int32_t index) const; - virtual int32_t getNumberOfDisplayLocales(void) const { return numLocales; } - virtual const UChar* getLocaleName(int32_t index) const; - virtual const UChar* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const; + virtual int32_t getNumberOfRuleSets(void) const override { return numRuleSets; } + virtual const UChar* getRuleSetName(int32_t index) const override; + virtual int32_t getNumberOfDisplayLocales(void) const override { return numLocales; } + virtual const UChar* getLocaleName(int32_t index) const override; + virtual const UChar* getDisplayName(int32_t localeIndex, int32_t ruleIndex) const override; // virtual UClassID getDynamicClassID() const; // static UClassID getStaticClassID(void); diff --git a/icu4c/source/i18n/rbt.h b/icu4c/source/i18n/rbt.h index 671b41e1a39..8a43c90d462 100644 --- a/icu4c/source/i18n/rbt.h +++ b/icu4c/source/i18n/rbt.h @@ -144,7 +144,7 @@ public: * Implement Transliterator API. * @internal Use transliterator factory methods instead since this class will be removed in that release. */ - virtual RuleBasedTransliterator* clone() const; + virtual RuleBasedTransliterator* clone() const override; protected: /** @@ -152,7 +152,7 @@ protected: * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offsets, - UBool isIncremental) const; + UBool isIncremental) const override; public: /** @@ -168,19 +168,19 @@ public: * @internal Use transliterator factory methods instead since this class will be removed in that release. */ virtual UnicodeString& toRules(UnicodeString& result, - UBool escapeUnprintable) const; + UBool escapeUnprintable) const override; protected: /** * Implement Transliterator framework */ - virtual void handleGetSourceSet(UnicodeSet& result) const; + virtual void handleGetSourceSet(UnicodeSet& result) const override; public: /** * Override Transliterator framework */ - virtual UnicodeSet& getTargetSet(UnicodeSet& result) const; + virtual UnicodeSet& getTargetSet(UnicodeSet& result) const override; /** * Return the class ID for this class. This is useful only for @@ -205,7 +205,7 @@ public: * class have the same class ID. Objects of other classes have * different class IDs. */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; private: diff --git a/icu4c/source/i18n/rbt_pars.cpp b/icu4c/source/i18n/rbt_pars.cpp index 44e96c659a0..2f207a8deb0 100644 --- a/icu4c/source/i18n/rbt_pars.cpp +++ b/icu4c/source/i18n/rbt_pars.cpp @@ -148,12 +148,12 @@ public: virtual ~ParseData(); - virtual const UnicodeString* lookup(const UnicodeString& s) const; + virtual const UnicodeString* lookup(const UnicodeString& s) const override; - virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const; + virtual const UnicodeFunctor* lookupMatcher(UChar32 ch) const override; virtual UnicodeString parseReference(const UnicodeString& text, - ParsePosition& pos, int32_t limit) const; + ParsePosition& pos, int32_t limit) const override; /** * Return true if the given character is a matcher standin or a plain * character (non standin). diff --git a/icu4c/source/i18n/region_impl.h b/icu4c/source/i18n/region_impl.h index 5e5a64529ad..62acaa4511b 100644 --- a/icu4c/source/i18n/region_impl.h +++ b/icu4c/source/i18n/region_impl.h @@ -29,10 +29,10 @@ public: RegionNameEnumeration(UVector *fNameList, UErrorCode& status); virtual ~RegionNameEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: int32_t pos; UVector *fRegionNames; diff --git a/icu4c/source/i18n/reldatefmt.cpp b/icu4c/source/i18n/reldatefmt.cpp index 19fabbea669..fc40d41a4a9 100644 --- a/icu4c/source/i18n/reldatefmt.cpp +++ b/icu4c/source/i18n/reldatefmt.cpp @@ -588,7 +588,7 @@ struct RelDateTimeFmtDataSink : public ResourceSink { } virtual void put(const char *key, ResourceValue &value, - UBool /*noFallback*/, UErrorCode &errorCode) { + UBool /*noFallback*/, UErrorCode &errorCode) override { // Main entry point to sink ResourceTable table = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } diff --git a/icu4c/source/i18n/reldtfmt.cpp b/icu4c/source/i18n/reldtfmt.cpp index c8d68b68654..5fdef1c0d67 100644 --- a/icu4c/source/i18n/reldtfmt.cpp +++ b/icu4c/source/i18n/reldtfmt.cpp @@ -485,7 +485,7 @@ struct RelDateFmtDataSink : public ResourceSink { virtual ~RelDateFmtDataSink(); virtual void put(const char *key, ResourceValue &value, - UBool /*noFallback*/, UErrorCode &errorCode) { + UBool /*noFallback*/, UErrorCode &errorCode) override { ResourceTable relDayTable = value.getTable(errorCode); int32_t n = 0; int32_t len = 0; diff --git a/icu4c/source/i18n/reldtfmt.h b/icu4c/source/i18n/reldtfmt.h index 72464de6d56..98b333a02be 100644 --- a/icu4c/source/i18n/reldtfmt.h +++ b/icu4c/source/i18n/reldtfmt.h @@ -71,7 +71,7 @@ public: * @return A copy of the object. * @internal ICU 3.8 */ - virtual RelativeDateFormat* clone() const; + virtual RelativeDateFormat* clone() const override; /** * Return true if the given Format objects are semantically equal. Objects @@ -80,7 +80,7 @@ public: * @return true if the given Format objects are semantically equal. * @internal ICU 3.8 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; using DateFormat::format; @@ -103,7 +103,7 @@ public: */ virtual UnicodeString& format( Calendar& cal, UnicodeString& appendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Format an object to produce a string. This method handles Formattable @@ -122,7 +122,7 @@ public: virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& status) const; + UErrorCode& status) const override; /** @@ -146,7 +146,7 @@ public: */ virtual void parse( const UnicodeString& text, Calendar& cal, - ParsePosition& pos) const; + ParsePosition& pos) const override; /** * Parse a date/time string starting at the given parse position. For @@ -187,7 +187,7 @@ public: * @internal ICU 3.8 */ virtual UDate parse( const UnicodeString& text, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Return a single pattern string generated by combining the patterns for the @@ -245,7 +245,7 @@ public: * updated with any new status from the function. * @internal ICU 53 */ - virtual void setContext(UDisplayContext value, UErrorCode& status); + virtual void setContext(UDisplayContext value, UErrorCode& status) override; private: SimpleDateFormat *fDateTimeFormatter; @@ -327,7 +327,7 @@ public: * other classes have different class IDs. * @internal ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; diff --git a/icu4c/source/i18n/remtrans.h b/icu4c/source/i18n/remtrans.h index 13de01594a3..398cc5177cd 100644 --- a/icu4c/source/i18n/remtrans.h +++ b/icu4c/source/i18n/remtrans.h @@ -47,7 +47,7 @@ public: * Transliterator API. * @return A copy of the object. */ - virtual RemoveTransliterator* clone() const; + virtual RemoveTransliterator* clone() const override; /** * Implements {@link Transliterator#handleTransliterate}. @@ -59,12 +59,12 @@ public: * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/rulebasedcollator.cpp b/icu4c/source/i18n/rulebasedcollator.cpp index d898cd52b32..5e5cc3db626 100644 --- a/icu4c/source/i18n/rulebasedcollator.cpp +++ b/icu4c/source/i18n/rulebasedcollator.cpp @@ -66,8 +66,8 @@ public: virtual ~FixedSortKeyByteSink(); private: - virtual void AppendBeyondCapacity(const char *bytes, int32_t n, int32_t length); - virtual UBool Resize(int32_t appendCapacity, int32_t length); + virtual void AppendBeyondCapacity(const char *bytes, int32_t n, int32_t length) override; + virtual UBool Resize(int32_t appendCapacity, int32_t length) override; }; FixedSortKeyByteSink::~FixedSortKeyByteSink() {} @@ -98,8 +98,8 @@ public: virtual ~CollationKeyByteSink(); private: - virtual void AppendBeyondCapacity(const char *bytes, int32_t n, int32_t length); - virtual UBool Resize(int32_t appendCapacity, int32_t length); + virtual void AppendBeyondCapacity(const char *bytes, int32_t n, int32_t length) override; + virtual UBool Resize(int32_t appendCapacity, int32_t length) override; CollationKey &key_; }; @@ -830,7 +830,7 @@ class UTF16NFDIterator : public NFDIterator { public: UTF16NFDIterator(const UChar *text, const UChar *textLimit) : s(text), limit(textLimit) {} protected: - virtual UChar32 nextRawCodePoint() { + virtual UChar32 nextRawCodePoint() override { if(s == limit) { return U_SENTINEL; } UChar32 c = *s++; if(limit == NULL && c == 0) { @@ -882,7 +882,7 @@ public: UTF8NFDIterator(const uint8_t *text, int32_t textLength) : s(text), pos(0), length(textLength) {} protected: - virtual UChar32 nextRawCodePoint() { + virtual UChar32 nextRawCodePoint() override { if(pos == length || (s[pos] == 0 && length < 0)) { return U_SENTINEL; } UChar32 c; U8_NEXT_OR_FFFD(s, pos, length, c); @@ -899,7 +899,7 @@ public: FCDUTF8NFDIterator(const CollationData *data, const uint8_t *text, int32_t textLength) : u8ci(data, FALSE, text, 0, textLength) {} protected: - virtual UChar32 nextRawCodePoint() { + virtual UChar32 nextRawCodePoint() override { UErrorCode errorCode = U_ZERO_ERROR; return u8ci.nextCodePoint(errorCode); } @@ -911,7 +911,7 @@ class UIterNFDIterator : public NFDIterator { public: UIterNFDIterator(UCharIterator &it) : iter(it) {} protected: - virtual UChar32 nextRawCodePoint() { + virtual UChar32 nextRawCodePoint() override { return uiter_next32(&iter); } private: @@ -923,7 +923,7 @@ public: FCDUIterNFDIterator(const CollationData *data, UCharIterator &it, int32_t startIndex) : uici(data, FALSE, it, startIndex) {} protected: - virtual UChar32 nextRawCodePoint() { + virtual UChar32 nextRawCodePoint() override { UErrorCode errorCode = U_ZERO_ERROR; return uici.nextCodePoint(errorCode); } @@ -1398,7 +1398,7 @@ public: levelCapacity = sink.GetRemainingCapacity(); } virtual ~PartLevelCallback() {} - virtual UBool needToWrite(Collation::Level l) { + virtual UBool needToWrite(Collation::Level l) override { if(!sink.Overflowed()) { // Remember a level that will be at least partially written. level = l; diff --git a/icu4c/source/i18n/strmatch.h b/icu4c/source/i18n/strmatch.h index 4ee5cbd0887..6d2e392e654 100644 --- a/icu4c/source/i18n/strmatch.h +++ b/icu4c/source/i18n/strmatch.h @@ -78,21 +78,21 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico * Implement UnicodeFunctor * @return a copy of the object. */ - virtual StringMatcher* clone() const; + virtual StringMatcher* clone() const override; /** * UnicodeFunctor API. Cast 'this' to a UnicodeMatcher* pointer * and return the pointer. * @return the UnicodeMatcher point. */ - virtual UnicodeMatcher* toMatcher() const; + virtual UnicodeMatcher* toMatcher() const override; /** * UnicodeFunctor API. Cast 'this' to a UnicodeReplacer* pointer * and return the pointer. * @return the UnicodeReplacer pointer. */ - virtual UnicodeReplacer* toReplacer() const; + virtual UnicodeReplacer* toReplacer() const override; /** * Implement UnicodeMatcher @@ -119,7 +119,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico virtual UMatchDegree matches(const Replaceable& text, int32_t& offset, int32_t limit, - UBool incremental); + UBool incremental) override; /** * Implement UnicodeMatcher @@ -128,7 +128,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico * @return A reference to 'result'. */ virtual UnicodeString& toPattern(UnicodeString& result, - UBool escapeUnprintable = false) const; + UBool escapeUnprintable = false) const override; /** * Implement UnicodeMatcher @@ -140,17 +140,17 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico * @return true if this matcher will match a character c, * where c & 0xFF == v */ - virtual UBool matchesIndexValue(uint8_t v) const; + virtual UBool matchesIndexValue(uint8_t v) const override; /** * Implement UnicodeMatcher */ - virtual void addMatchSetTo(UnicodeSet& toUnionTo) const; + virtual void addMatchSetTo(UnicodeSet& toUnionTo) const override; /** * Implement UnicodeFunctor */ - virtual void setData(const TransliterationRuleData*); + virtual void setData(const TransliterationRuleData*) override; /** * Replace characters in 'text' from 'start' to 'limit' with the @@ -172,7 +172,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico virtual int32_t replace(Replaceable& text, int32_t start, int32_t limit, - int32_t& cursor); + int32_t& cursor) override; /** * Returns a string representation of this replacer. If the @@ -188,7 +188,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico * @return a reference to 'result'. */ virtual UnicodeString& toReplacerPattern(UnicodeString& result, - UBool escapeUnprintable) const; + UBool escapeUnprintable) const override; /** * Remove any match data. This must be called before performing a @@ -199,7 +199,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -211,7 +211,7 @@ class StringMatcher : public UnicodeFunctor, public UnicodeMatcher, public Unico * into the given set. * @param toUnionTo the set into which to union the output characters */ - virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const; + virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const override; private: diff --git a/icu4c/source/i18n/strrepl.h b/icu4c/source/i18n/strrepl.h index 7f74d0d9450..8063626a333 100644 --- a/icu4c/source/i18n/strrepl.h +++ b/icu4c/source/i18n/strrepl.h @@ -111,13 +111,13 @@ class StringReplacer : public UnicodeFunctor, public UnicodeReplacer { /** * Implement UnicodeFunctor */ - virtual StringReplacer* clone() const; + virtual StringReplacer* clone() const override; /** * UnicodeFunctor API. Cast 'this' to a UnicodeReplacer* pointer * and return the pointer. */ - virtual UnicodeReplacer* toReplacer() const; + virtual UnicodeReplacer* toReplacer() const override; /** * UnicodeReplacer API @@ -125,23 +125,23 @@ class StringReplacer : public UnicodeFunctor, public UnicodeReplacer { virtual int32_t replace(Replaceable& text, int32_t start, int32_t limit, - int32_t& cursor); + int32_t& cursor) override; /** * UnicodeReplacer API */ virtual UnicodeString& toReplacerPattern(UnicodeString& result, - UBool escapeUnprintable) const; + UBool escapeUnprintable) const override; /** * Implement UnicodeReplacer */ - virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const; + virtual void addReplacementSetTo(UnicodeSet& toUnionTo) const override; /** * UnicodeFunctor API */ - virtual void setData(const TransliterationRuleData*); + virtual void setData(const TransliterationRuleData*) override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -151,7 +151,7 @@ class StringReplacer : public UnicodeFunctor, public UnicodeReplacer { /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/taiwncal.h b/icu4c/source/i18n/taiwncal.h index 5fec78d1466..ab6b6aff099 100644 --- a/icu4c/source/i18n/taiwncal.h +++ b/icu4c/source/i18n/taiwncal.h @@ -91,7 +91,7 @@ public: * @return return a polymorphic copy of this calendar. * @internal */ - virtual TaiwanCalendar* clone() const; + virtual TaiwanCalendar* clone() const override; public: /** @@ -104,7 +104,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @internal */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -125,7 +125,7 @@ public: * @return calendar type * @internal */ - virtual const char * getType() const; + virtual const char * getType() const override; private: TaiwanCalendar(); // default constructor not implemented @@ -139,13 +139,13 @@ private: * @return the extended year * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Subclasses may override this method to compute several fields * specific to each calendar system. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode& status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode& status) override; /** * Subclass API for defining limits of different types. * @param field one of the field numbers @@ -153,26 +153,26 @@ private: * LEAST_MAXIMUM, or MAXIMUM * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Returns true because the Taiwan Calendar does have a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * Returns the date of the start of the default century * @return start of century - in milliseconds since epoch, 1970 * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * Returns the year in which the default century begins * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/timezone.cpp b/icu4c/source/i18n/timezone.cpp index 1b078a51506..ee4129e4d43 100644 --- a/icu4c/source/i18n/timezone.cpp +++ b/icu4c/source/i18n/timezone.cpp @@ -951,15 +951,15 @@ public: virtual ~TZEnumeration(); - virtual StringEnumeration *clone() const { + virtual StringEnumeration *clone() const override { return new TZEnumeration(*this); } - virtual int32_t count(UErrorCode& status) const { + virtual int32_t count(UErrorCode& status) const override { return U_FAILURE(status) ? 0 : len; } - virtual const UnicodeString* snext(UErrorCode& status) { + virtual const UnicodeString* snext(UErrorCode& status) override { if (U_SUCCESS(status) && map != NULL && pos < len) { getID(map[pos], status); ++pos; @@ -968,13 +968,13 @@ public: return 0; } - virtual void reset(UErrorCode& /*status*/) { + virtual void reset(UErrorCode& /*status*/) override { pos = 0; } public: static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; TZEnumeration::~TZEnumeration() { diff --git a/icu4c/source/i18n/titletrn.h b/icu4c/source/i18n/titletrn.h index 4e45ac6f81f..8409519818a 100644 --- a/icu4c/source/i18n/titletrn.h +++ b/icu4c/source/i18n/titletrn.h @@ -52,12 +52,12 @@ class TitlecaseTransliterator : public CaseMapTransliterator { * Transliterator API. * @return a copy of the object. */ - virtual TitlecaseTransliterator* clone() const; + virtual TitlecaseTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -76,7 +76,7 @@ protected: * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; private: /** diff --git a/icu4c/source/i18n/tmutfmt.cpp b/icu4c/source/i18n/tmutfmt.cpp index 6068a0189c8..057bb634ebb 100644 --- a/icu4c/source/i18n/tmutfmt.cpp +++ b/icu4c/source/i18n/tmutfmt.cpp @@ -362,7 +362,7 @@ struct TimeUnitFormatReadSink : public ResourceSink { virtual ~TimeUnitFormatReadSink(); - virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) { + virtual void put(const char *key, ResourceValue &value, UBool, UErrorCode &errorCode) override { // Skip all put() calls except the first one -- discard all fallback data. if (beenHere) { return; diff --git a/icu4c/source/i18n/tolowtrn.h b/icu4c/source/i18n/tolowtrn.h index 2fbfb90e1bf..951128ec77e 100644 --- a/icu4c/source/i18n/tolowtrn.h +++ b/icu4c/source/i18n/tolowtrn.h @@ -50,12 +50,12 @@ class LowercaseTransliterator : public CaseMapTransliterator { * Transliterator API. * @return a copy of the object. */ - virtual LowercaseTransliterator* clone() const; + virtual LowercaseTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/toupptrn.h b/icu4c/source/i18n/toupptrn.h index e96ca8f0ba5..755e9edfcb5 100644 --- a/icu4c/source/i18n/toupptrn.h +++ b/icu4c/source/i18n/toupptrn.h @@ -50,12 +50,12 @@ class UppercaseTransliterator : public CaseMapTransliterator { * Transliterator API. * @return a copy of the object. */ - virtual UppercaseTransliterator* clone() const; + virtual UppercaseTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/transreg.h b/icu4c/source/i18n/transreg.h index 18deec85156..686e62ae33c 100644 --- a/icu4c/source/i18n/transreg.h +++ b/icu4c/source/i18n/transreg.h @@ -417,11 +417,11 @@ class TransliteratorRegistry : public UMemory { public: Enumeration(const TransliteratorRegistry& reg); virtual ~Enumeration(); - virtual int32_t count(UErrorCode& status) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); + virtual int32_t count(UErrorCode& status) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; static UClassID U_EXPORT2 getStaticClassID(); - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: int32_t index; const TransliteratorRegistry& reg; diff --git a/icu4c/source/i18n/tzfmt.cpp b/icu4c/source/i18n/tzfmt.cpp index c16d4131682..38947a79aa3 100644 --- a/icu4c/source/i18n/tzfmt.cpp +++ b/icu4c/source/i18n/tzfmt.cpp @@ -2729,7 +2729,7 @@ public: ZoneIdMatchHandler(); virtual ~ZoneIdMatchHandler(); - UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status); + UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status) override; const UChar* getID(); int32_t getMatchLen(); private: diff --git a/icu4c/source/i18n/tzgnames.cpp b/icu4c/source/i18n/tzgnames.cpp index bab3eb353f6..ed5f42d7bc1 100644 --- a/icu4c/source/i18n/tzgnames.cpp +++ b/icu4c/source/i18n/tzgnames.cpp @@ -195,7 +195,7 @@ public: GNameSearchHandler(uint32_t types); virtual ~GNameSearchHandler(); - UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status); + UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status) override; UVector* getMatches(int32_t& maxMatchLen); private: diff --git a/icu4c/source/i18n/tznames.cpp b/icu4c/source/i18n/tznames.cpp index 796ba73de00..5c504d01cb6 100644 --- a/icu4c/source/i18n/tznames.cpp +++ b/icu4c/source/i18n/tznames.cpp @@ -104,24 +104,24 @@ public: TimeZoneNamesDelegate(const Locale& locale, UErrorCode& status); virtual ~TimeZoneNamesDelegate(); - virtual bool operator==(const TimeZoneNames& other) const; + virtual bool operator==(const TimeZoneNames& other) const override; virtual bool operator!=(const TimeZoneNames& other) const {return !operator==(other);} - virtual TimeZoneNamesDelegate* clone() const; + virtual TimeZoneNamesDelegate* clone() const override; - StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; - StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const; - UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const; - UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const; + StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const override; + StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const override; + UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const override; + UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const override; - UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const; - UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const; + UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const override; + UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const override; - UnicodeString& getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const; + UnicodeString& getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const override; - void loadAllDisplayNames(UErrorCode& status); - void getDisplayNames(const UnicodeString& tzID, const UTimeZoneNameType types[], int32_t numTypes, UDate date, UnicodeString dest[], UErrorCode& status) const; + void loadAllDisplayNames(UErrorCode& status) override; + void getDisplayNames(const UnicodeString& tzID, const UTimeZoneNameType types[], int32_t numTypes, UDate date, UnicodeString dest[], UErrorCode& status) const override; - MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const; + MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const override; private: TimeZoneNamesDelegate(); TimeZoneNamesCacheEntry* fTZnamesCacheEntry; diff --git a/icu4c/source/i18n/tznames_impl.cpp b/icu4c/source/i18n/tznames_impl.cpp index d6bb25d0ea0..d450b745648 100644 --- a/icu4c/source/i18n/tznames_impl.cpp +++ b/icu4c/source/i18n/tznames_impl.cpp @@ -794,7 +794,7 @@ struct ZNames::ZNamesLoader : public ResourceSink { } virtual void put(const char* key, ResourceValue& value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { ResourceTable namesTable = value.getTable(errorCode); if (U_FAILURE(errorCode)) { return; } for (int32_t i = 0; namesTable.getKeyAndValue(i, key, value); ++i) { @@ -857,10 +857,10 @@ public: MetaZoneIDsEnumeration(UVector* mzIDs); virtual ~MetaZoneIDsEnumeration(); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; - virtual const UnicodeString* snext(UErrorCode& status); - virtual void reset(UErrorCode& status); - virtual int32_t count(UErrorCode& status) const; + virtual UClassID getDynamicClassID(void) const override; + virtual const UnicodeString* snext(UErrorCode& status) override; + virtual void reset(UErrorCode& status) override; + virtual int32_t count(UErrorCode& status) const override; private: int32_t fLen; int32_t fPos; @@ -920,7 +920,7 @@ public: ZNameSearchHandler(uint32_t types); virtual ~ZNameSearchHandler(); - UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status); + UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status) override; TimeZoneNames::MatchInfoCollection* getMatches(int32_t& maxMatchLen); private: @@ -1560,7 +1560,7 @@ struct TimeZoneNamesImpl::ZoneStringsLoader : public ResourceSink { } virtual void put(const char *key, ResourceValue &value, UBool noFallback, - UErrorCode &status) { + UErrorCode &status) override { ResourceTable timeZonesTable = value.getTable(status); if (U_FAILURE(status)) { return; } for (int32_t i = 0; timeZonesTable.getKeyAndValue(i, key, value); ++i) { @@ -1891,7 +1891,7 @@ public: TZDBNameSearchHandler(uint32_t types, const char* region); virtual ~TZDBNameSearchHandler(); - UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status); + UBool handleMatch(int32_t matchLength, const CharacterNode *node, UErrorCode &status) override; TimeZoneNames::MatchInfoCollection* getMatches(int32_t& maxMatchLen); private: diff --git a/icu4c/source/i18n/tznames_impl.h b/icu4c/source/i18n/tznames_impl.h index e68b198dba7..d047fa35418 100644 --- a/icu4c/source/i18n/tznames_impl.h +++ b/icu4c/source/i18n/tznames_impl.h @@ -173,24 +173,24 @@ public: virtual ~TimeZoneNamesImpl(); - virtual bool operator==(const TimeZoneNames& other) const; - virtual TimeZoneNamesImpl* clone() const; + virtual bool operator==(const TimeZoneNames& other) const override; + virtual TimeZoneNamesImpl* clone() const override; - StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; - StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const; + StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const override; + StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const override; - UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const; - UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const; + UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const override; + UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const override; - UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const; - UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const; + UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const override; + UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const override; - UnicodeString& getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const; + UnicodeString& getExemplarLocationName(const UnicodeString& tzID, UnicodeString& name) const override; - TimeZoneNames::MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const; + TimeZoneNames::MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const override; - void loadAllDisplayNames(UErrorCode& status); - void getDisplayNames(const UnicodeString& tzID, const UTimeZoneNameType types[], int32_t numTypes, UDate date, UnicodeString dest[], UErrorCode& status) const; + void loadAllDisplayNames(UErrorCode& status) override; + void getDisplayNames(const UnicodeString& tzID, const UTimeZoneNameType types[], int32_t numTypes, UDate date, UnicodeString dest[], UErrorCode& status) const override; static UnicodeString& getDefaultExemplarLocationName(const UnicodeString& tzID, UnicodeString& name); @@ -235,19 +235,19 @@ public: TZDBTimeZoneNames(const Locale& locale); virtual ~TZDBTimeZoneNames(); - virtual bool operator==(const TimeZoneNames& other) const; - virtual TZDBTimeZoneNames* clone() const; + virtual bool operator==(const TimeZoneNames& other) const override; + virtual TZDBTimeZoneNames* clone() const override; - StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const; - StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const; + StringEnumeration* getAvailableMetaZoneIDs(UErrorCode& status) const override; + StringEnumeration* getAvailableMetaZoneIDs(const UnicodeString& tzID, UErrorCode& status) const override; - UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const; - UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const; + UnicodeString& getMetaZoneID(const UnicodeString& tzID, UDate date, UnicodeString& mzID) const override; + UnicodeString& getReferenceZoneID(const UnicodeString& mzID, const char* region, UnicodeString& tzID) const override; - UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const; - UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const; + UnicodeString& getMetaZoneDisplayName(const UnicodeString& mzID, UTimeZoneNameType type, UnicodeString& name) const override; + UnicodeString& getTimeZoneDisplayName(const UnicodeString& tzID, UTimeZoneNameType type, UnicodeString& name) const override; - TimeZoneNames::MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const; + TimeZoneNames::MatchInfoCollection* find(const UnicodeString& text, int32_t start, uint32_t types, UErrorCode& status) const override; // When TZDBNames for the metazone is not available, this method returns NULL, // but does NOT set U_MISSING_RESOURCE_ERROR to status. diff --git a/icu4c/source/i18n/ucol_res.cpp b/icu4c/source/i18n/ucol_res.cpp index aa4027eb872..b277cf3b280 100644 --- a/icu4c/source/i18n/ucol_res.cpp +++ b/icu4c/source/i18n/ucol_res.cpp @@ -623,7 +623,7 @@ public: virtual ~KeywordsSink(); virtual void put(const char *key, ResourceValue &value, UBool /*noFallback*/, - UErrorCode &errorCode) { + UErrorCode &errorCode) override { if (U_FAILURE(errorCode)) { return; } ResourceTable collations = value.getTable(errorCode); for (int32_t i = 0; collations.getKeyAndValue(i, key, value); ++i) { diff --git a/icu4c/source/i18n/uitercollationiterator.h b/icu4c/source/i18n/uitercollationiterator.h index 3a7b1a0ec23..e0da353f268 100644 --- a/icu4c/source/i18n/uitercollationiterator.h +++ b/icu4c/source/i18n/uitercollationiterator.h @@ -39,22 +39,22 @@ public: virtual ~UIterCollationIterator(); - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UChar handleGetTrailSurrogate(); + virtual UChar handleGetTrailSurrogate() override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; UCharIterator &iter; }; @@ -71,22 +71,23 @@ public: virtual ~FCDUIterCollationIterator(); - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UChar handleGetTrailSurrogate(); + virtual UChar handleGetTrailSurrogate() override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; + + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; private: /** diff --git a/icu4c/source/i18n/unesctrn.h b/icu4c/source/i18n/unesctrn.h index 57dd8d32cf5..e905c5bc5f5 100644 --- a/icu4c/source/i18n/unesctrn.h +++ b/icu4c/source/i18n/unesctrn.h @@ -77,12 +77,12 @@ class UnescapeTransliterator : public Transliterator { /** * Transliterator API. */ - virtual UnescapeTransliterator* clone() const; + virtual UnescapeTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -101,7 +101,7 @@ class UnescapeTransliterator : public Transliterator { * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; }; diff --git a/icu4c/source/i18n/uni2name.h b/icu4c/source/i18n/uni2name.h index 99309c8e0f8..1e01d784237 100644 --- a/icu4c/source/i18n/uni2name.h +++ b/icu4c/source/i18n/uni2name.h @@ -48,12 +48,12 @@ class UnicodeNameTransliterator : public Transliterator { /** * Transliterator API. */ - virtual UnicodeNameTransliterator* clone() const; + virtual UnicodeNameTransliterator* clone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -72,7 +72,7 @@ class UnicodeNameTransliterator : public Transliterator { * pos.contextLimit. Otherwise, assume the text is complete. */ virtual void handleTransliterate(Replaceable& text, UTransPosition& offset, - UBool isIncremental) const; + UBool isIncremental) const override; private: /** diff --git a/icu4c/source/i18n/unicode/choicfmt.h b/icu4c/source/i18n/unicode/choicfmt.h index 46b84f4f5b2..0e7ae186d4d 100644 --- a/icu4c/source/i18n/unicode/choicfmt.h +++ b/icu4c/source/i18n/unicode/choicfmt.h @@ -251,7 +251,7 @@ public: * @return a copy of this object * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ - virtual ChoiceFormat* clone() const; + virtual ChoiceFormat* clone() const override; /** * Returns true if the given Format objects are semantically equal. @@ -261,7 +261,7 @@ public: * @return true if other is the same as this. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Sets the pattern. @@ -375,7 +375,7 @@ public: */ virtual UnicodeString& format(double number, UnicodeString& appendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats an int32_t number using this object's choices. * @@ -389,7 +389,7 @@ public: */ virtual UnicodeString& format(int32_t number, UnicodeString& appendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats an int64_t number using this object's choices. @@ -404,7 +404,7 @@ public: */ virtual UnicodeString& format(int64_t number, UnicodeString& appendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats an array of objects using this object's choices. @@ -444,7 +444,7 @@ public: */ virtual void parse(const UnicodeString& text, Formattable& result, - ParsePosition& parsePosition) const; + ParsePosition& parsePosition) const override; /** * Returns a unique class ID POLYMORPHICALLY. Part of ICU's "poor man's RTTI". @@ -454,7 +454,7 @@ public: * other classes have different class IDs. * @deprecated ICU 49 Use MessageFormat instead, with plural and select arguments. */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Returns the class ID for this class. This is useful only for diff --git a/icu4c/source/i18n/unicode/coleitr.h b/icu4c/source/i18n/unicode/coleitr.h index 38a63d23df6..4e68c6f1749 100644 --- a/icu4c/source/i18n/unicode/coleitr.h +++ b/icu4c/source/i18n/unicode/coleitr.h @@ -279,7 +279,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/curramt.h b/icu4c/source/i18n/unicode/curramt.h index e4c35c18111..818b11ae5bd 100644 --- a/icu4c/source/i18n/unicode/curramt.h +++ b/icu4c/source/i18n/unicode/curramt.h @@ -81,7 +81,7 @@ class U_I18N_API CurrencyAmount: public Measure { * have the same class as returned by getDynamicClassID(). * @stable ICU 3.0 */ - virtual CurrencyAmount* clone() const; + virtual CurrencyAmount* clone() const override; /** * Destructor @@ -97,7 +97,7 @@ class U_I18N_API CurrencyAmount: public Measure { * different class IDs. * @stable ICU 3.0 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * Returns the class ID for this class. This is used to compare to diff --git a/icu4c/source/i18n/unicode/currpinf.h b/icu4c/source/i18n/unicode/currpinf.h index 8e73f9f00ab..e3ca34b26f2 100644 --- a/icu4c/source/i18n/unicode/currpinf.h +++ b/icu4c/source/i18n/unicode/currpinf.h @@ -184,7 +184,7 @@ public: * * @stable ICU 4.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/currunit.h b/icu4c/source/i18n/unicode/currunit.h index 9b608fdeef2..8da3f1ffd87 100644 --- a/icu4c/source/i18n/unicode/currunit.h +++ b/icu4c/source/i18n/unicode/currunit.h @@ -94,7 +94,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * have the same class as returned by getDynamicClassID(). * @stable ICU 3.0 */ - virtual CurrencyUnit* clone() const; + virtual CurrencyUnit* clone() const override; /** * Destructor @@ -110,7 +110,7 @@ class U_I18N_API CurrencyUnit: public MeasureUnit { * different class IDs. * @stable ICU 3.0 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * Returns the class ID for this class. This is used to compare to diff --git a/icu4c/source/i18n/unicode/dcfmtsym.h b/icu4c/source/i18n/unicode/dcfmtsym.h index 5b924458fa4..3b1535dd16d 100644 --- a/icu4c/source/i18n/unicode/dcfmtsym.h +++ b/icu4c/source/i18n/unicode/dcfmtsym.h @@ -359,7 +359,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/dtfmtsym.h b/icu4c/source/i18n/unicode/dtfmtsym.h index 3c4756c4d7f..200b3a6ef17 100644 --- a/icu4c/source/i18n/unicode/dtfmtsym.h +++ b/icu4c/source/i18n/unicode/dtfmtsym.h @@ -628,7 +628,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/dtitvfmt.h b/icu4c/source/i18n/unicode/dtitvfmt.h index e258a380e3e..85a1b365d83 100644 --- a/icu4c/source/i18n/unicode/dtitvfmt.h +++ b/icu4c/source/i18n/unicode/dtitvfmt.h @@ -434,7 +434,7 @@ public: * @return A copy of the object. * @stable ICU 4.0 */ - virtual DateIntervalFormat* clone() const; + virtual DateIntervalFormat* clone() const override; /** * Return true if the given Format objects are semantically equal. Objects @@ -443,7 +443,7 @@ public: * @return true if the given Format objects are semantically equal. * @stable ICU 4.0 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Return true if the given Format objects are not semantically equal. @@ -479,7 +479,7 @@ public: virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& fieldPosition, - UErrorCode& status) const ; + UErrorCode& status) const override; @@ -595,7 +595,7 @@ public: */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& parse_pos) const; + ParsePosition& parse_pos) const override; /** @@ -702,7 +702,7 @@ public: * other classes have different class IDs. * @stable ICU 4.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; protected: diff --git a/icu4c/source/i18n/unicode/dtitvinf.h b/icu4c/source/i18n/unicode/dtitvinf.h index f6368c4f790..b5afc064678 100644 --- a/icu4c/source/i18n/unicode/dtitvinf.h +++ b/icu4c/source/i18n/unicode/dtitvinf.h @@ -319,7 +319,7 @@ public: * * @stable ICU 4.0 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/dtptngen.h b/icu4c/source/i18n/unicode/dtptngen.h index ce0431c7264..250a0e089fe 100644 --- a/icu4c/source/i18n/unicode/dtptngen.h +++ b/icu4c/source/i18n/unicode/dtptngen.h @@ -513,7 +513,7 @@ public: * * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/dtrule.h b/icu4c/source/i18n/unicode/dtrule.h index 4133efc5079..19e94bc981c 100644 --- a/icu4c/source/i18n/unicode/dtrule.h +++ b/icu4c/source/i18n/unicode/dtrule.h @@ -243,7 +243,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/unicode/fieldpos.h b/icu4c/source/i18n/unicode/fieldpos.h index d31fcf3888e..b985f3b2f76 100644 --- a/icu4c/source/i18n/unicode/fieldpos.h +++ b/icu4c/source/i18n/unicode/fieldpos.h @@ -236,7 +236,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/fmtable.h b/icu4c/source/i18n/unicode/fmtable.h index e3764df96c2..e1c6dec35e4 100644 --- a/icu4c/source/i18n/unicode/fmtable.h +++ b/icu4c/source/i18n/unicode/fmtable.h @@ -587,7 +587,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/gregocal.h b/icu4c/source/i18n/unicode/gregocal.h index 4c79944a6ff..4c2be18251f 100644 --- a/icu4c/source/i18n/unicode/gregocal.h +++ b/icu4c/source/i18n/unicode/gregocal.h @@ -303,7 +303,7 @@ public: * @return return a polymorphic copy of this calendar. * @stable ICU 2.0 */ - virtual GregorianCalendar* clone() const; + virtual GregorianCalendar* clone() const override; /** * Sets the GregorianCalendar change date. This is the point when the switch from @@ -350,7 +350,7 @@ public: * @param other the Calendar to be compared with this Calendar * @stable ICU 2.4 */ - virtual UBool isEquivalentTo(const Calendar& other) const; + virtual UBool isEquivalentTo(const Calendar& other) const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -364,7 +364,7 @@ public: * an error status. * @deprecated ICU 2.6. Use roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) instead. */ - virtual void roll(EDateFields field, int32_t amount, UErrorCode& status); + virtual void roll(EDateFields field, int32_t amount, UErrorCode& status) override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -378,7 +378,7 @@ public: * an error status. * @stable ICU 2.6. */ - virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status); + virtual void roll(UCalendarDateFields field, int32_t amount, UErrorCode& status) override; #ifndef U_HIDE_DEPRECATED_API /** @@ -409,7 +409,7 @@ public: * @return the minimum value that this field could have, given the current date. * @stable ICU 3.0 */ - int32_t getActualMinimum(UCalendarDateFields field, UErrorCode &status) const; + int32_t getActualMinimum(UCalendarDateFields field, UErrorCode &status) const override; #ifndef U_HIDE_DEPRECATED_API /** @@ -434,7 +434,7 @@ public: * @return the maximum value that this field could have, given the current date. * @stable ICU 2.6 */ - virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const; + virtual int32_t getActualMaximum(UCalendarDateFields field, UErrorCode& status) const override; /** * (Overrides Calendar) Return true if the current date for this Calendar is in @@ -445,7 +445,7 @@ public: * false, otherwise. * @stable ICU 2.0 */ - virtual UBool inDaylightTime(UErrorCode& status) const; + virtual UBool inDaylightTime(UErrorCode& status) const override; public: @@ -459,7 +459,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return @@ -484,7 +484,7 @@ public: * @return legacy calendar type name string * @stable ICU 49 */ - virtual const char * getType() const; + virtual const char * getType() const override; private: GregorianCalendar(); // default constructor not implemented @@ -512,7 +512,7 @@ public: * @internal */ virtual int32_t handleComputeMonthStart(int32_t eyear, int32_t month, - UBool useMonth) const; + UBool useMonth) const override; /** * Subclasses may override this. This method calls @@ -522,7 +522,7 @@ public: * @return julian day specified by calendar fields. * @internal */ - virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField) ; + virtual int32_t handleComputeJulianDay(UCalendarDateFields bestField) override; /** * Return the number of days in the given month of the given extended @@ -531,7 +531,7 @@ public: * implementation than the default implementation in Calendar. * @internal */ - virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const; + virtual int32_t handleGetMonthLength(int32_t extendedYear, int32_t month) const override; /** * Return the number of days in the given extended year of this @@ -540,7 +540,7 @@ public: * default implementation in Calendar. * @stable ICU 2.0 */ - virtual int32_t handleGetYearLength(int32_t eyear) const; + virtual int32_t handleGetYearLength(int32_t eyear) const override; /** * return the length of the given month. @@ -615,7 +615,7 @@ public: * LEAST_MAXIMUM, or MAXIMUM * @internal */ - virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const; + virtual int32_t handleGetLimit(UCalendarDateFields field, ELimitType limitType) const override; /** * Return the extended year defined by the current fields. This will @@ -625,7 +625,7 @@ public: * @return the extended year * @internal */ - virtual int32_t handleGetExtendedYear(); + virtual int32_t handleGetExtendedYear() override; /** * Subclasses may override this to convert from week fields @@ -635,7 +635,7 @@ public: * @return the extended year, UCAL_EXTENDED_YEAR * @internal */ - virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy); + virtual int32_t handleGetExtendedYearFromWeekFields(int32_t yearWoy, int32_t woy) override; /** @@ -653,7 +653,7 @@ public: * a calendar with the specified Julian/Gregorian cutover date. * @internal */ - virtual void handleComputeFields(int32_t julianDay, UErrorCode &status); + virtual void handleComputeFields(int32_t julianDay, UErrorCode &status) override; private: /** @@ -759,19 +759,19 @@ public: * @return true if this calendar has the notion of a default century * @internal */ - virtual UBool haveDefaultCentury() const; + virtual UBool haveDefaultCentury() const override; /** * @return the start of the default century * @internal */ - virtual UDate defaultCenturyStart() const; + virtual UDate defaultCenturyStart() const override; /** * @return the beginning year of the default century * @internal */ - virtual int32_t defaultCenturyStartYear() const; + virtual int32_t defaultCenturyStartYear() const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/unicode/measfmt.h b/icu4c/source/i18n/unicode/measfmt.h index 779212cf1d1..893076145f5 100644 --- a/icu4c/source/i18n/unicode/measfmt.h +++ b/icu4c/source/i18n/unicode/measfmt.h @@ -148,13 +148,13 @@ class U_I18N_API MeasureFormat : public Format { * Return true if given Format objects are semantically equal. * @stable ICU 53 */ - virtual bool operator==(const Format &other) const; + virtual bool operator==(const Format &other) const override; /** * Clones this object polymorphically. * @stable ICU 53 */ - virtual MeasureFormat *clone() const; + virtual MeasureFormat *clone() const override; /** * Formats object to produce a string. @@ -164,7 +164,7 @@ class U_I18N_API MeasureFormat : public Format { const Formattable &obj, UnicodeString &appendTo, FieldPosition &pos, - UErrorCode &status) const; + UErrorCode &status) const override; #ifndef U_FORCE_HIDE_DRAFT_API /** @@ -176,7 +176,7 @@ class U_I18N_API MeasureFormat : public Format { virtual void parseObject( const UnicodeString &source, Formattable &reslt, - ParsePosition &pos) const; + ParsePosition &pos) const override; #endif // U_FORCE_HIDE_DRAFT_API /** @@ -286,7 +286,7 @@ class U_I18N_API MeasureFormat : public Format { * other classes have different class IDs. * @stable ICU 53 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; protected: /** diff --git a/icu4c/source/i18n/unicode/measunit.h b/icu4c/source/i18n/unicode/measunit.h index be6688410d6..d0b70212fcb 100644 --- a/icu4c/source/i18n/unicode/measunit.h +++ b/icu4c/source/i18n/unicode/measunit.h @@ -662,7 +662,7 @@ class U_I18N_API MeasureUnit: public UObject { * other classes have different class IDs. * @stable ICU 53 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; #ifndef U_HIDE_INTERNAL_API /** diff --git a/icu4c/source/i18n/unicode/measure.h b/icu4c/source/i18n/unicode/measure.h index 3831e9dd2f1..7b118acfcfa 100644 --- a/icu4c/source/i18n/unicode/measure.h +++ b/icu4c/source/i18n/unicode/measure.h @@ -127,7 +127,7 @@ class U_I18N_API Measure: public UObject { * other classes have different class IDs. * @stable ICU 53 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; protected: /** diff --git a/icu4c/source/i18n/unicode/msgfmt.h b/icu4c/source/i18n/unicode/msgfmt.h index cb2c66e8f9d..c949132fdae 100644 --- a/icu4c/source/i18n/unicode/msgfmt.h +++ b/icu4c/source/i18n/unicode/msgfmt.h @@ -420,7 +420,7 @@ public: * result and should delete it when done. * @stable ICU 2.0 */ - virtual MessageFormat* clone() const; + virtual MessageFormat* clone() const override; /** * Returns true if the given Format objects are semantically equal. @@ -429,7 +429,7 @@ public: * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Sets the locale to be used for creating argument Format objects. @@ -715,7 +715,7 @@ public: virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Formats the given array of arguments into a user-defined argument name @@ -790,7 +790,7 @@ public: */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& pos) const; + ParsePosition& pos) const override; /** * Convert an 'apostrophe-friendly' pattern into a standard @@ -850,7 +850,7 @@ public: * other classes have different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for @@ -898,7 +898,7 @@ private: public: PluralSelectorProvider(const MessageFormat &mf, UPluralType type); virtual ~PluralSelectorProvider(); - virtual UnicodeString select(void *ctx, double number, UErrorCode& ec) const; + virtual UnicodeString select(void *ctx, double number, UErrorCode& ec) const override; void reset(); private: @@ -1088,22 +1088,22 @@ private: */ class U_I18N_API DummyFormat : public Format { public: - virtual bool operator==(const Format&) const; - virtual DummyFormat* clone() const; + virtual bool operator==(const Format&) const override; + virtual DummyFormat* clone() const override; virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, UErrorCode& status) const; virtual UnicodeString& format(const Formattable&, UnicodeString& appendTo, FieldPosition&, - UErrorCode& status) const; + UErrorCode& status) const override; virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPositionIterator* posIter, - UErrorCode& status) const; + UErrorCode& status) const override; virtual void parseObject(const UnicodeString&, Formattable&, - ParsePosition&) const; + ParsePosition&) const override; }; friend class MessageFormatAdapter; // getFormatTypeList() access diff --git a/icu4c/source/i18n/unicode/numsys.h b/icu4c/source/i18n/unicode/numsys.h index 1646729777f..4f839d0f354 100644 --- a/icu4c/source/i18n/unicode/numsys.h +++ b/icu4c/source/i18n/unicode/numsys.h @@ -192,7 +192,7 @@ public: * * @stable ICU 4.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: diff --git a/icu4c/source/i18n/unicode/plurfmt.h b/icu4c/source/i18n/unicode/plurfmt.h index bd2fbfc9fc8..bcabf3950b1 100644 --- a/icu4c/source/i18n/unicode/plurfmt.h +++ b/icu4c/source/i18n/unicode/plurfmt.h @@ -434,7 +434,7 @@ public: * @return true if other is semantically equal to this. * @stable ICU 4.0 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Return true if another object is semantically unequal to this one. @@ -450,7 +450,7 @@ public: * result and should delete it when done. * @stable ICU 4.0 */ - virtual PluralFormat* clone() const; + virtual PluralFormat* clone() const override; /** * Formats a plural message for a number taken from a Formattable object. @@ -469,7 +469,7 @@ public: UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Returns the pattern from applyPattern() or constructor(). @@ -505,7 +505,7 @@ public: */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& parse_pos) const; + ParsePosition& parse_pos) const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -520,7 +520,7 @@ public: * * @stable ICU 4.0 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: /** @@ -548,7 +548,7 @@ private: virtual ~PluralSelectorAdapter(); - virtual UnicodeString select(void *context, double number, UErrorCode& /*ec*/) const; + virtual UnicodeString select(void *context, double number, UErrorCode& /*ec*/) const override; void reset(); diff --git a/icu4c/source/i18n/unicode/plurrule.h b/icu4c/source/i18n/unicode/plurrule.h index 1cc4225e79d..344bf1692b1 100644 --- a/icu4c/source/i18n/unicode/plurrule.h +++ b/icu4c/source/i18n/unicode/plurrule.h @@ -562,7 +562,7 @@ public: * * @stable ICU 4.0 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: diff --git a/icu4c/source/i18n/unicode/rbnf.h b/icu4c/source/i18n/unicode/rbnf.h index 3ea5c788ce3..0a5a378e13b 100644 --- a/icu4c/source/i18n/unicode/rbnf.h +++ b/icu4c/source/i18n/unicode/rbnf.h @@ -698,7 +698,7 @@ public: * @return A copy of the object. * @stable ICU 2.6 */ - virtual RuleBasedNumberFormat* clone() const; + virtual RuleBasedNumberFormat* clone() const override; /** * Return true if the given Format objects are semantically equal. @@ -707,7 +707,7 @@ public: * @return true if the given Format objects are semantically equal. * @stable ICU 2.6 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; //----------------------------------------------------------------------- // public API functions @@ -793,7 +793,7 @@ public: */ virtual UnicodeString& format(int32_t number, UnicodeString& toAppendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats the specified 64-bit number using the default ruleset. @@ -805,7 +805,7 @@ public: */ virtual UnicodeString& format(int64_t number, UnicodeString& toAppendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats the specified number using the default ruleset. * @param number The number to format. @@ -816,7 +816,7 @@ public: */ virtual UnicodeString& format(double number, UnicodeString& toAppendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Formats the specified number using the named ruleset. @@ -888,7 +888,7 @@ protected: virtual UnicodeString& format(const number::impl::DecimalQuantity &number, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& status) const; + UErrorCode& status) const override; public: using NumberFormat::parse; @@ -909,7 +909,7 @@ public: */ virtual void parse(const UnicodeString& text, Formattable& result, - ParsePosition& parsePosition) const; + ParsePosition& parsePosition) const override; #if !UCONFIG_NO_COLLATION @@ -946,7 +946,7 @@ public: * @see RuleBasedCollator * @stable ICU 2.0 */ - virtual void setLenient(UBool enabled); + virtual void setLenient(UBool enabled) override; /** * Returns true if lenient-parse mode is turned on. Lenient parsing is off @@ -955,7 +955,7 @@ public: * @see #setLenient * @stable ICU 2.0 */ - virtual inline UBool isLenient(void) const; + virtual inline UBool isLenient(void) const override; #endif @@ -987,21 +987,21 @@ public: * updated with any new status from the function. * @stable ICU 53 */ - virtual void setContext(UDisplayContext value, UErrorCode& status); + virtual void setContext(UDisplayContext value, UErrorCode& status) override; /** * Get the rounding mode. * @return A rounding mode * @stable ICU 60 */ - virtual ERoundingMode getRoundingMode(void) const; + virtual ERoundingMode getRoundingMode(void) const override; /** * Set the rounding mode. * @param roundingMode A rounding mode * @stable ICU 60 */ - virtual void setRoundingMode(ERoundingMode roundingMode); + virtual void setRoundingMode(ERoundingMode roundingMode) override; public: /** @@ -1016,7 +1016,7 @@ public: * * @stable ICU 2.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Sets the decimal format symbols, which is generally not changed diff --git a/icu4c/source/i18n/unicode/rbtz.h b/icu4c/source/i18n/unicode/rbtz.h index 082e21df95b..17f72ed67c1 100644 --- a/icu4c/source/i18n/unicode/rbtz.h +++ b/icu4c/source/i18n/unicode/rbtz.h @@ -76,7 +76,7 @@ public: *semantically equal. * @stable ICU 3.8 */ - virtual bool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const override; /** * Return true if the given TimeZone objects are @@ -123,7 +123,7 @@ public: * @return A new copy of this TimeZone object. * @stable ICU 3.8 */ - virtual RuleBasedTimeZone* clone() const; + virtual RuleBasedTimeZone* clone() const override; /** * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add @@ -150,7 +150,7 @@ public: * @stable ICU 3.8 */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, - uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const; + uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const override; /** * Gets the time zone offset, for current date, modified in case of @@ -173,7 +173,7 @@ public: */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, - int32_t monthLength, UErrorCode& status) const; + int32_t monthLength, UErrorCode& status) const override; /** * Returns the time zone raw and GMT offset for the given moment @@ -198,7 +198,7 @@ public: * @stable ICU 3.8 */ virtual void getOffset(UDate date, UBool local, int32_t& rawOffset, - int32_t& dstOffset, UErrorCode& ec) const; + int32_t& dstOffset, UErrorCode& ec) const override; /** * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add @@ -207,7 +207,7 @@ public: * @param offsetMillis The new raw GMT offset for this time zone. * @stable ICU 3.8 */ - virtual void setRawOffset(int32_t offsetMillis); + virtual void setRawOffset(int32_t offsetMillis) override; /** * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add @@ -216,7 +216,7 @@ public: * @return The TimeZone's raw GMT offset. * @stable ICU 3.8 */ - virtual int32_t getRawOffset(void) const; + virtual int32_t getRawOffset(void) const override; /** * Queries if this time zone uses daylight savings time. @@ -224,7 +224,7 @@ public: * false, otherwise. * @stable ICU 3.8 */ - virtual UBool useDaylightTime(void) const; + virtual UBool useDaylightTime(void) const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -240,7 +240,7 @@ public: * false, otherwise. * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead. */ - virtual UBool inDaylightTime(UDate date, UErrorCode& status) const; + virtual UBool inDaylightTime(UDate date, UErrorCode& status) const override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -251,7 +251,7 @@ public: * with the possible exception of the ID * @stable ICU 3.8 */ - virtual UBool hasSameRules(const TimeZone& other) const; + virtual UBool hasSameRules(const TimeZone& other) const override; /** * Gets the first time zone transition after the base time. @@ -261,7 +261,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Gets the most recent time zone transition before the base time. @@ -271,7 +271,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Returns the number of TimeZoneRules which represents time transitions, @@ -281,7 +281,7 @@ public: * @return The number of TimeZoneRules representing time transitions. * @stable ICU 3.8 */ - virtual int32_t countTransitionRules(UErrorCode& status) const; + virtual int32_t countTransitionRules(UErrorCode& status) const override; /** * Gets the InitialTimeZoneRule and the set of TimeZoneRule @@ -300,7 +300,7 @@ public: * @stable ICU 3.8 */ virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, - const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const; + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const override; #ifndef U_FORCE_HIDE_DRAFT_API /** @@ -310,7 +310,7 @@ public: virtual void getOffsetFromLocal( UDate date, UTimeZoneLocalOption nonExistingTimeOpt, UTimeZoneLocalOption duplicatedTimeOpt, - int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const; + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const override; #endif /* U_FORCE_HIDE_DRAFT_API */ private: @@ -360,7 +360,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/unicode/regex.h b/icu4c/source/i18n/unicode/regex.h index fc0d380cda0..f8e32922f4e 100644 --- a/icu4c/source/i18n/unicode/regex.h +++ b/icu4c/source/i18n/unicode/regex.h @@ -569,7 +569,7 @@ public: * * @stable ICU 2.4 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -1746,7 +1746,7 @@ public: * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: // Constructors and other object boilerplate are private. diff --git a/icu4c/source/i18n/unicode/scientificnumberformatter.h b/icu4c/source/i18n/unicode/scientificnumberformatter.h index 7f860d4f592..aa7e80543e4 100644 --- a/icu4c/source/i18n/unicode/scientificnumberformatter.h +++ b/icu4c/source/i18n/unicode/scientificnumberformatter.h @@ -159,14 +159,14 @@ public: class U_I18N_API SuperscriptStyle : public Style { public: - virtual SuperscriptStyle *clone() const; + virtual SuperscriptStyle *clone() const override; protected: virtual UnicodeString &format( const UnicodeString &original, FieldPositionIterator &fpi, const UnicodeString &preExponent, UnicodeString &appendTo, - UErrorCode &status) const; + UErrorCode &status) const override; }; class U_I18N_API MarkupStyle : public Style { @@ -177,14 +177,14 @@ public: : Style(), fBeginMarkup(beginMarkup), fEndMarkup(endMarkup) { } - virtual MarkupStyle *clone() const; + virtual MarkupStyle *clone() const override; protected: virtual UnicodeString &format( const UnicodeString &original, FieldPositionIterator &fpi, const UnicodeString &preExponent, UnicodeString &appendTo, - UErrorCode &status) const; + UErrorCode &status) const override; private: UnicodeString fBeginMarkup; UnicodeString fEndMarkup; diff --git a/icu4c/source/i18n/unicode/selfmt.h b/icu4c/source/i18n/unicode/selfmt.h index 10c2ddff9f8..bdce00e593e 100644 --- a/icu4c/source/i18n/unicode/selfmt.h +++ b/icu4c/source/i18n/unicode/selfmt.h @@ -259,7 +259,7 @@ public: * @return true if other is semantically equal to this. * @stable ICU 4.4 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Return true if another object is semantically unequal to this one. @@ -275,7 +275,7 @@ public: * result and should delete it when done. * @stable ICU 4.4 */ - virtual SelectFormat* clone() const; + virtual SelectFormat* clone() const override; /** * Format an object to produce a string. @@ -295,7 +295,7 @@ public: UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, FieldPosition& pos, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Returns the pattern from applyPattern() or constructor. @@ -331,7 +331,7 @@ public: */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& parse_pos) const; + ParsePosition& parse_pos) const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -343,7 +343,7 @@ public: * ICU "poor man's RTTI", returns a UClassID for the actual class. * @stable ICU 4.4 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; private: friend class MessageFormat; diff --git a/icu4c/source/i18n/unicode/simpletz.h b/icu4c/source/i18n/unicode/simpletz.h index 8ead876a0ec..f5c155de466 100644 --- a/icu4c/source/i18n/unicode/simpletz.h +++ b/icu4c/source/i18n/unicode/simpletz.h @@ -111,7 +111,7 @@ public: * otherwise. * @stable ICU 2.0 */ - virtual bool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const override; /** * Constructs a SimpleTimeZone with the given raw GMT offset and time zone ID, @@ -571,7 +571,7 @@ public: * @stable ICU 2.0 */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, - uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const; + uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const override; /** * Gets the time zone offset, for current date, modified in case of @@ -590,7 +590,7 @@ public: */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t milliseconds, - int32_t monthLength, UErrorCode& status) const; + int32_t monthLength, UErrorCode& status) const override; /** * Gets the time zone offset, for current date, modified in case of * daylight savings. This is the offset to add *to* UTC to get local time. @@ -618,7 +618,7 @@ public: * @stable ICU 2.8 */ virtual void getOffset(UDate date, UBool local, int32_t& rawOffset, - int32_t& dstOffset, UErrorCode& ec) const; + int32_t& dstOffset, UErrorCode& ec) const override; #ifndef U_FORCE_HIDE_DRAFT_API /** @@ -628,7 +628,7 @@ public: virtual void getOffsetFromLocal( UDate date, UTimeZoneLocalOption nonExistingTimeOpt, UTimeZoneLocalOption duplicatedTimeOpt, - int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const; + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const override; #endif /* U_FORCE_HIDE_DRAFT_API */ /** @@ -638,7 +638,7 @@ public: * @return The TimeZone's raw GMT offset. * @stable ICU 2.0 */ - virtual int32_t getRawOffset(void) const; + virtual int32_t getRawOffset(void) const override; /** * Sets the TimeZone's raw GMT offset (i.e., the number of milliseconds to add @@ -647,7 +647,7 @@ public: * @param offsetMillis The new raw GMT offset for this time zone. * @stable ICU 2.0 */ - virtual void setRawOffset(int32_t offsetMillis); + virtual void setRawOffset(int32_t offsetMillis) override; /** * Sets the amount of time in ms that the clock is advanced during DST. @@ -668,7 +668,7 @@ public: * but not 0. * @stable ICU 2.0 */ - virtual int32_t getDSTSavings(void) const; + virtual int32_t getDSTSavings(void) const override; /** * Queries if this TimeZone uses Daylight Savings Time. @@ -676,7 +676,7 @@ public: * @return True if this TimeZone uses Daylight Savings Time; false otherwise. * @stable ICU 2.0 */ - virtual UBool useDaylightTime(void) const; + virtual UBool useDaylightTime(void) const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -693,7 +693,7 @@ public: * false otherwise. * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead. */ - virtual UBool inDaylightTime(UDate date, UErrorCode& status) const; + virtual UBool inDaylightTime(UDate date, UErrorCode& status) const override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -702,7 +702,7 @@ public: * @return true if the given zone has the same rules and offset as this one * @stable ICU 2.0 */ - UBool hasSameRules(const TimeZone& other) const; + UBool hasSameRules(const TimeZone& other) const override; /** * Clones TimeZone objects polymorphically. Clients are responsible for deleting @@ -711,7 +711,7 @@ public: * @return A new copy of this TimeZone object. * @stable ICU 2.0 */ - virtual SimpleTimeZone* clone() const; + virtual SimpleTimeZone* clone() const override; /** * Gets the first time zone transition after the base time. @@ -721,7 +721,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Gets the most recent time zone transition before the base time. @@ -731,7 +731,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Returns the number of TimeZoneRules which represents time transitions, @@ -741,7 +741,7 @@ public: * @return The number of TimeZoneRules representing time transitions. * @stable ICU 3.8 */ - virtual int32_t countTransitionRules(UErrorCode& status) const; + virtual int32_t countTransitionRules(UErrorCode& status) const override; /** * Gets the InitialTimeZoneRule and the set of TimeZoneRule @@ -760,7 +760,7 @@ public: * @stable ICU 3.8 */ virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, - const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const; + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const override; public: @@ -775,7 +775,7 @@ public: * same class ID. Objects of other classes have different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Return the class ID for this class. This is useful only for comparing to a return diff --git a/icu4c/source/i18n/unicode/smpdtfmt.h b/icu4c/source/i18n/unicode/smpdtfmt.h index a2269d637b7..733a1cff13b 100644 --- a/icu4c/source/i18n/unicode/smpdtfmt.h +++ b/icu4c/source/i18n/unicode/smpdtfmt.h @@ -867,7 +867,7 @@ public: * @return A copy of the object. * @stable ICU 2.0 */ - virtual SimpleDateFormat* clone() const; + virtual SimpleDateFormat* clone() const override; /** * Return true if the given Format objects are semantically equal. Objects @@ -876,7 +876,7 @@ public: * @return true if the given Format objects are semantically equal. * @stable ICU 2.0 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; using DateFormat::format; @@ -899,7 +899,7 @@ public: */ virtual UnicodeString& format( Calendar& cal, UnicodeString& appendTo, - FieldPosition& pos) const; + FieldPosition& pos) const override; /** * Format a date or time, which is the standard millis since 24:00 GMT, Jan @@ -922,7 +922,7 @@ public: virtual UnicodeString& format( Calendar& cal, UnicodeString& appendTo, FieldPositionIterator* posIter, - UErrorCode& status) const; + UErrorCode& status) const override; using DateFormat::parse; @@ -954,7 +954,7 @@ public: */ virtual void parse( const UnicodeString& text, Calendar& cal, - ParsePosition& pos) const; + ParsePosition& pos) const override; /** @@ -1097,7 +1097,7 @@ public: * other classes have different class IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Set the calendar to be used by this date format. Initially, the default @@ -1108,7 +1108,7 @@ public: * @param calendarToAdopt Calendar object to be adopted. * @stable ICU 2.0 */ - virtual void adoptCalendar(Calendar* calendarToAdopt); + virtual void adoptCalendar(Calendar* calendarToAdopt) override; /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following methods since they are virtual */ /** @@ -1144,7 +1144,7 @@ public: * updated with any new status from the function. * @stable ICU 53 */ - virtual void setContext(UDisplayContext value, UErrorCode& status); + virtual void setContext(UDisplayContext value, UErrorCode& status) override; /** * Overrides base class method and @@ -1153,7 +1153,7 @@ public: * @param formatToAdopt the NumbeferFormat used * @stable ICU 54 */ - void adoptNumberFormat(NumberFormat *formatToAdopt); + void adoptNumberFormat(NumberFormat *formatToAdopt) override; /** * Allow the user to set the NumberFormat for several fields diff --git a/icu4c/source/i18n/unicode/sortkey.h b/icu4c/source/i18n/unicode/sortkey.h index 8ab8459e5c0..b1231f18b78 100644 --- a/icu4c/source/i18n/unicode/sortkey.h +++ b/icu4c/source/i18n/unicode/sortkey.h @@ -237,7 +237,7 @@ public: * ICU "poor man's RTTI", returns a UClassID for the actual class. * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. diff --git a/icu4c/source/i18n/unicode/stsearch.h b/icu4c/source/i18n/unicode/stsearch.h index 69b75db605a..af1b2d4eabc 100644 --- a/icu4c/source/i18n/unicode/stsearch.h +++ b/icu4c/source/i18n/unicode/stsearch.h @@ -297,7 +297,7 @@ public: * while looking for the same pattern. * @stable ICU 2.0 */ - virtual bool operator==(const SearchIterator &that) const; + virtual bool operator==(const SearchIterator &that) const override; // public get and set methods ---------------------------------------- @@ -314,7 +314,7 @@ public: * @param status for errors if it occurs * @stable ICU 2.0 */ - virtual void setOffset(int32_t position, UErrorCode &status); + virtual void setOffset(int32_t position, UErrorCode &status) override; /** * Return the current index in the text being searched. @@ -324,7 +324,7 @@ public: * @return current index in the text being searched. * @stable ICU 2.0 */ - virtual int32_t getOffset(void) const; + virtual int32_t getOffset(void) const override; /** * Set the target text to be searched. @@ -337,7 +337,7 @@ public: * U_ILLEGAL_ARGUMENT_ERROR is returned. * @stable ICU 2.0 */ - virtual void setText(const UnicodeString &text, UErrorCode &status); + virtual void setText(const UnicodeString &text, UErrorCode &status) override; /** * Set the target text to be searched. @@ -353,7 +353,7 @@ public: * U_ILLEGAL_ARGUMENT_ERROR is returned. * @stable ICU 2.0 */ - virtual void setText(CharacterIterator &text, UErrorCode &status); + virtual void setText(CharacterIterator &text, UErrorCode &status) override; /** * Gets the collator used for the language rules. @@ -403,7 +403,7 @@ public: * search will begin at the end of the text string. * @stable ICU 2.0 */ - virtual void reset(); + virtual void reset() override; /** * Returns a copy of StringSearch with the same behavior, and @@ -413,14 +413,14 @@ public: * @return cloned object * @stable ICU 2.0 */ - virtual StringSearch * safeClone() const; + virtual StringSearch * safeClone() const override; /** * ICU "poor man's RTTI", returns a UClassID for the actual class. * * @stable ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -455,7 +455,7 @@ protected: * USEARCH_DONE if no match was found. * @stable ICU 2.0 */ - virtual int32_t handleNext(int32_t position, UErrorCode &status); + virtual int32_t handleNext(int32_t position, UErrorCode &status) override; /** * Search backward for matching text, starting at a given location. @@ -479,7 +479,7 @@ protected: * USEARCH_DONE if no match was found. * @stable ICU 2.0 */ - virtual int32_t handlePrev(int32_t position, UErrorCode &status); + virtual int32_t handlePrev(int32_t position, UErrorCode &status) override; private : StringSearch(); // default constructor not implemented diff --git a/icu4c/source/i18n/unicode/tblcoll.h b/icu4c/source/i18n/unicode/tblcoll.h index 8e1d0822ae8..2de1af85392 100644 --- a/icu4c/source/i18n/unicode/tblcoll.h +++ b/icu4c/source/i18n/unicode/tblcoll.h @@ -223,14 +223,14 @@ public: * @return true if arguments is the same as this object. * @stable ICU 2.0 */ - virtual bool operator==(const Collator& other) const; + virtual bool operator==(const Collator& other) const override; /** * Makes a copy of this object. * @return a copy of this object, owned by the caller * @stable ICU 2.0 */ - virtual RuleBasedCollator* clone() const; + virtual RuleBasedCollator* clone() const override; /** * Creates a collation element iterator for the source string. The caller of @@ -274,7 +274,7 @@ public: **/ virtual UCollationResult compare(const UnicodeString& source, const UnicodeString& target, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Does the same thing as compare but limits the comparison to a specified @@ -292,7 +292,7 @@ public: virtual UCollationResult compare(const UnicodeString& source, const UnicodeString& target, int32_t length, - UErrorCode &status) const; + UErrorCode &status) const override; /** * The comparison function compares the character data stored in two @@ -312,7 +312,7 @@ public: */ virtual UCollationResult compare(const char16_t* source, int32_t sourceLength, const char16_t* target, int32_t targetLength, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Compares two strings using the Collator. @@ -327,7 +327,7 @@ public: */ virtual UCollationResult compare(UCharIterator &sIter, UCharIterator &tIter, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Compares two UTF-8 strings using the Collator. @@ -344,7 +344,7 @@ public: */ virtual UCollationResult compareUTF8(const StringPiece &source, const StringPiece &target, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Transforms the string into a series of characters @@ -362,7 +362,7 @@ public: */ virtual CollationKey& getCollationKey(const UnicodeString& source, CollationKey& key, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Transforms a specified region of the string into a series of characters @@ -382,14 +382,14 @@ public: virtual CollationKey& getCollationKey(const char16_t *source, int32_t sourceLength, CollationKey& key, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Generates the hash code for the rule-based collation object. * @return the hash code. * @stable ICU 2.0 */ - virtual int32_t hashCode() const; + virtual int32_t hashCode() const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -402,7 +402,7 @@ public: * was instantiated from rules, locale is empty. * @deprecated ICU 2.8 likely to change in ICU 3.0, based on feedback */ - virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const; + virtual Locale getLocale(ULocDataLocaleType type, UErrorCode& status) const override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -417,7 +417,7 @@ public: * @param info the version # information, the result will be filled in * @stable ICU 2.0 */ - virtual void getVersion(UVersionInfo info) const; + virtual void getVersion(UVersionInfo info) const override; #ifndef U_HIDE_DEPRECATED_API /** @@ -449,7 +449,7 @@ public: * IDs. * @stable ICU 2.0 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** * Returns the class ID for this class. This is useful only for comparing to @@ -511,7 +511,7 @@ public: * @stable ICU 2.2 */ virtual void setAttribute(UColAttribute attr, UColAttributeValue value, - UErrorCode &status); + UErrorCode &status) override; /** * Universal attribute getter. @@ -521,7 +521,7 @@ public: * @stable ICU 2.2 */ virtual UColAttributeValue getAttribute(UColAttribute attr, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Sets the variable top to the top of the specified reordering group. @@ -539,7 +539,7 @@ public: * @see getMaxVariable * @stable ICU 53 */ - virtual Collator &setMaxVariable(UColReorderCode group, UErrorCode &errorCode); + virtual Collator &setMaxVariable(UColReorderCode group, UErrorCode &errorCode) override; /** * Returns the maximum reordering group whose characters are affected by UCOL_ALTERNATE_HANDLING. @@ -547,7 +547,7 @@ public: * @see setMaxVariable * @stable ICU 53 */ - virtual UColReorderCode getMaxVariable() const; + virtual UColReorderCode getMaxVariable() const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -566,7 +566,7 @@ public: * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status); + virtual uint32_t setVariableTop(const char16_t *varTop, int32_t len, UErrorCode &status) override; /** * Sets the variable top to the primary weight of the specified string. @@ -583,7 +583,7 @@ public: * @return variable top primary weight * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status); + virtual uint32_t setVariableTop(const UnicodeString &varTop, UErrorCode &status) override; /** * Sets the variable top to the specified primary weight. @@ -596,7 +596,7 @@ public: * @param status error code * @deprecated ICU 53 Call setMaxVariable() instead. */ - virtual void setVariableTop(uint32_t varTop, UErrorCode &status); + virtual void setVariableTop(uint32_t varTop, UErrorCode &status) override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -606,7 +606,7 @@ public: * @see getMaxVariable * @stable ICU 2.0 */ - virtual uint32_t getVariableTop(UErrorCode &status) const; + virtual uint32_t getVariableTop(UErrorCode &status) const override; /** * Get a UnicodeSet that contains all the characters and sequences tailored in @@ -617,7 +617,7 @@ public: * in the root collator. The object must be disposed of by using delete * @stable ICU 2.4 */ - virtual UnicodeSet *getTailoredSet(UErrorCode &status) const; + virtual UnicodeSet *getTailoredSet(UErrorCode &status) const override; /** * Get the sort key as an array of bytes from a UnicodeString. @@ -634,7 +634,7 @@ public: * @stable ICU 2.0 */ virtual int32_t getSortKey(const UnicodeString& source, uint8_t *result, - int32_t resultLength) const; + int32_t resultLength) const override; /** * Get the sort key as an array of bytes from a char16_t buffer. @@ -653,7 +653,7 @@ public: * @stable ICU 2.2 */ virtual int32_t getSortKey(const char16_t *source, int32_t sourceLength, - uint8_t *result, int32_t resultLength) const; + uint8_t *result, int32_t resultLength) const override; /** * Retrieves the reordering codes for this collator. @@ -670,7 +670,7 @@ public: */ virtual int32_t getReorderCodes(int32_t *dest, int32_t destCapacity, - UErrorCode& status) const; + UErrorCode& status) const override; /** * Sets the ordering of scripts for this collator. @@ -685,7 +685,7 @@ public: */ virtual void setReorderCodes(const int32_t* reorderCodes, int32_t reorderCodesLength, - UErrorCode& status) ; + UErrorCode& status) override; /** * Implements ucol_strcollUTF8(). @@ -694,7 +694,7 @@ public: virtual UCollationResult internalCompareUTF8( const char *left, int32_t leftLength, const char *right, int32_t rightLength, - UErrorCode &errorCode) const; + UErrorCode &errorCode) const override; /** Get the short definition string for a collator. This internal API harvests the collator's * locale and the attribute set and produces a string that can be used for opening @@ -722,7 +722,7 @@ public: virtual int32_t internalGetShortDefinitionString(const char *locale, char *buffer, int32_t capacity, - UErrorCode &status) const; + UErrorCode &status) const override; /** * Implements ucol_nextSortKeyPart(). @@ -730,7 +730,7 @@ public: */ virtual int32_t internalNextSortKeyPart( UCharIterator *iter, uint32_t state[2], - uint8_t *dest, int32_t count, UErrorCode &errorCode) const; + uint8_t *dest, int32_t count, UErrorCode &errorCode) const override; // Do not enclose the default constructor with #ifndef U_HIDE_INTERNAL_API /** @@ -806,7 +806,7 @@ protected: * @param actualLocale the actual locale * @internal */ - virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale); + virtual void setLocales(const Locale& requestedLocale, const Locale& validLocale, const Locale& actualLocale) override; private: friend class CollationElementIterator; diff --git a/icu4c/source/i18n/unicode/tmunit.h b/icu4c/source/i18n/unicode/tmunit.h index 2e949ddfbd5..24abb49f198 100644 --- a/icu4c/source/i18n/unicode/tmunit.h +++ b/icu4c/source/i18n/unicode/tmunit.h @@ -73,7 +73,7 @@ public: * Override clone. * @stable ICU 4.2 */ - virtual TimeUnit* clone() const; + virtual TimeUnit* clone() const override; /** * Copy operator. @@ -95,7 +95,7 @@ public: * different class IDs. * @stable ICU 4.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * Returns the class ID for this class. This is used to compare to diff --git a/icu4c/source/i18n/unicode/tmutamt.h b/icu4c/source/i18n/unicode/tmutamt.h index 4f7124f39d8..88e892fb0c2 100644 --- a/icu4c/source/i18n/unicode/tmutamt.h +++ b/icu4c/source/i18n/unicode/tmutamt.h @@ -87,7 +87,7 @@ public: * @return a polymorphic clone of this object. The result will have the same class as returned by getDynamicClassID(). * @stable ICU 4.2 */ - virtual TimeUnitAmount* clone() const; + virtual TimeUnitAmount* clone() const override; /** @@ -140,7 +140,7 @@ public: * other classes have different class IDs. * @stable ICU 4.2 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; /** diff --git a/icu4c/source/i18n/unicode/tmutfmt.h b/icu4c/source/i18n/unicode/tmutfmt.h index 24ba906b5ea..02e0563a010 100644 --- a/icu4c/source/i18n/unicode/tmutfmt.h +++ b/icu4c/source/i18n/unicode/tmutfmt.h @@ -126,7 +126,7 @@ public: * @return A copy of the object. * @deprecated ICU 53 */ - virtual TimeUnitFormat* clone() const; + virtual TimeUnitFormat* clone() const override; /** * Assignment operator @@ -158,7 +158,7 @@ public: */ virtual void parseObject(const UnicodeString& source, Formattable& result, - ParsePosition& pos) const; + ParsePosition& pos) const override; /** * Return the class ID for this class. This is useful only for comparing to @@ -184,7 +184,7 @@ public: * other classes have different class IDs. * @deprecated ICU 53 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; private: Hashtable* fTimeUnitToCountToPatterns[TimeUnit::UTIMEUNIT_FIELD_COUNT]; diff --git a/icu4c/source/i18n/unicode/tzfmt.h b/icu4c/source/i18n/unicode/tzfmt.h index d3cfda65227..6db8477026a 100644 --- a/icu4c/source/i18n/unicode/tzfmt.h +++ b/icu4c/source/i18n/unicode/tzfmt.h @@ -299,7 +299,7 @@ public: * Objects of different subclasses are considered unequal. * @stable ICU 50 */ - virtual bool operator==(const Format& other) const; + virtual bool operator==(const Format& other) const override; /** * Clone this object polymorphically. The caller is responsible @@ -307,7 +307,7 @@ public: * @return A copy of the object * @stable ICU 50 */ - virtual TimeZoneFormat* clone() const; + virtual TimeZoneFormat* clone() const override; /** * Creates an instance of TimeZoneFormat for the given locale. @@ -636,7 +636,7 @@ public: * @stable ICU 50 */ virtual UnicodeString& format(const Formattable& obj, UnicodeString& appendTo, - FieldPosition& pos, UErrorCode& status) const; + FieldPosition& pos, UErrorCode& status) const override; /** * Parse a string to produce an object. This methods handles parsing of @@ -650,7 +650,7 @@ public: * delete it when done. * @stable ICU 50 */ - virtual void parseObject(const UnicodeString& source, Formattable& result, ParsePosition& parse_pos) const; + virtual void parseObject(const UnicodeString& source, Formattable& result, ParsePosition& parse_pos) const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -662,7 +662,7 @@ public: * ICU "poor man's RTTI", returns a UClassID for the actual class. * @stable ICU 50 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; protected: /** diff --git a/icu4c/source/i18n/unicode/tzrule.h b/icu4c/source/i18n/unicode/tzrule.h index 676b092309c..ab0b97b6fd2 100644 --- a/icu4c/source/i18n/unicode/tzrule.h +++ b/icu4c/source/i18n/unicode/tzrule.h @@ -231,7 +231,7 @@ public: * @return A copy of the object. * @stable ICU 3.8 */ - virtual InitialTimeZoneRule* clone() const; + virtual InitialTimeZoneRule* clone() const override; /** * Assignment operator. @@ -247,7 +247,7 @@ public: * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual bool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const override; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -256,7 +256,7 @@ public: * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual bool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const override; /** * Gets the time when this rule takes effect in the given year. @@ -280,7 +280,7 @@ public: * @return true if the other TimeZoneRule is equivalent to this one. * @stable ICU 3.8 */ - virtual UBool isEquivalentTo(const TimeZoneRule& that) const; + virtual UBool isEquivalentTo(const TimeZoneRule& that) const override; /** * Gets the very first time when this rule takes effect. @@ -293,7 +293,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the final time when this rule takes effect. @@ -306,7 +306,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the first time when this rule takes effect after the specified time. @@ -323,7 +323,7 @@ public: * @stable ICU 3.8 */ virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; /** * Gets the most recent time when this rule takes effect before the specified time. @@ -340,7 +340,7 @@ public: * @stable ICU 3.8 */ virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; public: /** @@ -367,7 +367,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; /** @@ -442,7 +442,7 @@ public: * @return A copy of the object. * @stable ICU 3.8 */ - virtual AnnualTimeZoneRule* clone() const; + virtual AnnualTimeZoneRule* clone() const override; /** * Assignment operator. @@ -458,7 +458,7 @@ public: * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual bool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const override; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -467,7 +467,7 @@ public: * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual bool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const override; /** * Gets the start date/time rule used by this rule. @@ -515,7 +515,7 @@ public: * @return true if the other TimeZoneRule is equivalent to this one. * @stable ICU 3.8 */ - virtual UBool isEquivalentTo(const TimeZoneRule& that) const; + virtual UBool isEquivalentTo(const TimeZoneRule& that) const override; /** * Gets the very first time when this rule takes effect. @@ -528,7 +528,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the final time when this rule takes effect. @@ -541,7 +541,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the first time when this rule takes effect after the specified time. @@ -558,7 +558,7 @@ public: * @stable ICU 3.8 */ virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; /** * Gets the most recent time when this rule takes effect before the specified time. @@ -575,7 +575,7 @@ public: * @stable ICU 3.8 */ virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; private: @@ -608,7 +608,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; /** @@ -658,7 +658,7 @@ public: * @return A copy of the object. * @stable ICU 3.8 */ - virtual TimeArrayTimeZoneRule* clone() const; + virtual TimeArrayTimeZoneRule* clone() const override; /** * Assignment operator. @@ -674,7 +674,7 @@ public: * @return true if the given TimeZoneRule objects are semantically equal. * @stable ICU 3.8 */ - virtual bool operator==(const TimeZoneRule& that) const; + virtual bool operator==(const TimeZoneRule& that) const override; /** * Return true if the given TimeZoneRule objects are semantically unequal. Objects @@ -683,7 +683,7 @@ public: * @return true if the given TimeZoneRule objects are semantically unequal. * @stable ICU 3.8 */ - virtual bool operator!=(const TimeZoneRule& that) const; + virtual bool operator!=(const TimeZoneRule& that) const override; /** * Gets the time type of the start times used by this rule. The return value @@ -721,7 +721,7 @@ public: * @return true if the other TimeZoneRule is equivalent to this one. * @stable ICU 3.8 */ - virtual UBool isEquivalentTo(const TimeZoneRule& that) const; + virtual UBool isEquivalentTo(const TimeZoneRule& that) const override; /** * Gets the very first time when this rule takes effect. @@ -734,7 +734,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFirstStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the final time when this rule takes effect. @@ -747,7 +747,7 @@ public: * "result" is unchanged. * @stable ICU 3.8 */ - virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const; + virtual UBool getFinalStart(int32_t prevRawOffset, int32_t prevDSTSavings, UDate& result) const override; /** * Gets the first time when this rule takes effect after the specified time. @@ -764,7 +764,7 @@ public: * @stable ICU 3.8 */ virtual UBool getNextStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; /** * Gets the most recent time when this rule takes effect before the specified time. @@ -781,7 +781,7 @@ public: * @stable ICU 3.8 */ virtual UBool getPreviousStart(UDate base, int32_t prevRawOffset, int32_t prevDSTSavings, - UBool inclusive, UDate& result) const; + UBool inclusive, UDate& result) const override; private: @@ -819,7 +819,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; diff --git a/icu4c/source/i18n/unicode/tztrans.h b/icu4c/source/i18n/unicode/tztrans.h index 03d96184653..5adbeb35e43 100644 --- a/icu4c/source/i18n/unicode/tztrans.h +++ b/icu4c/source/i18n/unicode/tztrans.h @@ -187,7 +187,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/unicode/vtzone.h b/icu4c/source/i18n/unicode/vtzone.h index b72ab9ae5de..e7d2f515410 100644 --- a/icu4c/source/i18n/unicode/vtzone.h +++ b/icu4c/source/i18n/unicode/vtzone.h @@ -72,7 +72,7 @@ public: *semantically equal. * @stable ICU 3.8 */ - virtual bool operator==(const TimeZone& that) const; + virtual bool operator==(const TimeZone& that) const override; /** * Return true if the given TimeZone objects are @@ -187,7 +187,7 @@ public: * @return A new copy of this TimeZone object. * @stable ICU 3.8 */ - virtual VTimeZone* clone() const; + virtual VTimeZone* clone() const override; /** * Returns the TimeZone's adjusted GMT offset (i.e., the number of milliseconds to add @@ -214,7 +214,7 @@ public: * @stable ICU 3.8 */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, - uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const; + uint8_t dayOfWeek, int32_t millis, UErrorCode& status) const override; /** * Gets the time zone offset, for current date, modified in case of @@ -237,7 +237,7 @@ public: */ virtual int32_t getOffset(uint8_t era, int32_t year, int32_t month, int32_t day, uint8_t dayOfWeek, int32_t millis, - int32_t monthLength, UErrorCode& status) const; + int32_t monthLength, UErrorCode& status) const override; /** * Returns the time zone raw and GMT offset for the given moment @@ -262,7 +262,7 @@ public: * @stable ICU 3.8 */ virtual void getOffset(UDate date, UBool local, int32_t& rawOffset, - int32_t& dstOffset, UErrorCode& ec) const; + int32_t& dstOffset, UErrorCode& ec) const override; #ifndef U_FORCE_HIDE_DRAFT_API /** @@ -272,7 +272,7 @@ public: virtual void getOffsetFromLocal( UDate date, UTimeZoneLocalOption nonExistingTimeOpt, UTimeZoneLocalOption duplicatedTimeOpt, - int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const; + int32_t& rawOffset, int32_t& dstOffset, UErrorCode& status) const override; #endif /* U_FORCE_HIDE_DRAFT_API */ /** @@ -282,7 +282,7 @@ public: * @param offsetMillis The new raw GMT offset for this time zone. * @stable ICU 3.8 */ - virtual void setRawOffset(int32_t offsetMillis); + virtual void setRawOffset(int32_t offsetMillis) override; /** * Returns the TimeZone's raw GMT offset (i.e., the number of milliseconds to add @@ -291,7 +291,7 @@ public: * @return The TimeZone's raw GMT offset. * @stable ICU 3.8 */ - virtual int32_t getRawOffset(void) const; + virtual int32_t getRawOffset(void) const override; /** * Queries if this time zone uses daylight savings time. @@ -299,7 +299,7 @@ public: * false, otherwise. * @stable ICU 3.8 */ - virtual UBool useDaylightTime(void) const; + virtual UBool useDaylightTime(void) const override; #ifndef U_FORCE_HIDE_DEPRECATED_API /** @@ -315,7 +315,7 @@ public: * false, otherwise. * @deprecated ICU 2.4. Use Calendar::inDaylightTime() instead. */ - virtual UBool inDaylightTime(UDate date, UErrorCode& status) const; + virtual UBool inDaylightTime(UDate date, UErrorCode& status) const override; #endif // U_FORCE_HIDE_DEPRECATED_API /** @@ -326,7 +326,7 @@ public: * with the possible exception of the ID * @stable ICU 3.8 */ - virtual UBool hasSameRules(const TimeZone& other) const; + virtual UBool hasSameRules(const TimeZone& other) const override; /** * Gets the first time zone transition after the base time. @@ -336,7 +336,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getNextTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Gets the most recent time zone transition before the base time. @@ -346,7 +346,7 @@ public: * @return true if the transition is found. * @stable ICU 3.8 */ - virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const; + virtual UBool getPreviousTransition(UDate base, UBool inclusive, TimeZoneTransition& result) const override; /** * Returns the number of TimeZoneRules which represents time transitions, @@ -356,7 +356,7 @@ public: * @return The number of TimeZoneRules representing time transitions. * @stable ICU 3.8 */ - virtual int32_t countTransitionRules(UErrorCode& status) const; + virtual int32_t countTransitionRules(UErrorCode& status) const override; /** * Gets the InitialTimeZoneRule and the set of TimeZoneRule @@ -375,7 +375,7 @@ public: * @stable ICU 3.8 */ virtual void getTimeZoneRules(const InitialTimeZoneRule*& initial, - const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const; + const TimeZoneRule* trsrules[], int32_t& trscount, UErrorCode& status) const override; private: enum { DEFAULT_VTIMEZONE_LINES = 100 }; @@ -461,7 +461,7 @@ public: * other classes have different class IDs. * @stable ICU 3.8 */ - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; }; U_NAMESPACE_END diff --git a/icu4c/source/i18n/units_data.cpp b/icu4c/source/i18n/units_data.cpp index 61f537479fa..d1d1fc5bc05 100644 --- a/icu4c/source/i18n/units_data.cpp +++ b/icu4c/source/i18n/units_data.cpp @@ -59,7 +59,7 @@ class ConversionRateDataSink : public ResourceSink { * @param noFallback Ignored. * @param status The standard ICU error code output parameter. */ - void put(const char *source, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) { + void put(const char *source, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) override { if (U_FAILURE(status)) { return; } if (uprv_strcmp(source, "convertUnits") != 0) { // This is very strict, however it is the cheapest way to be sure @@ -146,7 +146,7 @@ class UnitPreferencesSink : public ResourceSink { * @param status The standard ICU error code output parameter. Note: if an * error is returned, outPrefs and outMetadata may be inconsistent. */ - void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) { + void put(const char *key, ResourceValue &value, UBool /*noFallback*/, UErrorCode &status) override { if (U_FAILURE(status)) { return; } if (uprv_strcmp(key, "unitPreferenceData") != 0) { // This is very strict, however it is the cheapest way to be sure diff --git a/icu4c/source/i18n/uspoof_impl.h b/icu4c/source/i18n/uspoof_impl.h index 7002c945d1d..e75ae262bdd 100644 --- a/icu4c/source/i18n/uspoof_impl.h +++ b/icu4c/source/i18n/uspoof_impl.h @@ -93,7 +93,7 @@ public: static UChar32 ScanHex(const UChar *s, int32_t start, int32_t limit, UErrorCode &status); static UClassID U_EXPORT2 getStaticClassID(void); - virtual UClassID getDynamicClassID(void) const; + virtual UClassID getDynamicClassID(void) const override; // // Data Members diff --git a/icu4c/source/i18n/utf16collationiterator.h b/icu4c/source/i18n/utf16collationiterator.h index 5bb7ab1eebf..6db70511b0d 100644 --- a/icu4c/source/i18n/utf16collationiterator.h +++ b/icu4c/source/i18n/utf16collationiterator.h @@ -42,11 +42,11 @@ public: virtual ~UTF16CollationIterator(); - virtual bool operator==(const CollationIterator &other) const; + virtual bool operator==(const CollationIterator &other) const override; - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; void setText(const UChar *s, const UChar *lim) { reset(); @@ -54,9 +54,9 @@ public: limit = lim; } - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: // Copy constructor only for subclasses which set the pointers. @@ -64,15 +64,15 @@ protected: : CollationIterator(other), start(NULL), pos(NULL), limit(NULL) {} - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UChar handleGetTrailSurrogate(); + virtual UChar handleGetTrailSurrogate() override; - virtual UBool foundNULTerminator(); + virtual UBool foundNULTerminator() override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; // UTF-16 string pointers. // limit can be NULL for NUL-terminated strings. @@ -95,24 +95,24 @@ public: virtual ~FCDUTF16CollationIterator(); - virtual bool operator==(const CollationIterator &other) const; + virtual bool operator==(const CollationIterator &other) const override; - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UBool foundNULTerminator(); + virtual UBool foundNULTerminator() override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; private: /** diff --git a/icu4c/source/i18n/utf8collationiterator.h b/icu4c/source/i18n/utf8collationiterator.h index 9059e72dcf9..09cfce4369f 100644 --- a/icu4c/source/i18n/utf8collationiterator.h +++ b/icu4c/source/i18n/utf8collationiterator.h @@ -40,13 +40,13 @@ public: virtual ~UTF8CollationIterator(); - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: /** @@ -59,15 +59,15 @@ protected: * Valid lead surrogates are returned from inside a normalized text segment, * where handleGetTrailSurrogate() will return the matching trail surrogate. */ - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UBool foundNULTerminator(); + virtual UBool foundNULTerminator() override; - virtual UBool forbidSurrogateCodePoints() const; + virtual UBool forbidSurrogateCodePoints() const override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; const uint8_t *u8; int32_t pos; @@ -87,24 +87,24 @@ public: virtual ~FCDUTF8CollationIterator(); - virtual void resetToOffset(int32_t newOffset); + virtual void resetToOffset(int32_t newOffset) override; - virtual int32_t getOffset() const; + virtual int32_t getOffset() const override; - virtual UChar32 nextCodePoint(UErrorCode &errorCode); + virtual UChar32 nextCodePoint(UErrorCode &errorCode) override; - virtual UChar32 previousCodePoint(UErrorCode &errorCode); + virtual UChar32 previousCodePoint(UErrorCode &errorCode) override; protected: - virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode); + virtual uint32_t handleNextCE32(UChar32 &c, UErrorCode &errorCode) override; - virtual UChar handleGetTrailSurrogate(); + virtual UChar handleGetTrailSurrogate() override; - virtual UBool foundNULTerminator(); + virtual UBool foundNULTerminator() override; - virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void forwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; - virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode); + virtual void backwardNumCodePoints(int32_t num, UErrorCode &errorCode) override; private: UBool nextHasLccc() const; diff --git a/icu4c/source/i18n/utrans.cpp b/icu4c/source/i18n/utrans.cpp index 29013ead125..1cbba81d658 100644 --- a/icu4c/source/i18n/utrans.cpp +++ b/icu4c/source/i18n/utrans.cpp @@ -52,13 +52,13 @@ public: virtual void handleReplaceBetween(int32_t start, int32_t limit, - const UnicodeString& text); + const UnicodeString& text) override; virtual void extractBetween(int32_t start, int32_t limit, - UnicodeString& target) const; + UnicodeString& target) const override; - virtual void copy(int32_t start, int32_t limit, int32_t dest); + virtual void copy(int32_t start, int32_t limit, int32_t dest) override; // virtual Replaceable *clone() const { return NULL; } same as default @@ -67,7 +67,7 @@ public: * * @draft ICU 2.2 */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -78,11 +78,11 @@ public: protected: - virtual int32_t getLength() const; + virtual int32_t getLength() const override; - virtual UChar getCharAt(int32_t offset) const; + virtual UChar getCharAt(int32_t offset) const override; - virtual UChar32 getChar32At(int32_t offset) const; + virtual UChar32 getChar32At(int32_t offset) const override; }; UOBJECT_DEFINE_RTTI_IMPLEMENTATION(ReplaceableGlue) diff --git a/icu4c/source/tools/ctestfw/unicode/datamap.h b/icu4c/source/tools/ctestfw/unicode/datamap.h index 56e90763e61..b4f7f82fd64 100644 --- a/icu4c/source/tools/ctestfw/unicode/datamap.h +++ b/icu4c/source/tools/ctestfw/unicode/datamap.h @@ -121,16 +121,16 @@ public: virtual const ResourceBundle *getItem(const char* key, UErrorCode &status) const; - virtual const UnicodeString getString(const char* key, UErrorCode &status) const; - virtual int32_t getInt28(const char* key, UErrorCode &status) const; - virtual uint32_t getUInt28(const char* key, UErrorCode &status) const; - virtual const int32_t *getIntVector(int32_t &length, const char *key, UErrorCode &status) const; - virtual const uint8_t *getBinary(int32_t &length, const char *key, UErrorCode &status) const; + virtual const UnicodeString getString(const char* key, UErrorCode &status) const override; + virtual int32_t getInt28(const char* key, UErrorCode &status) const override; + virtual uint32_t getUInt28(const char* key, UErrorCode &status) const override; + virtual const int32_t *getIntVector(int32_t &length, const char *key, UErrorCode &status) const override; + virtual const uint8_t *getBinary(int32_t &length, const char *key, UErrorCode &status) const override; - virtual int32_t getInt(const char* key, UErrorCode &status) const; + virtual int32_t getInt(const char* key, UErrorCode &status) const override; - virtual const UnicodeString* getStringArray(int32_t& count, const char* key, UErrorCode &status) const; - virtual const int32_t* getIntArray(int32_t& count, const char* key, UErrorCode &status) const; + virtual const UnicodeString* getStringArray(int32_t& count, const char* key, UErrorCode &status) const override; + virtual const int32_t* getIntArray(int32_t& count, const char* key, UErrorCode &status) const override; // ... etc ... }; diff --git a/icu4c/source/tools/ctestfw/unicode/testdata.h b/icu4c/source/tools/ctestfw/unicode/testdata.h index 69fa6644f33..614e36a14d6 100644 --- a/icu4c/source/tools/ctestfw/unicode/testdata.h +++ b/icu4c/source/tools/ctestfw/unicode/testdata.h @@ -103,10 +103,10 @@ private: public: virtual ~RBTestData(); - virtual UBool getInfo(const DataMap *& info, UErrorCode &status) const; + virtual UBool getInfo(const DataMap *& info, UErrorCode &status) const override; - virtual UBool nextSettings(const DataMap *& settings, UErrorCode &status); - virtual UBool nextCase(const DataMap *& nextCase, UErrorCode &status); + virtual UBool nextSettings(const DataMap *& settings, UErrorCode &status) override; + virtual UBool nextCase(const DataMap *& nextCase, UErrorCode &status) override; }; #endif diff --git a/icu4c/source/tools/ctestfw/unicode/testlog.h b/icu4c/source/tools/ctestfw/unicode/testlog.h index 9db35b9ca85..1392335270b 100644 --- a/icu4c/source/tools/ctestfw/unicode/testlog.h +++ b/icu4c/source/tools/ctestfw/unicode/testlog.h @@ -49,7 +49,7 @@ public: void setScope(const UnicodeString& message); protected: - virtual void handleFailure() const; + virtual void handleFailure() const override; private: TestLog &testClass; diff --git a/icu4c/source/tools/ctestfw/unicode/tstdtmod.h b/icu4c/source/tools/ctestfw/unicode/tstdtmod.h index 6cdce88ed6d..683a26c3398 100644 --- a/icu4c/source/tools/ctestfw/unicode/tstdtmod.h +++ b/icu4c/source/tools/ctestfw/unicode/tstdtmod.h @@ -92,10 +92,10 @@ public: RBTestDataModule(const char* name, TestLog& log, UErrorCode& status); public: - virtual UBool getInfo(const DataMap *& info, UErrorCode &status) const; + virtual UBool getInfo(const DataMap *& info, UErrorCode &status) const override; - virtual TestData* createTestData(int32_t index, UErrorCode &status) const; - virtual TestData* createTestData(const char* name, UErrorCode &status) const; + virtual TestData* createTestData(int32_t index, UErrorCode &status) const override; + virtual TestData* createTestData(const char* name, UErrorCode &status) const override; private: UResourceBundle *getTestBundle(const char* bundleName, UErrorCode &status); diff --git a/icu4c/source/tools/genrb/parse.cpp b/icu4c/source/tools/genrb/parse.cpp index 5abe5d65673..7d5ffe1fc78 100644 --- a/icu4c/source/tools/genrb/parse.cpp +++ b/icu4c/source/tools/genrb/parse.cpp @@ -683,7 +683,7 @@ public: virtual void getRules( const char *localeID, const char *collationType, UnicodeString &rules, - const char *&errorReason, UErrorCode &errorCode); + const char *&errorReason, UErrorCode &errorCode) override; private: const char *inputDir; diff --git a/icu4c/source/tools/genrb/reslist.h b/icu4c/source/tools/genrb/reslist.h index 78b916ef02d..c9731880ea6 100644 --- a/icu4c/source/tools/genrb/reslist.h +++ b/icu4c/source/tools/genrb/reslist.h @@ -294,9 +294,9 @@ public: void add(SResource *res); - virtual void handleWrite16(SRBRoot *bundle); - virtual void handlePreWrite(uint32_t *byteOffset); - virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + virtual void handleWrite16(SRBRoot *bundle) override; + virtual void handlePreWrite(uint32_t *byteOffset) override; + virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset) override; SResource *fLast; }; @@ -313,7 +313,7 @@ public: void add(SResource *res); - virtual void handleWrite16(SRBRoot *bundle); + virtual void handleWrite16(SRBRoot *bundle) override; }; class StringBaseResource : public SResource { @@ -329,8 +329,8 @@ public: const UChar *getBuffer() const { return icu::toUCharPtr(fString.getBuffer()); } int32_t length() const { return fString.length(); } - virtual void handlePreWrite(uint32_t *byteOffset); - virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + virtual void handlePreWrite(uint32_t *byteOffset) override; + virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset) override; // TODO: private with getter? icu::UnicodeString fString; @@ -363,8 +363,8 @@ public: return fNumCharsForLength + length() + 1; // +1 for the NUL } - virtual void handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode); - virtual void handleWrite16(SRBRoot *bundle); + virtual void handlePreflightStrings(SRBRoot *bundle, UHashtable *stringSet, UErrorCode &errorCode) override; + virtual void handleWrite16(SRBRoot *bundle) override; void writeUTF16v2(int32_t base, icu::UnicodeString &dest); @@ -401,8 +401,8 @@ public: void add(int32_t value, UErrorCode &errorCode); - virtual void handlePreWrite(uint32_t *byteOffset); - virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + virtual void handlePreWrite(uint32_t *byteOffset) override; + virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset) override; // TODO: UVector32 size_t fCount; @@ -417,8 +417,8 @@ public: const UString* comment, UErrorCode &errorCode); virtual ~BinaryResource(); - virtual void handlePreWrite(uint32_t *byteOffset); - virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset); + virtual void handlePreWrite(uint32_t *byteOffset) override; + virtual void handleWrite(UNewDataMemory *mem, uint32_t *byteOffset) override; // TODO: CharString? uint32_t fLength; diff --git a/icu4c/source/tools/toolutil/toolutil.h b/icu4c/source/tools/toolutil/toolutil.h index 00a9c364b69..1c9f06758ff 100644 --- a/icu4c/source/tools/toolutil/toolutil.h +++ b/icu4c/source/tools/toolutil/toolutil.h @@ -48,7 +48,7 @@ public: IcuToolErrorCode(const char *loc) : location(loc) {} virtual ~IcuToolErrorCode(); protected: - virtual void handleFailure() const; + virtual void handleFailure() const override; private: const char *location; }; diff --git a/icu4c/source/tools/toolutil/xmlparser.h b/icu4c/source/tools/toolutil/xmlparser.h index 75c8ed7e53d..5a3a24c5ed9 100644 --- a/icu4c/source/tools/toolutil/xmlparser.h +++ b/icu4c/source/tools/toolutil/xmlparser.h @@ -116,7 +116,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class. @@ -188,7 +188,7 @@ public: /** * ICU "poor man's RTTI", returns a UClassID for the actual class. */ - virtual UClassID getDynamicClassID() const; + virtual UClassID getDynamicClassID() const override; /** * ICU "poor man's RTTI", returns a UClassID for this class.