summaryrefslogtreecommitdiff
path: root/apt-pkg/cacheiterators.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/cacheiterators.h')
-rw-r--r--apt-pkg/cacheiterators.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 26070636e..b97a1a589 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -96,7 +96,7 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
protected:
inline Group* OwnerPointer() const {
- return Owner->GrpP;
+ return (Owner != 0) ? Owner->GrpP : 0;
};
public:
@@ -137,7 +137,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
protected:
inline Package* OwnerPointer() const {
- return Owner->PkgP;
+ return (Owner != 0) ? Owner->PkgP : 0;
};
public:
@@ -184,7 +184,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
protected:
inline Version* OwnerPointer() const {
- return Owner->VerP;
+ return (Owner != 0) ? Owner->VerP : 0;
};
public:
@@ -206,15 +206,10 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;};
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;};
inline const char *Arch() const {
- if(S->MultiArch == pkgCache::Version::All)
+ if (S->MultiArch == pkgCache::Version::All)
return "all";
return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
};
- inline const char *Arch(bool const pseudo) const {
- if(pseudo == false)
- return Arch();
- return S->ParentPkg == 0?0:Owner->StrP + ParentPkg()->Arch;
- };
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);};
inline DescIterator DescriptionList() const;
@@ -227,7 +222,6 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
string RelStr() const;
bool Automatic() const;
- bool Pseudo() const;
VerFileIterator NewestFile() const;
inline VerIterator(pkgCache &Owner,Version *Trg = 0) : Iterator<Version, VerIterator>(Owner, Trg) {
@@ -241,7 +235,7 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
class pkgCache::DescIterator : public Iterator<Description, DescIterator> {
protected:
inline Description* OwnerPointer() const {
- return Owner->DescP;
+ return (Owner != 0) ? Owner->DescP : 0;
};
public:
@@ -270,7 +264,7 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
protected:
inline Dependency* OwnerPointer() const {
- return Owner->DepP;
+ return (Owner != 0) ? Owner->DepP : 0;
};
public:
@@ -287,6 +281,7 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + Owner->VerP[S->ParentVer].ParentPkg);};
inline bool Reverse() const {return Type == DepRev;};
bool IsCritical() const;
+ bool IsNegative() const;
void GlobOr(DepIterator &Start,DepIterator &End);
Version **AllTargets() const;
bool SmartTargetPkg(PkgIterator &Result) const;
@@ -315,7 +310,7 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
protected:
inline Provides* OwnerPointer() const {
- return Owner->ProvideP;
+ return (Owner != 0) ? Owner->ProvideP : 0;
};
public:
@@ -349,7 +344,7 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
class pkgCache::PkgFileIterator : public Iterator<PackageFile, PkgFileIterator> {
protected:
inline PackageFile* OwnerPointer() const {
- return Owner->PkgFileP;
+ return (Owner != 0) ? Owner->PkgFileP : 0;
};
public:
@@ -382,7 +377,7 @@ class pkgCache::PkgFileIterator : public Iterator<PackageFile, PkgFileIterator>
class pkgCache::VerFileIterator : public pkgCache::Iterator<VerFile, VerFileIterator> {
protected:
inline VerFile* OwnerPointer() const {
- return Owner->VerFileP;
+ return (Owner != 0) ? Owner->VerFileP : 0;
};
public:
@@ -401,7 +396,7 @@ class pkgCache::VerFileIterator : public pkgCache::Iterator<VerFile, VerFileIter
class pkgCache::DescFileIterator : public Iterator<DescFile, DescFileIterator> {
protected:
inline DescFile* OwnerPointer() const {
- return Owner->DescFileP;
+ return (Owner != 0) ? Owner->DescFileP : 0;
};
public: