+// VerIterator::Downloadable - Checks if the version is downloadable /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool pkgCache::VerIterator::Downloadable() const
+{
+ VerFileIterator Files = FileList();
+ for (; Files.end() == false; Files++)
+ if ((Files.File()->Flags & pkgCache::Flag::NotSource) != pkgCache::Flag::NotSource)
+ return true;
+ return false;
+}
+ /*}}}*/
+// VerIterator::PriorityType - Return a string describing the priority /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+const char *pkgCache::VerIterator::PriorityType()
+{
+ const char *Types[] = {"","Important","Required","Standard",
+ "Optional","Extra"};
+ if (Ver->Priority < 6)
+ return Types[Ver->Priority];
+ return "";
+}
+ /*}}}*/
+// VerIterator::Automatic - Check if this version is 'automatic' /*{{{*/
+// ---------------------------------------------------------------------
+/* This checks to see if any of the versions files are not NotAutomatic.
+ True if this version is selectable for automatic installation. */
+bool pkgCache::VerIterator::Automatic() const
+{
+ VerFileIterator Files = FileList();
+ for (; Files.end() == false; Files++)
+ if ((Files.File()->Flags & pkgCache::Flag::NotAutomatic) != pkgCache::Flag::NotAutomatic)
+ return true;
+ return false;
+}
+ /*}}}*/
+// VerIterator::NewestFile - Return the newest file version relation /*{{{*/
+// ---------------------------------------------------------------------
+/* This looks at the version numbers associated with all of the sources
+ this version is in and returns the highest.*/
+pkgCache::VerFileIterator pkgCache::VerIterator::NewestFile() const
+{
+ VerFileIterator Files = FileList();
+ VerFileIterator Highest = Files;
+ for (; Files.end() == false; Files++)
+ {
+ if (pkgVersionCompare(Files.File().Version(),Highest.File().Version()) > 0)
+ Highest = Files;
+ }
+
+ return Highest;
+}
+ /*}}}*/