diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:42 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:42 +0000 |
commit | a05599f12fd30388ee972ed2535d5297afe0c20b (patch) | |
tree | 330718193e8995ded786e1c7905a63d569af03de /apt-pkg/tagfile.cc | |
parent | c9807169492a1f5674fafc0af29eb37a9bbb26b3 (diff) |
Patchs for apt-cdrom
Author: jgg
Date: 1998-11-27 01:14:06 GMT
Patchs for apt-cdrom
Diffstat (limited to 'apt-pkg/tagfile.cc')
-rw-r--r-- | apt-pkg/tagfile.cc | 27 |
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()); +} + /*}}}*/ |