]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/tagfile.cc
make compressed-indexes test pass again
[apt.git] / apt-pkg / tagfile.cc
index 52f4da2d5864fe5dd459d568b474176e15b20931..7085e7d6968606646c26b2e5ada590784522de1c 100644 (file)
@@ -518,6 +518,17 @@ unsigned long long pkgTagSection::FindULL(const char *Tag, unsigned long long co
    return Result;
 }
                                                                        /*}}}*/
+// TagSection::FindB - Find boolean value                              /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+bool pkgTagSection::FindB(const char *Tag, bool const &Default) const
+{
+   const char *Start, *Stop;
+   if (Find(Tag, Start, Stop) == false)
+      return Default;
+   return StringToBool(string(Start, Stop));
+}
+                                                                       /*}}}*/
 // TagSection::FindFlag - Locate a yes/no type flag                    /*{{{*/
 // ---------------------------------------------------------------------
 /* The bits marked in Flag are masked on/off in Flags */