diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-07-09 00:35:40 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-10 17:27:17 +0200 |
commit | 3b3028467ceccca0b73a8f53051c0fa4de313111 (patch) | |
tree | ff51789a82630e3fb61a25f8b7c970854b753dc9 /apt-pkg | |
parent | 2893325927f6e4d55dc4bd148093351d4f8300f9 (diff) |
add c++11 override marker to overridden methods
C++11 adds the 'override' specifier to mark that a method is overriding
a base class method and error out if not. We hide it in the APT_OVERRIDE
macro to ensure that we keep compiling in pre-c++11 standards.
Reported-By: clang-modernize -add-override -override-macros
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg')
28 files changed, 267 insertions, 264 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index b6466115e..864b93188 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -391,8 +391,8 @@ class APT_HIDDEN NoActionItem : public pkgAcquire::Item /*{{{*/ { IndexTarget const Target; public: - virtual std::string DescURI() const {return Target.URI;}; - virtual HashStringList GetExpectedHashes() const {return HashStringList();}; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI;}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE {return HashStringList();}; NoActionItem(pkgAcquire * const Owner, IndexTarget const &Target) : pkgAcquire::Item(Owner), Target(Target) diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index 93d812248..2349d386c 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -349,7 +349,7 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ IndexTarget const Target; HashStringList GetExpectedHashesFor(std::string const &MetaKey) const; - bool QueueURI(pkgAcquire::ItemDesc &Item); + bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; public: /** \brief storge name until a transaction is finished */ @@ -364,10 +364,10 @@ class APT_HIDDEN pkgAcqTransactionItem: public pkgAcquire::Item /*{{{*/ }; virtual bool TransactionState(TransactionStates const state); - virtual std::string DescURI() const { return Target.URI; } - virtual HashStringList GetExpectedHashes() const; + virtual std::string DescURI() const APT_OVERRIDE { return Target.URI; } + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; virtual std::string GetMetaKey() const; - virtual bool HashesRequired() const; + virtual bool HashesRequired() const APT_OVERRIDE; pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -417,7 +417,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ /** \brief Queue the downloaded Signature for verification */ void QueueForSignatureVerify(pkgAcqTransactionItem * const I, std::string const &File, std::string const &Signature); - virtual std::string Custom600Headers() const; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Called when authentication succeeded. * @@ -440,15 +440,15 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ */ bool VerifyVendor(std::string const &Message); - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // This refers more to the Transaction-Manager than the actual file bool IMSHit; - virtual bool QueueURI(pkgAcquire::ItemDesc &Item); - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; // transaction code void Add(pkgAcqTransactionItem * const I); @@ -466,7 +466,7 @@ class APT_HIDDEN pkgAcqMetaBase : public pkgAcqTransactionItem /*{{{*/ void TransactionStageRemoval(pkgAcqTransactionItem * const I, const std::string &FinalFile); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, std::vector<IndexTarget> const &IndexTargets, @@ -494,13 +494,13 @@ class APT_HIDDEN pkgAcqMetaIndex : public pkgAcqMetaBase void Init(std::string const &URIDesc, std::string const &ShortDesc); public: - virtual std::string DescURI() const; + virtual std::string DescURI() const APT_OVERRIDE; // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual void Finished(); + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual void Finished() APT_OVERRIDE; /** \brief Create a new pkgAcqMetaIndex. */ pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, @@ -531,16 +531,16 @@ class APT_HIDDEN pkgAcqMetaSig : public pkgAcqTransactionItem protected: /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; public: - virtual bool HashesRequired() const { return false; } + virtual bool HashesRequired() const APT_OVERRIDE { return false; } // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Create a new pkgAcqMetaSig. */ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, @@ -561,10 +561,10 @@ class APT_HIDDEN pkgAcqMetaClearSig : public pkgAcqMetaIndex metaIndex *MetaIndexParser; metaIndex *LastMetaIndexParser; - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; /** \brief Create a new pkgAcqMetaClearSig. */ pkgAcqMetaClearSig(pkgAcquire * const Owner, @@ -583,7 +583,7 @@ class APT_HIDDEN pkgAcqBaseIndex : public pkgAcqTransactionItem public: /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -614,19 +614,19 @@ class APT_HIDDEN pkgAcqDiffIndex : public pkgAcqBaseIndex std::string Description; /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; - virtual bool QueueURI(pkgAcquire::ItemDesc &Item); + virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE; - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // Specialized action members - virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Target.URI + "Index";}; - virtual std::string Custom600Headers() const; - virtual std::string GetMetaKey() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";}; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string GetMetaKey() const APT_OVERRIDE; /** \brief Parse the Index file for a set of Packages diffs. * @@ -724,13 +724,13 @@ class APT_HIDDEN pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target.URI + "Index";}; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "Index";}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create an index merge-diff item. * @@ -836,14 +836,14 @@ class APT_HIDDEN pkgAcqIndexDiffs : public pkgAcqBaseIndex * This method will fall back to downloading the whole index file * outright; its arguments are ignored. */ - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Target.URI + "IndexDiffs";}; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Target.URI + "IndexDiffs";}; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create an index diff item. * @@ -928,18 +928,18 @@ class APT_HIDDEN pkgAcqIndex : public pkgAcqBaseIndex void ReverifyAfterIMS(); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; - virtual bool TransactionState(TransactionStates const state); + virtual bool TransactionState(TransactionStates const state) APT_OVERRIDE; public: // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string Custom600Headers() const; - virtual std::string DescURI() const {return Desc.URI;}; - virtual std::string GetMetaKey() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string Custom600Headers() const APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; + virtual std::string GetMetaKey() const APT_OVERRIDE; pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager, IndexTarget const &Target); @@ -1000,19 +1000,19 @@ class pkgAcqArchive : public pkgAcquire::Item bool QueueNext(); /** \brief Get the full pathname of the final file for the current URI */ - virtual std::string GetFinalFilename() const; + virtual std::string GetFinalFilename() const APT_OVERRIDE; public: - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &Hashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const; - virtual std::string ShortDesc() const; - virtual void Finished(); - virtual bool IsTrusted() const; - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE; + virtual std::string ShortDesc() const APT_OVERRIDE; + virtual void Finished() APT_OVERRIDE; + virtual bool IsTrusted() const APT_OVERRIDE; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; /** \brief Create a new pkgAcqArchive. * @@ -1053,14 +1053,14 @@ class pkgAcqChangelog : public pkgAcquire::Item public: // we will never have hashes for changelogs. // If you need verified ones, download the deb and extract the changelog. - virtual HashStringList GetExpectedHashes() const { return HashStringList(); } - virtual bool HashesRequired() const { return false; } + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE { return HashStringList(); } + virtual bool HashesRequired() const APT_OVERRIDE { return false; } // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Desc.URI;}; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; /** returns the URI to the changelog of this version * @@ -1172,15 +1172,15 @@ class pkgAcqFile : public pkgAcquire::Item HashStringList const ExpectedHashes; public: - virtual HashStringList GetExpectedHashes() const; - virtual bool HashesRequired() const; + virtual HashStringList GetExpectedHashes() const APT_OVERRIDE; + virtual bool HashesRequired() const APT_OVERRIDE; // Specialized action members - virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf); + virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; virtual void Done(std::string const &Message, HashStringList const &CalcHashes, - pkgAcquire::MethodConfig const * const Cnf); - virtual std::string DescURI() const {return Desc.URI;}; - virtual std::string Custom600Headers() const; + pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE; + virtual std::string DescURI() const APT_OVERRIDE {return Desc.URI;}; + virtual std::string Custom600Headers() const APT_OVERRIDE; /** \brief Create a new pkgAcqFile object. * diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index d9cce672a..28057fa5c 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -62,7 +62,7 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ pkgDepCache *Cache; public: - virtual VerIterator GetCandidateVer(PkgIterator const &Pkg) + virtual VerIterator GetCandidateVer(PkgIterator const &Pkg) APT_OVERRIDE { return (*Cache)[Pkg].CandidateVerIter(*Cache); } @@ -77,9 +77,9 @@ class pkgSimulate : public pkgPackageManager /*{{{*/ pkgDepCache::ActionGroup group; // The Actuall installation implementation - virtual bool Install(PkgIterator Pkg,std::string File); - virtual bool Configure(PkgIterator Pkg); - virtual bool Remove(PkgIterator Pkg,bool Purge); + virtual bool Install(PkgIterator Pkg,std::string File) APT_OVERRIDE; + virtual bool Configure(PkgIterator Pkg) APT_OVERRIDE; + virtual bool Remove(PkgIterator Pkg,bool Purge) APT_OVERRIDE; private: APT_HIDDEN void ShortBreaks(); diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h index df9e9460a..2719154c1 100644 --- a/apt-pkg/cachefilter.h +++ b/apt-pkg/cachefilter.h @@ -30,33 +30,33 @@ public: class PackageMatcher : public Matcher { public: virtual bool operator() (pkgCache::PkgIterator const &Pkg) = 0; - virtual bool operator() (pkgCache::VerIterator const &Ver) { return (*this)(Ver.ParentPkg()); } - virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) { return false; } + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE { return (*this)(Ver.ParentPkg()); } + virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) APT_OVERRIDE { return false; } virtual ~PackageMatcher(); }; // Generica like True, False, NOT, AND, OR /*{{{*/ class TrueMatcher : public Matcher { public: - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; }; class FalseMatcher : public Matcher { public: - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; }; class NOTMatcher : public Matcher { Matcher * const matcher; public: explicit NOTMatcher(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~NOTMatcher(); }; @@ -71,9 +71,9 @@ public: ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5); ANDMatcher& AND(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~ANDMatcher(); }; class ORMatcher : public Matcher { @@ -87,9 +87,9 @@ public: ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4); ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5); ORMatcher& OR(Matcher * const matcher); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); - virtual bool operator() (pkgCache::VerIterator const &Ver); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; + virtual bool operator() (pkgCache::VerIterator const &Ver) APT_OVERRIDE; virtual ~ORMatcher(); }; /*}}}*/ @@ -97,8 +97,8 @@ class PackageNameMatchesRegEx : public PackageMatcher { /*{{{*/ regex_t* pattern; public: explicit PackageNameMatchesRegEx(std::string const &Pattern); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; virtual ~PackageNameMatchesRegEx(); }; /*}}}*/ @@ -106,8 +106,8 @@ class PackageNameMatchesFnmatch : public PackageMatcher { /*{{{*/ const std::string Pattern; public: explicit PackageNameMatchesFnmatch(std::string const &Pattern); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); - virtual bool operator() (pkgCache::GrpIterator const &Grp); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual bool operator() (pkgCache::GrpIterator const &Grp) APT_OVERRIDE; virtual ~PackageNameMatchesFnmatch() {}; }; /*}}}*/ @@ -133,7 +133,7 @@ public: */ PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern = true); bool operator() (char const * const &arch); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual ~PackageArchitectureMatchesSpecification(); }; /*}}}*/ @@ -141,7 +141,7 @@ class PackageIsNewInstall : public PackageMatcher { /*{{{*/ pkgCacheFile * const Cache; public: explicit PackageIsNewInstall(pkgCacheFile * const Cache); - virtual bool operator() (pkgCache::PkgIterator const &Pkg); + virtual bool operator() (pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual ~PackageIsNewInstall(); }; /*}}}*/ diff --git a/apt-pkg/contrib/md5.h b/apt-pkg/contrib/md5.h index f4992c223..a16ea4d2d 100644 --- a/apt-pkg/contrib/md5.h +++ b/apt-pkg/contrib/md5.h @@ -48,7 +48,7 @@ class MD5Summation : public SummationImplementation public: - bool Add(const unsigned char *inbuf, unsigned long long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen) APT_OVERRIDE; using SummationImplementation::Add; MD5SumValue Result(); diff --git a/apt-pkg/contrib/progress.h b/apt-pkg/contrib/progress.h index f7fbc9ccf..427b1bd35 100644 --- a/apt-pkg/contrib/progress.h +++ b/apt-pkg/contrib/progress.h @@ -24,6 +24,7 @@ #include <string> #include <sys/time.h> +#include <apt-pkg/macros.h> #ifndef APT_8_CLEANER_HEADERS using std::string; @@ -74,12 +75,12 @@ class OpTextProgress : public OpProgress bool NoUpdate; bool NoDisplay; unsigned long LastLen; - virtual void Update(); + virtual void Update() APT_OVERRIDE; void Write(const char *S); public: - virtual void Done(); + virtual void Done() APT_OVERRIDE; OpTextProgress(bool NoUpdate = false) : NoUpdate(NoUpdate), NoDisplay(false), LastLen(0) {}; diff --git a/apt-pkg/contrib/sha1.h b/apt-pkg/contrib/sha1.h index 5770c315a..1c5cb5aa1 100644 --- a/apt-pkg/contrib/sha1.h +++ b/apt-pkg/contrib/sha1.h @@ -37,7 +37,7 @@ class SHA1Summation : public SummationImplementation bool Done; public: - bool Add(const unsigned char *inbuf, unsigned long long inlen); + bool Add(const unsigned char *inbuf, unsigned long long inlen) APT_OVERRIDE; using SummationImplementation::Add; SHA1SumValue Result(); diff --git a/apt-pkg/contrib/sha2.h b/apt-pkg/contrib/sha2.h index a25ad4d32..70e8384f2 100644 --- a/apt-pkg/contrib/sha2.h +++ b/apt-pkg/contrib/sha2.h @@ -45,7 +45,7 @@ class SHA256Summation : public SHA2SummationBase unsigned char Sum[32]; public: - bool Add(const unsigned char *inbuf, unsigned long long len) + bool Add(const unsigned char *inbuf, unsigned long long len) APT_OVERRIDE { if (Done) return false; @@ -78,7 +78,7 @@ class SHA512Summation : public SHA2SummationBase unsigned char Sum[64]; public: - bool Add(const unsigned char *inbuf, unsigned long long len) + bool Add(const unsigned char *inbuf, unsigned long long len) APT_OVERRIDE { if (Done) return false; diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc index c5086b04b..972feba7f 100644 --- a/apt-pkg/deb/debindexfile.cc +++ b/apt-pkg/deb/debindexfile.cc @@ -482,7 +482,7 @@ class APT_HIDDEN debIFTypePkg : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -497,7 +497,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debRecordParser(File.FileName(),*File.Cache()); }; @@ -506,7 +506,7 @@ class APT_HIDDEN debIFTypeStatus : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator File) const APT_OVERRIDE { return new debDebFileRecordParser(File.FileName()); }; @@ -515,7 +515,7 @@ class APT_HIDDEN debIFTypeDebPkgFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string DscFile) const + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string DscFile) const APT_OVERRIDE { return new debDscRecordParser(DscFile, NULL); }; @@ -524,7 +524,7 @@ class APT_HIDDEN debIFTypeDscFile : public pkgIndexFile::Type class APT_HIDDEN debIFTypeDebianSourceDir : public pkgIndexFile::Type { public: - virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string SourceDir) const + virtual pkgSrcRecords::Parser *CreateSrcPkgParser(std::string SourceDir) const APT_OVERRIDE { return new debDscRecordParser(SourceDir + string("/debian/control"), NULL); }; diff --git a/apt-pkg/deb/debindexfile.h b/apt-pkg/deb/debindexfile.h index 1de609a7b..71ca22e4d 100644 --- a/apt-pkg/deb/debindexfile.h +++ b/apt-pkg/deb/debindexfile.h @@ -38,14 +38,14 @@ class APT_HIDDEN debStatusIndex : public pkgIndexFile virtual const Type *GetType() const APT_CONST; // Interface for acquire - virtual std::string Describe(bool /*Short*/) const {return File;}; + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE {return File;}; // Interface for the Cache Generator - virtual bool Exists() const; - virtual bool HasPackages() const {return true;}; - virtual unsigned long Size() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE {return true;}; + virtual unsigned long Size() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debStatusIndex(std::string File); virtual ~debStatusIndex(); @@ -59,12 +59,12 @@ class APT_HIDDEN debPackagesIndex : public pkgIndexTargetFile virtual const Type *GetType() const APT_CONST; // Stuff for accessing files on remote items - virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const; + virtual std::string ArchiveInfo(pkgCache::VerIterator Ver) const APT_OVERRIDE; // Interface for the Cache Generator - virtual bool HasPackages() const {return true;}; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool HasPackages() const APT_OVERRIDE {return true;}; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debPackagesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debPackagesIndex(); @@ -78,9 +78,9 @@ class APT_HIDDEN debTranslationsIndex : public pkgIndexTargetFile virtual const Type *GetType() const APT_CONST; // Interface for the Cache Generator - virtual bool HasPackages() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual bool HasPackages() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; debTranslationsIndex(IndexTarget const &Target); virtual ~debTranslationsIndex(); @@ -95,13 +95,13 @@ class APT_HIDDEN debSourcesIndex : public pkgIndexTargetFile // Stuff for accessing files on remote items virtual std::string SourceInfo(pkgSrcRecords::Parser const &Record, - pkgSrcRecords::File const &File) const; + pkgSrcRecords::File const &File) const APT_OVERRIDE; // Interface for the record parsers - virtual pkgSrcRecords::Parser *CreateSrcParser() const; + virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; // Interface for the Cache Generator - virtual bool HasPackages() const {return false;}; + virtual bool HasPackages() const APT_OVERRIDE {return false;}; debSourcesIndex(IndexTarget const &Target, bool const Trusted); virtual ~debSourcesIndex(); @@ -117,7 +117,7 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile public: virtual const Type *GetType() const APT_CONST; - virtual std::string Describe(bool /*Short*/) const { + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { return DebFile; } @@ -130,16 +130,16 @@ class APT_HIDDEN debDebPkgFileIndex : public pkgIndexFile static bool GetContent(std::ostream &content, std::string const &debfile); // Interface for the Cache Generator - virtual bool Exists() const; - virtual bool HasPackages() const { + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE { return true; }; - virtual unsigned long Size() const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; - virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const; + virtual unsigned long Size() const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; + virtual pkgCache::PkgFileIterator FindInCache(pkgCache &Cache) const APT_OVERRIDE; // Interface for acquire - virtual std::string ArchiveURI(std::string /*File*/) const; + virtual std::string ArchiveURI(std::string /*File*/) const APT_OVERRIDE; debDebPkgFileIndex(std::string DebFile); virtual ~debDebPkgFileIndex(); @@ -152,11 +152,11 @@ class APT_HIDDEN debDscFileIndex : public pkgIndexFile std::string DscFile; public: virtual const Type *GetType() const APT_CONST; - virtual pkgSrcRecords::Parser *CreateSrcParser() const; - virtual bool Exists() const; - virtual bool HasPackages() const {return false;}; - virtual unsigned long Size() const; - virtual std::string Describe(bool /*Short*/) const { + virtual pkgSrcRecords::Parser *CreateSrcParser() const APT_OVERRIDE; + virtual bool Exists() const APT_OVERRIDE; + virtual bool HasPackages() const APT_OVERRIDE {return false;}; + virtual unsigned long Size() const APT_OVERRIDE; + virtual std::string Describe(bool /*Short*/) const APT_OVERRIDE { return DscFile; }; diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h index 3fd040bdd..4bc3c2341 100644 --- a/apt-pkg/deb/deblistparser.h +++ b/apt-pkg/deb/deblistparser.h @@ -62,24 +62,24 @@ class APT_HIDDEN debListParser : public pkgCacheGenerator::ListParser APT_PUBLIC static unsigned char GetPrio(std::string Str); // These all operate against the current section - virtual std::string Package(); - virtual std::string Architecture(); - virtual bool ArchitectureAll(); - virtual std::string Version(); - virtual bool NewVersion(pkgCache::VerIterator &Ver); - virtual std::string Description(std::string const &lang); - virtual std::vector<std::string> AvailableDescriptionLanguages(); - virtual MD5SumValue Description_md5(); - virtual unsigned short VersionHash(); + virtual std::string Package() APT_OVERRIDE; + virtual std::string Architecture() APT_OVERRIDE; + virtual bool ArchitectureAll() APT_OVERRIDE; + virtual std::string Version() APT_OVERRIDE; + virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; + virtual std::string Description(std::string const &lang) APT_OVERRIDE; + virtual std::vector<std::string> AvailableDescriptionLanguages() APT_OVERRIDE; + virtual MD5SumValue Description_md5() APT_OVERRIDE; + virtual unsigned short VersionHash() APT_OVERRIDE; #if APT_PKG_ABI >= 413 - virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver); + virtual bool SameVersion(unsigned short const Hash, pkgCache::VerIterator const &Ver) APT_OVERRIDE; #endif virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver); - virtual map_filesize_t Offset() {return iOffset;}; - virtual map_filesize_t Size() {return Section.size();}; + pkgCache::VerIterator &Ver) APT_OVERRIDE; + virtual map_filesize_t Offset() APT_OVERRIDE {return iOffset;}; + virtual map_filesize_t Size() APT_OVERRIDE {return Section.size();}; - virtual bool Step(); + virtual bool Step() APT_OVERRIDE; bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, std::string const §ion); @@ -111,15 +111,15 @@ class APT_HIDDEN debDebFileParser : public debListParser public: debDebFileParser(FileFd *File, std::string const &DebFile); virtual bool UsePackage(pkgCache::PkgIterator &Pkg, - pkgCache::VerIterator &Ver); + pkgCache::VerIterator &Ver) APT_OVERRIDE; }; class APT_HIDDEN debTranslationsParser : public debListParser { public: // a translation can never be a real package - virtual std::string Architecture() { return ""; } - virtual std::string Version() { return ""; } + virtual std::string Architecture() APT_OVERRIDE { return ""; } + virtual std::string Version() APT_OVERRIDE { return ""; } debTranslationsParser(FileFd *File, std::string const &Arch = "") : debListParser(File, Arch) {}; diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index 10ab0f844..46a7181fc 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -758,7 +758,7 @@ class APT_HIDDEN debSLTypeDeb : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector<metaIndex *> &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map<std::string, std::string> const &Options) const + std::map<std::string, std::string> const &Options) const APT_OVERRIDE { return CreateItemInternal(List, URI, Dist, Section, false, Options); } @@ -774,7 +774,7 @@ class APT_HIDDEN debSLTypeDebSrc : public debSLTypeDebian /*{{{*/ bool CreateItem(std::vector<metaIndex *> &List, std::string const &URI, std::string const &Dist, std::string const &Section, - std::map<std::string, std::string> const &Options) const + std::map<std::string, std::string> const &Options) const APT_OVERRIDE { return CreateItemInternal(List, URI, Dist, Section, true, Options); } @@ -800,7 +800,7 @@ class APT_HIDDEN debSLTypeDebFile : public pkgSourceList::Type /*{{{*/ bool CreateItem(std::vector<metaIndex *> &List, std::string const &URI, std::string const &/*Dist*/, std::string const &/*Section*/, - std::map<std::string, std::string> const &/*Options*/) const + std::map<std::string, std::string> const &/*Options*/) const APT_OVERRIDE { metaIndex *mi = new debDebFileMetaIndex(URI); List.push_back(mi); diff --git a/apt-pkg/deb/debmetaindex.h b/apt-pkg/deb/debmetaindex.h index bf5b7c1ce..8c13237cb 100644 --- a/apt-pkg/deb/debmetaindex.h +++ b/apt-pkg/deb/debmetaindex.h @@ -39,18 +39,18 @@ class APT_HIDDEN debReleaseIndex : public metaIndex debReleaseIndex(std::string const &URI, std::string const &Dist, bool const Trusted); virtual ~debReleaseIndex(); - virtual std::string ArchiveURI(std::string const &File) const {return URI + File;}; - virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false); - virtual std::vector<IndexTarget> GetIndexTargets() const; + virtual std::string ArchiveURI(std::string const &File) const APT_OVERRIDE {return URI + File;}; + virtual bool GetIndexes(pkgAcquire *Owner, bool const &GetAll=false) APT_OVERRIDE; + virtual std::vector<IndexTarget> GetIndexTargets() const APT_OVERRIDE; - virtual std::string Describe() const; - virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + virtual std::string Describe() const APT_OVERRIDE; + virtual pkgCache::RlsFileIterator FindInCache(pkgCache &Cache, bool const ModifyCheck) const APT_OVERRIDE; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; - virtual bool Load(std::string const &Filename, std::string * const ErrorText); - virtual metaIndex * UnloadedClone() const; + virtual bool Load(std::string const &Filename, std::string * const ErrorText) APT_OVERRIDE; + virtual metaIndex * UnloadedClone() const APT_OVERRIDE; - virtual std::vector <pkgIndexFile *> *GetIndexFiles(); + virtual std::vector <pkgIndexFile *> *GetIndexFiles() APT_OVERRIDE; bool SetTrusted(TriState const Trusted); bool SetCheckValidUntil(TriState const Trusted); @@ -58,7 +58,7 @@ class APT_HIDDEN debReleaseIndex : public metaIndex bool SetValidUntilMax(time_t const Valid); bool SetSignedBy(std::string const &SignedBy); - virtual bool IsTrusted() const; + virtual bool IsTrusted() const APT_OVERRIDE; void AddComponent(bool const isSrc, std::string const &Name, std::vector<std::string> const &Targets, @@ -73,29 +73,29 @@ private: std::string DebFile; debDebPkgFileIndex *DebIndex; public: - virtual std::string ArchiveURI(std::string const& /*File*/) const { + virtual std::string ArchiveURI(std::string const& /*File*/) const APT_OVERRIDE { return DebFile; } - virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) { + virtual bool GetIndexes(pkgAcquire* /*Owner*/, const bool& /*GetAll=false*/) APT_OVERRIDE { return true; } - virtual std::vector<IndexTarget> GetIndexTargets() const { + virtual std::vector<IndexTarget> GetIndexTargets() const APT_OVERRIDE { return std::vector<IndexTarget>(); } - virtual std::vector<pkgIndexFile *> *GetIndexFiles() { + virtual std::vector<pkgIndexFile *> *GetIndexFiles() APT_OVERRIDE { return Indexes; } - virtual bool IsTrusted() const { + virtual bool IsTrusted() const APT_OVERRIDE { return true; } - virtual bool Load(std::string const &, std::string * const ErrorText) + virtual bool Load(std::string const &, std::string * const ErrorText) APT_OVERRIDE { LoadedSuccessfully = TRI_NO; if (ErrorText != NULL) strprintf(*ErrorText, "Unparseable metaindex as it represents the standalone deb file %s", DebFile.c_str()); return false; } - virtual metaIndex * UnloadedClone() const + virtual metaIndex * UnloadedClone() const APT_OVERRIDE { return NULL; } diff --git a/apt-pkg/deb/debrecords.h b/apt-pkg/deb/debrecords.h index 4d0b713d4..7fc82a88d 100644 --- a/apt-pkg/deb/debrecords.h +++ b/apt-pkg/deb/debrecords.h @@ -33,23 +33,23 @@ class APT_HIDDEN debRecordParserBase : public pkgRecords::Parser public: // These refer to the archive file for the Version - virtual std::string FileName(); - virtual std::string SourcePkg(); - virtual std::string SourceVer(); + virtual std::string FileName() APT_OVERRIDE; + virtual std::string SourcePkg() APT_OVERRIDE; + virtual std::string SourceVer() APT_OVERRIDE; - virtual HashStringList Hashes() const; + virtual HashStringList Hashes() const APT_OVERRIDE; // These are some general stats about the package - virtual std::string Maintainer(); - virtual std::string ShortDesc(std::string const &lang); - virtual std::string LongDesc(std::string const &lang); - virtual std::string Name(); - virtual std::string Homepage(); + virtual std::string Maintainer() APT_OVERRIDE; + virtual std::string ShortDesc(std::string const &lang) APT_OVERRIDE; + virtual std::string LongDesc(std::string const &lang) APT_OVERRIDE; + virtual std::string Name() APT_OVERRIDE; + virtual std::string Homepage() APT_OVERRIDE; // An arbitrary custom field - virtual std::string RecordField(const char *fieldName); + virtual std::string RecordField(const char *fieldName) APT_OVERRIDE; - virtual void GetRec(const char *&Start,const char *&Stop); + virtual void GetRec(const char *&Start,const char *&Stop) APT_OVERRIDE; debRecordParserBase(); virtual ~debRecordParserBase(); @@ -62,8 +62,8 @@ class APT_HIDDEN debRecordParser : public debRecordParserBase FileFd File; pkgTagFile Tags; - virtual bool Jump(pkgCache::VerFileIterator const &Ver); - virtual bool Jump(pkgCache::DescFileIterator const &Desc); + virtual bool Jump(pkgCache::VerFileIterator const &Ver) APT_OVERRIDE; + virtual bool Jump(pkgCache::DescFileIterator const &Desc) APT_OVERRIDE; public: debRecordParser(std::string FileName,pkgCache &Cache); @@ -80,11 +80,11 @@ class APT_HIDDEN debDebFileRecordParser : public debRecordParserBase APT_HIDDEN bool LoadContent(); protected: // single file files, so no jumping whatsoever - bool Jump(pkgCache::VerFileIterator const &); - bool Jump(pkgCache::DescFileIterator const &); + bool Jump(pkgCache::VerFileIterator const &) APT_OVERRIDE; + bool Jump(pkgCache::DescFileIterator const &) APT_OVERRIDE; public: - virtual std::string FileName(); + virtual std::string FileName() APT_OVERRIDE; debDebFileRecordParser(std::string FileName); virtual ~debDebFileRecordParser(); diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h index 64b07a1ec..89134af5f 100644 --- a/apt-pkg/deb/debsrcrecords.h +++ b/apt-pkg/deb/debsrcrecords.h @@ -36,24 +36,24 @@ class APT_HIDDEN debSrcRecordParser : public pkgSrcRecords::Parser public: - virtual bool Restart() {return Jump(0);}; - virtual bool Step() {iOffset = Tags.Offset(); return Tags.Step(Sect);}; - virtual bool Jump(unsigned long const &Off) {iOffset = Off; return Tags.Jump(Sect,Off);}; + virtual bool Restart() APT_OVERRIDE {return Jump(0);}; + virtual bool Step() APT_OVERRIDE {iOffset = Tags.Offset(); return Tags.Step(Sect);}; + virtual bool Jump(unsigned long const &Off) APT_OVERRIDE {iOffset = Off; return Tags.Jump(Sect,Off);}; - virtual std::string Package() const {return Sect.FindS("Package");}; - virtual std::string Version() const {return Sect.FindS("Version");}; - virtual std::string Maintainer() const {return Sect.FindS("Maintainer");}; - virtual std::string Section() const {return Sect.FindS("Section");}; - virtual const char **Binaries(); - virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true); - virtual unsigned long Offset() {return iOffset;}; - virtual std::string AsStr() + virtual std::string Package() const APT_OVERRIDE {return Sect.FindS("Package");}; + virtual std::string Version() const APT_OVERRIDE {return Sect.FindS("Version");}; + virtual std::string Maintainer() const APT_OVERRIDE {return Sect.FindS("Maintainer");}; + virtual std::string Section() const APT_OVERRIDE {return Sect.FindS("Section");}; + virtual const char **Binaries() APT_OVERRIDE; + virtual bool BuildDepends(std::vector<BuildDepRec> &BuildDeps, bool const &ArchOnly, bool const &StripMultiArch = true) APT_OVERRIDE; + virtual unsigned long Offset() APT_OVERRIDE {return iOffset;}; + virtual std::string AsStr() APT_OVERRIDE { const char *Start=0,*Stop=0; Sect.GetSection(Start,Stop); return std::string(Start,Stop); }; - virtual bool Files(std::vector<pkgSrcRecords::File> &F); + virtual bool Files(std::vector<pkgSrcRecords::File> &F) APT_OVERRIDE; bool Files2(std::vector<pkgSrcRecords::File2> &F); debSrcRecordParser(std::string const &File,pkgIndexFile const *Index); diff --git a/apt-pkg/deb/debsystem.h b/apt-pkg/deb/debsystem.h index e59bbebed..aed77520e 100644 --- a/apt-pkg/deb/debsystem.h +++ b/apt-pkg/deb/debsystem.h @@ -33,15 +33,15 @@ class debSystem : public pkgSystem public: - virtual bool Lock(); - virtual bool UnLock(bool NoErrors = false); - virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const; - virtual bool Initialize(Configuration &Cnf); - virtual bool ArchiveSupported(const char *Type); - virtual signed Score(Configuration const &Cnf); - virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List); + virtual bool Lock() APT_OVERRIDE; + virtual bool UnLock(bool NoErrors = false) APT_OVERRIDE; + virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_OVERRIDE; + virtual bool Initialize(Configuration &Cnf) APT_OVERRIDE; + virtual bool ArchiveSupported(const char *Type) APT_OVERRIDE; + virtual signed Score(Configuration const &Cnf) APT_OVERRIDE; + virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List) APT_OVERRIDE; virtual bool FindIndex(pkgCache::PkgFileIterator File, - pkgIndexFile *&Found) const; + pkgIndexFile *&Found) const APT_OVERRIDE; debSystem(); virtual ~debSystem(); diff --git a/apt-pkg/deb/debversion.h b/apt-pkg/deb/debversion.h index 7befe6372..6d7eca7c1 100644 --- a/apt-pkg/deb/debversion.h +++ b/apt-pkg/deb/debversion.h @@ -27,11 +27,11 @@ class debVersioningSystem : public pkgVersioningSystem const char *B,const char *Bend) APT_PURE; virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) APT_PURE; virtual APT_PURE int DoCmpReleaseVer(const char *A,const char *Aend, - const char *B,const char *Bend) + const char *B,const char *Bend) APT_OVERRIDE { return DoCmpVersion(A,Aend,B,Bend); } - virtual std::string UpstreamVersion(const char *A); + virtual std::string UpstreamVersion(const char *A) APT_OVERRIDE; debVersioningSystem(); }; diff --git a/apt-pkg/deb/dpkgpm.h b/apt-pkg/deb/dpkgpm.h index a1b36c6c0..82c1bef5d 100644 --- a/apt-pkg/deb/dpkgpm.h +++ b/apt-pkg/deb/dpkgpm.h @@ -120,14 +120,14 @@ class pkgDPkgPM : public pkgPackageManager void ProcessDpkgStatusLine(char *line); // The Actuall installation implementation - virtual bool Install(PkgIterator Pkg,std::string File); - virtual bool Configure(PkgIterator Pkg); - virtual bool Remove(PkgIterator Pkg,bool Purge = false); + virtual bool Install(PkgIterator Pkg,std::string File) APT_OVERRIDE; + virtual bool Configure(PkgIterator Pkg) APT_OVERRIDE; + virtual bool Remove(PkgIterator Pkg,bool Purge = false) APT_OVERRIDE; - virtual bool Go(APT::Progress::PackageManager *progress); - virtual bool Go(int StatusFd=-1); + virtual bool Go(APT::Progress::PackageManager *progress) APT_OVERRIDE; + virtual bool Go(int StatusFd=-1) APT_OVERRIDE; - virtual void Reset(); + virtual void Reset() APT_OVERRIDE; public: diff --git a/apt-pkg/depcache.h b/apt-pkg/depcache.h index 40a2fcaab..2c3304ba8 100644 --- a/apt-pkg/depcache.h +++ b/apt-pkg/depcache.h @@ -204,7 +204,7 @@ class pkgDepCache : protected pkgCache::Namespace DefaultRootSetFunc() : Configuration::MatchAgainstConfig("APT::NeverAutoRemove") {}; virtual ~DefaultRootSetFunc() {}; - bool InRootSet(const pkgCache::PkgIterator &pkg) { return pkg.end() == false && Match(pkg.Name()); }; + bool InRootSet(const pkgCache::PkgIterator &pkg) APT_OVERRIDE { return pkg.end() == false && Match(pkg.Name()); }; }; struct StateCache diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc index 3bffc27e9..649d94b5d 100644 --- a/apt-pkg/edsp/edspindexfile.cc +++ b/apt-pkg/edsp/edspindexfile.cc @@ -67,7 +67,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const class APT_HIDDEN edspIFType: public pkgIndexFile::Type { public: - virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const + virtual pkgRecords::Parser *CreatePkgParser(pkgCache::PkgFileIterator) const APT_OVERRIDE { // we don't have a record parser for this type as the file is not presistent return NULL; diff --git a/apt-pkg/edsp/edspindexfile.h b/apt-pkg/edsp/edspindexfile.h index 265a016c5..b2a510f14 100644 --- a/apt-pkg/edsp/edspindexfile.h +++ b/apt-pkg/edsp/edspindexfile.h @@ -27,7 +27,7 @@ class APT_HIDDEN edspIndex : public debStatusIndex virtual const Type *GetType() const APT_CONST; - virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const; + virtual bool Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const APT_OVERRIDE; edspIndex(std::string File); virtual ~edspIndex(); diff --git a/apt-pkg/edsp/edsplistparser.h b/apt-pkg/edsp/edsplistparser.h index 98dde4bf5..2a09e8c47 100644 --- a/apt-pkg/edsp/edsplistparser.h +++ b/apt-pkg/edsp/edsplistparser.h @@ -29,11 +29,11 @@ class APT_HIDDEN edspListParser : public debListParser { void * const d; public: - virtual bool NewVersion(pkgCache::VerIterator &Ver); + virtual bool NewVersion(pkgCache::VerIterator &Ver) APT_OVERRIDE; virtual std::string Description(); virtual std::string DescriptionLanguage(); - virtual MD5SumValue Description_md5(); - virtual unsigned short VersionHash(); + virtual MD5SumValue Description_md5() APT_OVERRIDE; + virtual unsigned short VersionHash() APT_OVERRIDE; bool LoadReleaseInfo(pkgCache::RlsFileIterator &FileI,FileFd &File, std::string const §ion); @@ -42,7 +42,7 @@ class APT_HIDDEN edspListParser : public debListParser virtual ~edspListParser(); protected: - virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver); + virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver) APT_OVERRIDE; }; diff --git a/apt-pkg/edsp/edspsystem.h b/apt-pkg/edsp/edspsystem.h index 156b02bb5..ec42bef75 100644 --- a/apt-pkg/edsp/edspsystem.h +++ b/apt-pkg/edsp/edspsystem.h @@ -16,6 +16,8 @@ #include <vector> +#include <apt-pkg/macros.h> + class Configuration; class pkgDepCache; class pkgIndexFile; @@ -31,15 +33,15 @@ class APT_HIDDEN edspSystem : public pkgSystem public: - virtual bool Lock() APT_CONST; - virtual bool UnLock(bool NoErrors = false) APT_CONST; - virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_CONST; - virtual bool Initialize(Configuration &Cnf); - virtual bool ArchiveSupported(const char *Type) APT_CONST; - virtual signed Score(Configuration const &Cnf); - virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List); + virtual bool Lock() APT_OVERRIDE APT_CONST; + virtual bool UnLock(bool NoErrors = false) APT_OVERRIDE APT_CONST; + virtual pkgPackageManager *CreatePM(pkgDepCache *Cache) const APT_OVERRIDE APT_CONST; + virtual bool Initialize(Configuration &Cnf) APT_OVERRIDE; + virtual bool ArchiveSupported(const char *Type) APT_OVERRIDE APT_CONST; + virtual signed Score(Configuration const &Cnf) APT_OVERRIDE; + virtual bool AddStatusFiles(std::vector<pkgIndexFile *> &List) APT_OVERRIDE; virtual bool FindIndex(pkgCache::PkgFileIterator File, - pkgIndexFile *&Found) const; + pkgIndexFile *&Found) const APT_OVERRIDE; edspSystem(); virtual ~edspSystem(); diff --git a/apt-pkg/indexcopy.h b/apt-pkg/indexcopy.h index 6eecad028..316672e1d 100644 --- a/apt-pkg/indexcopy.h +++ b/apt-pkg/indexcopy.h @@ -62,10 +62,10 @@ class PackageCopy : public IndexCopy /*{{{*/ void * const d; protected: - virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FileFd &Target, std::string const &File); - virtual const char *GetFileName() {return "Packages";}; - virtual const char *Type() {return "Package";}; + virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE; + virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE; + virtual const char *GetFileName() APT_OVERRIDE {return "Packages";}; + virtual const char *Type() APT_OVERRIDE {return "Package";}; public: PackageCopy(); @@ -77,10 +77,10 @@ class SourceCopy : public IndexCopy /*{{{*/ void * const d; protected: - virtual bool GetFile(std::string &Filename,unsigned long long &Size); - virtual bool RewriteEntry(FileFd &Target, std::string const &File); - virtual const char *GetFileName() {return "Sources";}; - virtual const char *Type() {return "Source";}; + virtual bool GetFile(std::string &Filename,unsigned long long &Size) APT_OVERRIDE; + virtual bool RewriteEntry(FileFd &Target, std::string const &File) APT_OVERRIDE; + virtual const char *GetFileName() APT_OVERRIDE {return "Sources";}; + virtual const char *Type() APT_OVERRIDE {return "Source";}; public: SourceCopy(); diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h index 44d39110d..5be7794bf 100644 --- a/apt-pkg/indexfile.h +++ b/apt-pkg/indexfile.h @@ -160,10 +160,10 @@ protected: std::string IndexFileName() const; public: - virtual std::string ArchiveURI(std::string File) const; - virtual std::string Describe(bool Short = false) const; - virtual bool Exists() const; - virtual unsigned long Size() const; + virtual std::string ArchiveURI(std::string File) const APT_OVERRIDE; + virtual std::string Describe(bool Short = false) const APT_OVERRIDE; + virtual bool Exists() const APT_OVERRIDE; + virtual unsigned long Size() const APT_OVERRIDE; pkgIndexTargetFile(IndexTarget const &Target, bool const Trusted); virtual ~pkgIndexTargetFile(); diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h index 07fc15fd8..ee03ac217 100644 --- a/apt-pkg/install-progress.h +++ b/apt-pkg/install-progress.h @@ -72,21 +72,21 @@ namespace Progress { explicit PackageManagerProgressFd(int progress_fd); virtual ~PackageManagerProgressFd(); - virtual void StartDpkg(); - virtual void Stop(); + virtual void StartDpkg() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; virtual void Error(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ErrorMessage); + std::string ErrorMessage) APT_OVERRIDE; virtual void ConffilePrompt(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ConfMessage); + std::string ConfMessage) APT_OVERRIDE; }; @@ -103,21 +103,21 @@ namespace Progress { explicit PackageManagerProgressDeb822Fd(int progress_fd); virtual ~PackageManagerProgressDeb822Fd(); - virtual void StartDpkg(); - virtual void Stop(); + virtual void StartDpkg() APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; virtual void Error(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ErrorMessage); + std::string ErrorMessage) APT_OVERRIDE; virtual void ConffilePrompt(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string ConfMessage); + std::string ConfMessage) APT_OVERRIDE; }; class PackageManagerFancy : public PackageManager @@ -144,12 +144,12 @@ namespace Progress { public: PackageManagerFancy(); virtual ~PackageManagerFancy(); - virtual void Start(int child_pty=-1); - virtual void Stop(); + virtual void Start(int child_pty=-1) APT_OVERRIDE; + virtual void Stop() APT_OVERRIDE; virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; // return a progress bar of the given size for the given progress // percent between 0.0 and 1.0 in the form "[####...]" @@ -163,7 +163,7 @@ namespace Progress { virtual bool StatusChanged(std::string PackageName, unsigned int StepsDone, unsigned int TotalSteps, - std::string HumanReadableAction); + std::string HumanReadableAction) APT_OVERRIDE; PackageManagerText(); virtual ~PackageManagerText(); diff --git a/apt-pkg/policy.h b/apt-pkg/policy.h index 58b062a7b..b3e1ec6b1 100644 --- a/apt-pkg/policy.h +++ b/apt-pkg/policy.h @@ -78,10 +78,10 @@ class pkgPolicy : public pkgDepCache::Policy pkgCache::VerIterator GetMatch(pkgCache::PkgIterator const &Pkg); // Things for the cache interface. - virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg); - virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg); + virtual pkgCache::VerIterator GetCandidateVer(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; + virtual signed short GetPriority(pkgCache::PkgIterator const &Pkg) APT_OVERRIDE; virtual signed short GetPriority(pkgCache::VerIterator const &Pkg); - virtual signed short GetPriority(pkgCache::PkgFileIterator const &File); + virtual signed short GetPriority(pkgCache::PkgFileIterator const &File) APT_OVERRIDE; bool InitDefaults(); diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h index 81fff89f0..77a84c832 100644 --- a/apt-pkg/tagfile.h +++ b/apt-pkg/tagfile.h @@ -147,7 +147,7 @@ class pkgTagSection for being a bit slower to allow comments and new lines all over the place */ class pkgUserTagSection : public pkgTagSection { - virtual void TrimRecord(bool BeforeRecord, const char* &End); + virtual void TrimRecord(bool BeforeRecord, const char* &End) APT_OVERRIDE; }; class pkgTagFilePrivate; |