return false;
}
/*}}}*/
-static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const MetaKey)/*{{{*/
+static HashStringList GetExpectedHashesFromFor(indexRecords * const Parser, std::string const &MetaKey)/*{{{*/
{
if (Parser == NULL)
return HashStringList();
virtual std::string DescURI() const {return Target.URI;};
virtual HashStringList GetExpectedHashes() const {return HashStringList();};
- NoActionItem(pkgAcquire * const Owner, IndexTarget const Target) :
+ NoActionItem(pkgAcquire * const Owner, IndexTarget const &Target) :
pkgAcquire::Item(Owner), Target(Target)
{
Status = StatDone;
// Acquire::Item::Item - Constructor /*{{{*/
APT_IGNORE_DEPRECATED_PUSH
-pkgAcquire::Item::Item(pkgAcquire * const Owner) :
+pkgAcquire::Item::Item(pkgAcquire * const owner) :
FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false), Local(false),
- QueueCounter(0), ExpectedAdditionalItems(0), Owner(Owner)
+ QueueCounter(0), ExpectedAdditionalItems(0), Owner(owner)
{
Owner->Add(this);
Status = StatIdle;
/*}}}*/
pkgAcqTransactionItem::pkgAcqTransactionItem(pkgAcquire * const Owner, /*{{{*/
- pkgAcqMetaBase * const TransactionManager, IndexTarget const Target) :
- pkgAcquire::Item(Owner), Target(Target), TransactionManager(TransactionManager)
+ pkgAcqMetaBase * const transactionManager, IndexTarget const &target) :
+ pkgAcquire::Item(Owner), Target(target), TransactionManager(transactionManager)
{
if (TransactionManager != this)
TransactionManager->Add(this);
{
}
/*}}}*/
-HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const MetaKey) const /*{{{*/
+HashStringList pkgAcqTransactionItem::GetExpectedHashesFor(std::string const &MetaKey) const /*{{{*/
{
return GetExpectedHashesFromFor(TransactionManager->MetaIndexParser, MetaKey);
}
// AcqMetaBase - Constructor /*{{{*/
pkgAcqMetaBase::pkgAcqMetaBase(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- std::vector<IndexTarget> const IndexTargets,
+ std::vector<IndexTarget> const &IndexTargets,
IndexTarget const &DataTarget,
indexRecords * const MetaIndexParser)
: pkgAcqTransactionItem(Owner, TransactionManager, DataTarget),
pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire * const Owner, /*{{{*/
IndexTarget const &ClearsignedTarget,
IndexTarget const &DetachedDataTarget, IndexTarget const &DetachedSigTarget,
- std::vector<IndexTarget> const IndexTargets,
+ std::vector<IndexTarget> const &IndexTargets,
indexRecords * const MetaIndexParser) :
pkgAcqMetaIndex(Owner, this, ClearsignedTarget, DetachedSigTarget, IndexTargets, MetaIndexParser),
ClearsignedTarget(ClearsignedTarget),
- DetachedDataTarget(DetachedDataTarget), DetachedSigTarget(DetachedSigTarget)
+ DetachedDataTarget(DetachedDataTarget)
{
// index targets + (worst case:) Release/Release.gpg
ExpectedAdditionalItems = IndexTargets.size() + 2;
pkgAcqMetaBase * const TransactionManager,
IndexTarget const &DataTarget,
IndexTarget const &DetachedSigTarget,
- vector<IndexTarget> const IndexTargets,
+ vector<IndexTarget> const &IndexTargets,
indexRecords * const MetaIndexParser) :
pkgAcqMetaBase(Owner, TransactionManager, IndexTargets, DataTarget, MetaIndexParser),
DetachedSigTarget(DetachedSigTarget)
// AcqMetaSig::AcqMetaSig - Constructor /*{{{*/
pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target,
+ IndexTarget const &Target,
pkgAcqMetaIndex * const MetaIndex) :
pkgAcqTransactionItem(Owner, TransactionManager, Target), MetaIndex(MetaIndex)
{
// AcqBaseIndex - Constructor /*{{{*/
pkgAcqBaseIndex::pkgAcqBaseIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target)
+ IndexTarget const &Target)
: pkgAcqTransactionItem(Owner, TransactionManager, Target)
{
}
*/
pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target)
+ IndexTarget const &Target)
: pkgAcqBaseIndex(Owner, TransactionManager, Target)
{
Debug = _config->FindB("Debug::pkgAcquire::Diffs",false);
*/
pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target,
+ IndexTarget const &Target,
vector<DiffInfo> const &diffs)
: pkgAcqBaseIndex(Owner, TransactionManager, Target),
available_patches(diffs)
// AcqIndexMergeDiffs::AcqIndexMergeDiffs - Constructor /*{{{*/
pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target,
+ IndexTarget const &Target,
DiffInfo const &patch,
std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
: pkgAcqBaseIndex(Owner, TransactionManager, Target),
// AcqIndex::AcqIndex - Constructor /*{{{*/
pkgAcqIndex::pkgAcqIndex(pkgAcquire * const Owner,
pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target)
- : pkgAcqBaseIndex(Owner, TransactionManager, Target)
+ IndexTarget const &Target)
+ : pkgAcqBaseIndex(Owner, TransactionManager, Target), Stage(STAGE_DOWNLOAD)
{
// autoselect the compression method
AutoSelectCompression();
*
* \param Owner The new owner of this item.
*/
- Item(pkgAcquire * const Owner);
+ explicit Item(pkgAcquire * const Owner);
/** \brief Remove this item from its owner's queue by invoking
* pkgAcquire::Remove.
void *d;
protected:
IndexTarget const Target;
- HashStringList GetExpectedHashesFor(std::string const MetaKey) const;
+ HashStringList GetExpectedHashesFor(std::string const &MetaKey) const;
bool QueueURI(pkgAcquire::ItemDesc &Item);
virtual bool HashesRequired() const;
- pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target);
+ pkgAcqTransactionItem(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target);
virtual ~pkgAcqTransactionItem();
friend class pkgAcqMetaBase;
virtual std::string GetFinalFilename() const;
pkgAcqMetaBase(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- std::vector<IndexTarget> const IndexTargets,
+ std::vector<IndexTarget> const &IndexTargets,
IndexTarget const &DataTarget,
indexRecords* const MetaIndexParser);
virtual ~pkgAcqMetaBase();
/** \brief Create a new pkgAcqMetaIndex. */
pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
IndexTarget const &DataTarget, IndexTarget const &DetachedSigTarget,
- std::vector<IndexTarget> const IndexTargets, indexRecords * const MetaIndexParser);
+ std::vector<IndexTarget> const &IndexTargets, indexRecords * const MetaIndexParser);
virtual ~pkgAcqMetaIndex();
friend class pkgAcqMetaSig;
pkgAcquire::MethodConfig const * const Cnf);
/** \brief Create a new pkgAcqMetaSig. */
- pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const Target,
+ pkgAcqMetaSig(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager, IndexTarget const &Target,
pkgAcqMetaIndex * const MetaIndex);
virtual ~pkgAcqMetaSig();
};
IndexTarget const ClearsignedTarget;
IndexTarget const DetachedDataTarget;
- IndexTarget const DetachedSigTarget;
public:
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
IndexTarget const &ClearsignedTarget,
IndexTarget const &DetachedDataTarget,
IndexTarget const &DetachedSigTarget,
- std::vector<IndexTarget> const IndexTargets,
+ std::vector<IndexTarget> const &IndexTargets,
indexRecords * const MetaIndexParser);
virtual ~pkgAcqMetaClearSig();
};
virtual std::string GetFinalFilename() const;
pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target);
+ IndexTarget const &Target);
virtual ~pkgAcqBaseIndex();
};
/*}}}*/
* \param ShortDesc A short description of the list file to download.
*/
pkgAcqDiffIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target);
+ IndexTarget const &Target);
virtual ~pkgAcqDiffIndex();
private:
APT_HIDDEN void QueueOnIMSHit() const;
* check if it was the last one to complete the download step
*/
pkgAcqIndexMergeDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target, DiffInfo const &patch,
+ IndexTarget const &Target, DiffInfo const &patch,
std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches);
virtual ~pkgAcqIndexMergeDiffs();
};
* that depends on it.
*/
pkgAcqIndexDiffs(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target,
+ IndexTarget const &Target,
std::vector<DiffInfo> const &diffs=std::vector<DiffInfo>());
virtual ~pkgAcqIndexDiffs();
};
virtual std::string GetMetaKey() const;
pkgAcqIndex(pkgAcquire * const Owner, pkgAcqMetaBase * const TransactionManager,
- IndexTarget const Target);
+ IndexTarget const &Target);
virtual ~pkgAcqIndex();
private:
// ---------------------------------------------------------------------
/* */
pkgAcquire::Worker::Worker(Queue *Q,MethodConfig *Cnf,
- pkgAcquireStatus *Log) : Log(Log)
+ pkgAcquireStatus *log) : Log(log)
{
OwnerQ = Q;
Config = Cnf;
* \param Config A location in which to store information about
* the fetch method.
*/
- Worker(MethodConfig *Config);
+ explicit Worker(MethodConfig *Config);
/** \brief Clean up this worker.
*
// Queue::Queue - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : d(NULL), Next(0),
- Name(Name), Items(0), Workers(0), Owner(Owner), PipeDepth(0), MaxPipeDepth(1)
+pkgAcquire::Queue::Queue(string const &name,pkgAcquire * const owner) : d(NULL), Next(0),
+ Name(name), Items(0), Workers(0), Owner(owner), PipeDepth(0), MaxPipeDepth(1)
{
}
/*}}}*/
bool GetLock(std::string const &Lock);
/** \brief Construct a new pkgAcquire. */
- pkgAcquire(pkgAcquireStatus *Log);
+ explicit pkgAcquire(pkgAcquireStatus *Log);
pkgAcquire();
/** \brief Destroy this pkgAcquire object.
* \param Name The name of the new queue.
* \param Owner The download process that owns the new queue.
*/
- Queue(std::string Name,pkgAcquire *Owner);
+ Queue(std::string const &Name,pkgAcquire * const Owner);
/** Shut down all the worker processes associated with this queue
* and empty the queue.
*
* \param Q The queue over which this UriIterator should iterate.
*/
- UriIterator(pkgAcquire::Queue *Q);
+ explicit UriIterator(pkgAcquire::Queue *Q);
virtual ~UriIterator();
};
/*}}}*/
return (*Cache)[Pkg].CandidateVerIter(*Cache);
}
- Policy(pkgDepCache *Cache) : Cache(Cache) {};
+ explicit Policy(pkgDepCache *Cache) : Cache(Cache) {};
};
unsigned char *Flags;
public:
- pkgSimulate(pkgDepCache *Cache);
+ explicit pkgSimulate(pkgDepCache *Cache);
virtual ~pkgSimulate();
};
/*}}}*/
APT_DEPRECATED void InstallProtect();
- pkgProblemResolver(pkgDepCache *Cache);
+ explicit pkgProblemResolver(pkgDepCache *Cache);
virtual ~pkgProblemResolver();
};
/*}}}*/
class NOTMatcher : public Matcher {
Matcher * const matcher;
public:
- NOTMatcher(Matcher * const matcher);
+ 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);
public:
// 5 ought to be enough for everybody… c++11 variadic templates would be nice
ANDMatcher();
- ANDMatcher(Matcher * const matcher1);
+ explicit ANDMatcher(Matcher * const matcher1);
ANDMatcher(Matcher * const matcher1, Matcher * const matcher2);
ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
public:
// 5 ought to be enough for everybody… c++11 variadic templates would be nice
ORMatcher();
- ORMatcher(Matcher * const matcher1);
+ explicit ORMatcher(Matcher * const matcher1);
ORMatcher(Matcher * const matcher1, Matcher * const matcher2);
ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
class PackageNameMatchesRegEx : public PackageMatcher { /*{{{*/
regex_t* pattern;
public:
- PackageNameMatchesRegEx(std::string const &Pattern);
+ explicit PackageNameMatchesRegEx(std::string const &Pattern);
virtual bool operator() (pkgCache::PkgIterator const &Pkg);
virtual bool operator() (pkgCache::GrpIterator const &Grp);
virtual ~PackageNameMatchesRegEx();
class PackageNameMatchesFnmatch : public PackageMatcher { /*{{{*/
const std::string Pattern;
public:
- PackageNameMatchesFnmatch(std::string const &Pattern);
+ explicit PackageNameMatchesFnmatch(std::string const &Pattern);
virtual bool operator() (pkgCache::PkgIterator const &Pkg);
virtual bool operator() (pkgCache::GrpIterator const &Grp);
virtual ~PackageNameMatchesFnmatch() {};
class PackageIsNewInstall : public PackageMatcher { /*{{{*/
pkgCacheFile * const Cache;
public:
- PackageIsNewInstall(pkgCacheFile * const Cache);
+ explicit PackageIsNewInstall(pkgCacheFile * const Cache);
virtual bool operator() (pkgCache::PkgIterator const &Pkg);
virtual ~PackageIsNewInstall();
};
public:
// This constructor is the 'begin' constructor, never use it.
- inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
+ explicit inline GrpIterator(pkgCache &Owner) : Iterator<Group, GrpIterator>(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
}
public:
// This constructor is the 'begin' constructor, never use it.
- inline PkgIterator(pkgCache &Owner) : Iterator<Package, PkgIterator>(Owner), HashIndex(-1) {
+ explicit inline PkgIterator(pkgCache &Owner) : Iterator<Package, PkgIterator>(Owner), HashIndex(-1) {
S = OwnerPointer();
operator ++(0);
}
// Constructors
inline RlsFileIterator() : Iterator<ReleaseFile, RlsFileIterator>() {}
- inline RlsFileIterator(pkgCache &Owner) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Owner.RlsFileP) {}
+ explicit inline RlsFileIterator(pkgCache &Owner) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Owner.RlsFileP) {}
inline RlsFileIterator(pkgCache &Owner,ReleaseFile *Trg) : Iterator<ReleaseFile, RlsFileIterator>(Owner, Trg) {}
};
/*}}}*/
// Constructors
inline PkgFileIterator() : Iterator<PackageFile, PkgFileIterator>() {}
- inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {}
+ explicit inline PkgFileIterator(pkgCache &Owner) : Iterator<PackageFile, PkgFileIterator>(Owner, Owner.PkgFileP) {}
inline PkgFileIterator(pkgCache &Owner,PackageFile *Trg) : Iterator<PackageFile, PkgFileIterator>(Owner, Trg) {}
};
/*}}}*/
void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; }
CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
PackageContainerInterface();
- PackageContainerInterface(CacheSetHelper::PkgSelector const by);
+ explicit PackageContainerInterface(CacheSetHelper::PkgSelector const by);
virtual ~PackageContainerInterface();
APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {
typename Container::const_iterator _iter;
public:
- const_iterator(typename Container::const_iterator i) : _iter(i) {}
+ explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
typename Container::iterator _iter;
public:
- iterator(typename Container::iterator i) : _iter(i) {}
+ explicit iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::PkgIterator getPkg(void) const { return *_iter; }
inline pkgCache::PkgIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
PackageContainer() : PackageContainerInterface(CacheSetHelper::UNKNOWN) {}
- PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
+ explicit PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
APT_IGNORE_DEPRECATED_PUSH
APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
APT_IGNORE_DEPRECATED_POP
APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
- APT_PUBLIC PackageUniverse(pkgCache * const Owner);
+ explicit APT_PUBLIC PackageUniverse(pkgCache * const Owner);
APT_PUBLIC virtual ~PackageUniverse();
private:
public std::iterator<std::forward_iterator_tag, typename Container::const_iterator> {/*{{{*/
typename Container::const_iterator _iter;
public:
- const_iterator(typename Container::const_iterator i) : _iter(i) {}
+ explicit const_iterator(typename Container::const_iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::const_iterator(void) const { return _iter; }
public std::iterator<std::forward_iterator_tag, typename Container::iterator> {
typename Container::iterator _iter;
public:
- iterator(typename Container::iterator i) : _iter(i) {}
+ explicit iterator(typename Container::iterator i) : _iter(i) {}
pkgCache::VerIterator getVer(void) const { return *_iter; }
inline pkgCache::VerIterator operator*(void) const { return *_iter; }
operator typename Container::iterator(void) const { return _iter; }
unsigned long long FileSize;
unsigned int CalcHashes;
- PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {}
+ explicit PrivateHashes(unsigned int const CalcHashes) : FileSize(0), CalcHashes(CalcHashes) {}
};
/*}}}*/
// Hashes::Add* - Add the contents of data or FD /*{{{*/
Sum[I] = S[I];
}
- HashSumValue(std::string Str)
+ explicit HashSumValue(std::string const &Str)
{
memset(Sum,0,sizeof(Sum));
Set(Str);
va_list args;
ssize_t size = 400;
while (true) {
- bool ret = false;
+ bool ret;
va_start(args,format);
ret = iovprintf(out, format, args, size);
va_end(args);
ssize_t size = 400;
std::ostringstream outstr;
while (true) {
- bool ret = false;
+ bool ret;
va_start(args,format);
ret = iovprintf(outstr, format, args, size);
va_end(args);
}
template<typename CallC>
-void foreachTarget(std::string const URI, std::string const Dist,
+void foreachTarget(std::string const &URI, std::string const &Dist,
std::map<std::string, std::vector<debReleaseIndex::debSectionEntry const *> > const &ArchEntries,
CallC &Call)
{
// ---------------------------------------------------------------------
/* */
pkgDepCache::pkgDepCache(pkgCache *pCache,Policy *Plcy) :
- group_level(0), Cache(pCache), PkgState(0), DepState(0)
+ group_level(0), Cache(pCache), PkgState(0), DepState(0),
+ iUsrSize(0), iDownloadSize(0), iInstCount(0), iDelCount(0), iKeepCount(0),
+ iBrokenCount(0), iPolicyBrokenCount(0), iBadCount(0)
{
DebugMarker = _config->FindB("Debug::pkgDepCache::Marker", false);
DebugAutoInstall = _config->FindB("Debug::pkgDepCache::AutoInstall", false);
/* */
struct CompareProviders {
pkgCache::PkgIterator const Pkg;
- CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {};
+ explicit CompareProviders(pkgCache::DepIterator const &Dep) : Pkg(Dep.TargetPkg()) {};
//bool operator() (APT::VersionList::iterator const &AV, APT::VersionList::iterator const &BV)
bool operator() (pkgCache::VerIterator const &AV, pkgCache::VerIterator const &BV)
{
* As long as this object exists, no automatic cleanup
* operations will be undertaken.
*/
- ActionGroup(pkgDepCache &cache);
+ explicit ActionGroup(pkgDepCache &cache);
/** \brief Clean up the action group before it is destroyed.
*
// PackageCopy::RewriteEntry - Rewrite the entry with a new filename /*{{{*/
bool PackageCopy::RewriteEntry(FileFd &Target,string const &File)
{
- string const Dir(File,0,File.rfind('/'));
std::vector<pkgTagSection::Tag> Changes;
Changes.push_back(pkgTagSection::Tag::Rewrite("Filename", File));
bool IsTrusted() const { return Trusted; };
- pkgIndexFile(bool Trusted);
+ explicit pkgIndexFile(bool Trusted);
virtual ~pkgIndexFile();
};
return this->SupportsAcquireByHash;
}
-APT_PURE bool indexRecords::CheckDist(const string MaybeDist) const
+APT_PURE bool indexRecords::CheckDist(string const &MaybeDist) const
{
return (this->Dist == MaybeDist
|| this->Suite == MaybeDist);
return this->Date;
}
-APT_PURE indexRecords::checkSum *indexRecords::Lookup(const string MetaKey)
+APT_PURE indexRecords::checkSum *indexRecords::Lookup(string const &MetaKey)
{
std::map<std::string, indexRecords::checkSum* >::const_iterator sum = Entries.find(MetaKey);
if (sum == Entries.end())
return Entries.find(MetaKey) != Entries.end();
}
-bool indexRecords::Load(const string Filename) /*{{{*/
+bool indexRecords::Load(string const &Filename) /*{{{*/
{
FileFd Fd;
if (OpenMaybeClearSignedFile(Filename, Fd) == false)
this->Trusted = NEVER_TRUSTED;
}
-#if APT_PKG_ABI >= 413
indexRecords::indexRecords(const string &ExpectedDist) :
Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
SupportsAcquireByHash(false)
{
}
-#else
-indexRecords::indexRecords() :
- Trusted(CHECK_TRUST), d(NULL), ExpectedDist(""), ValidUntil(0),
- SupportsAcquireByHash(false)
-{
-}
-indexRecords::indexRecords(const string ExpectedDist) :
- Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
- SupportsAcquireByHash(false)
-{
-}
-#endif
indexRecords::~indexRecords() {}
std::map<std::string,checkSum *> Entries;
public:
-#if APT_PKG_ABI >= 413
- indexRecords(const std::string &ExpectedDist = "");
-#else
- indexRecords();
- indexRecords(const std::string ExpectedDist);
-#endif
+ explicit indexRecords(const std::string &ExpectedDist = "");
// Lookup function
- virtual checkSum *Lookup(const std::string MetaKey);
+ virtual checkSum *Lookup(std::string const &MetaKey);
/** \brief tests if a checksum for this file is available */
bool Exists(std::string const &MetaKey) const;
std::vector<std::string> MetaKeys();
- virtual bool Load(std::string Filename);
- virtual bool CheckDist(const std::string MaybeDist) const;
+ virtual bool Load(std::string const &Filename);
+ virtual bool CheckDist(std::string const &MaybeDist) const;
std::string GetDist() const;
std::string GetSuite() const;
void WriteToStatusFd(std::string msg);
public:
- PackageManagerProgressFd(int progress_fd);
+ explicit PackageManagerProgressFd(int progress_fd);
virtual ~PackageManagerProgressFd();
virtual void StartDpkg();
void WriteToStatusFd(std::string msg);
public:
- PackageManagerProgressDeb822Fd(int progress_fd);
+ explicit PackageManagerProgressDeb822Fd(int progress_fd);
virtual ~PackageManagerProgressDeb822Fd();
virtual void StartDpkg();
int Score(PkgIterator Pkg);
- pkgOrderList(pkgDepCache *Cache);
+ explicit pkgOrderList(pkgDepCache *Cache);
virtual ~pkgOrderList();
};
/** \brief returns all packages dpkg let disappear */
inline std::set<std::string> GetDisappearedPackages() { return disappearedPkgs; };
- pkgPackageManager(pkgDepCache *Cache);
+ explicit pkgPackageManager(pkgDepCache *Cache);
virtual ~pkgPackageManager();
private:
template<typename Iter> class Dynamic {
public:
static std::vector<Iter*> toReMap;
- Dynamic(Iter &I) {
+ explicit Dynamic(Iter &I) {
toReMap.push_back(&I);
}
Parser &Lookup(pkgCache::DescFileIterator const &Desc);
// Construct destruct
- pkgRecords(pkgCache &Cache);
+ explicit pkgRecords(pkgCache &Cache);
virtual ~pkgRecords();
};
/*}}}*/
struct PkgPin : Pin
{
std::string Pkg;
- PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {};
+ explicit PkgPin(std::string const &Pkg) : Pin(), Pkg(Pkg) {};
};
Pin *Pins;
bool InitDefaults();
- pkgPolicy(pkgCache *Owner);
+ explicit pkgPolicy(pkgCache *Owner);
virtual ~pkgPolicy();
private:
pkgCache::VerIterator GetCandidateVerNew(pkgCache::PkgIterator const &Pkg);
time_t GetLastModifiedTime();
pkgSourceList();
- pkgSourceList(std::string File);
+ explicit pkgSourceList(std::string File);
virtual ~pkgSourceList();
};
return true;
}
/*}}}*/
+
+
+pkgSrcRecords::Parser::Parser(const pkgIndexFile *Index) : iIndex(Index) {}
+pkgSrcRecords::Parser::~Parser() {}
// Abstract parser for each source record
class Parser
{
+ void *d;
protected:
const pkgIndexFile *iIndex;
virtual bool Files(std::vector<pkgSrcRecords::File> &F) = 0;
bool Files2(std::vector<pkgSrcRecords::File2> &F);
-
- Parser(const pkgIndexFile *Index) : iIndex(Index) {};
- virtual ~Parser() {};
+
+ explicit Parser(const pkgIndexFile *Index);
+ virtual ~Parser();
};
private:
// Locate a package by name and return pointer to the Parser.
// The pointer is owned by libapt.
Parser* Find(const char *Package,bool const &SrcOnly = false);
-
- pkgSrcRecords(pkgSourceList &List);
+
+ explicit pkgSrcRecords(pkgSourceList &List);
virtual ~pkgSrcRecords();
};
unsigned int StartValue;
unsigned int NextInBucket;
- TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
+ explicit TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
};
std::vector<TagData> Tags;
};
unsigned long ControlLen;
public:
- DebFile(const char *FileName);
+ explicit DebFile(const char *FileName);
~DebFile();
bool DoItem(Item &I, int &fd);
bool Process(pkgDirStream::Item &I, const unsigned char *data,