summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-06-18 10:46:08 +0200
committerMichael Vogt <mvo@debian.org>2014-06-18 10:46:08 +0200
commitb6fea8bbe25e3c0312de72c99b0d49c699d02b7b (patch)
treee0f1b5f51e568be9370dece04ede0352ee37684a /apt-pkg/tagfile.cc
parentda029b0aaebdc64a3a9f6b7012213539421c934b (diff)
parent59194959326dbf114a5c894e4279c04844b4a793 (diff)
Merge remote-tracking branch 'mvo/feature/update-by-hash' into debian/experimental
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r--apt-pkg/tagfile.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 52f4da2d5..7085e7d69 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -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 */