summaryrefslogtreecommitdiff
path: root/apt-pkg/tagfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r--apt-pkg/tagfile.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/apt-pkg/tagfile.cc b/apt-pkg/tagfile.cc
index 1d6d10d57..a55d5214a 100644
--- a/apt-pkg/tagfile.cc
+++ b/apt-pkg/tagfile.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tagfile.cc,v 1.14 1998/11/13 04:23:36 jgg Exp $
+// $Id: tagfile.cc,v 1.15 1998/11/27 01:14:06 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
@@ -180,3 +180,28 @@ bool pkgTagSection::Find(const char *Tag,const char *&Start,
return false;
}
/*}}}*/
+// pkgTagSection::FindS - Find a string /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string pkgTagSection::FindS(const char *Tag)
+{
+ const char *Start;
+ const char *End;
+ if (Find(Tag,Start,End) == false)
+ return string();
+ return string(Start,End);
+}
+ /*}}}*/
+// TagSection::FindI - Find an integer /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+unsigned int pkgTagSection::FindI(const char *Tag)
+{
+ const char *Start;
+ const char *End;
+ if (Find(Tag,Start,End) == false)
+ return 0;
+
+ return atoi(string(Start,End).c_str());
+}
+ /*}}}*/