X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/51c4e07f4cba0615ff269b5a8d04dfd3d1313b00..57f7fb6511fcc7c55ee7a88475d15385093c048e:/apt-pkg/cacheiterators.h

diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index 48547e564..62d0ab59c 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -35,6 +35,9 @@
 #include<iterator>
 #include <iosfwd>
 #include <string>
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+#include <apt-pkg/string_view.h>
+#endif
 
 #include<string.h>
 
@@ -114,6 +117,10 @@ class pkgCache::GrpIterator: public Iterator<Group, GrpIterator> {
 	inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
 	inline PkgIterator PackageList() const;
 	PkgIterator FindPkg(std::string Arch = "any") const;
+#ifdef APT_PKG_EXPOSE_STRING_VIEW
+	APT_HIDDEN PkgIterator FindPkg(APT::StringView Arch = APT::StringView("any", 3)) const;
+	APT_HIDDEN PkgIterator FindPkg(const char *Arch) const;
+#endif
 	/** \brief find the package with the "best" architecture
 
 	    The best architecture is either the "native" or the first
@@ -157,7 +164,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
 	inline const char *Name() const { return Group().Name(); }
 	// Versions have sections - and packages can have different versions with different sections
 	// so this interface is broken by design. Run as fast as you can to Version.Section().
-	APT_DEPRECATED inline const char *Section() const;
+	APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char *Section() const;
 	inline bool Purge() const {return S->CurrentState == pkgCache::State::Purge ||
 		(S->CurrentVer == 0 && S->CurrentState == pkgCache::State::NotInstalled);}
 	inline const char *Arch() const {return S->Arch == 0?0:Owner->StrP + S->Arch;}
@@ -168,11 +175,11 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
 	inline DepIterator RevDependsList() const APT_PURE;
 	inline PrvIterator ProvidesList() const APT_PURE;
 	OkState State() const APT_PURE;
-	const char *CandVersion() const APT_PURE;
+	APT_DEPRECATED_MSG("This method does not respect apt_preferences! Use pkgDepCache::GetCandidateVersion(Pkg)") const char *CandVersion() const APT_PURE;
 	const char *CurVersion() const APT_PURE;
 
 	//Nice printable representation
-	friend std::ostream& operator <<(std::ostream& out, PkgIterator i);
+	APT_DEPRECATED_MSG("Use APT::PrettyPkg instead") friend std::ostream& operator <<(std::ostream& out, PkgIterator i);
 	std::string FullName(bool const &Pretty = false) const;
 
 	// Constructors
@@ -298,7 +305,7 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
 		return (S2->CompareOp & pkgCache::Dep::MultiArchImplicit) == pkgCache::Dep::MultiArchImplicit;
 	}
 	/* This covers additionally negative dependencies, which aren't arch-specific,
-	   but change architecture nontheless as a Conflicts: foo does applies for all archs */
+	   but change architecture nonetheless as a Conflicts: foo does applies for all archs */
 	bool IsImplicit() const APT_PURE;
 
 	bool IsSatisfied(VerIterator const &Ver) const APT_PURE;
@@ -336,7 +343,7 @@ class pkgCache::DepIterator : public Iterator<Dependency, DepIterator> {
 	}
 
 	//Nice printable representation
-	friend std::ostream& operator <<(std::ostream& out, DepIterator D);
+	APT_DEPRECATED_MSG("Use APT::PrettyDep instead") friend std::ostream& operator <<(std::ostream& out, DepIterator D);
 
 	inline DepIterator(pkgCache &Owner, Dependency *Trg, Version* = 0) :
 		Iterator<Dependency, DepIterator>(Owner, Trg), Type(DepVer), S2(Trg == 0 ? Owner.DepDataP : (Owner.DepDataP + Trg->DependencyData)) {
@@ -514,7 +521,7 @@ inline pkgCache::VerFileIterator pkgCache::VerIterator::FileList() const
        {return VerFileIterator(*Owner,Owner->VerFileP + S->FileList);}
 inline pkgCache::DescFileIterator pkgCache::DescIterator::FileList() const
        {return DescFileIterator(*Owner,Owner->DescFileP + S->FileList);}
-APT_DEPRECATED inline const char * pkgCache::PkgIterator::Section() const
+APT_DEPRECATED_MSG("Use the .Section method of VerIterator instead") inline const char * pkgCache::PkgIterator::Section() const
        {return S->VersionList == 0 ? 0 : VersionList().Section();}
 									/*}}}*/
 #endif