// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tagfile.cc,v 1.13 1998/10/30 07:53:41 jgg Exp $
+// $Id: tagfile.cc,v 1.15 1998/11/27 01:14:06 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
/*}}}*/
// TagFile::Jump - Jump to a pre-recorded location in the file /*{{{*/
// ---------------------------------------------------------------------
-/* This jumps to a pre-recorded file location and */
+/* This jumps to a pre-recorded file location and reads the record
+ that is there */
bool pkgTagFile::Jump(pkgTagSection &Tag,unsigned long Offset)
{
iOffset = Offset;
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());
+}
+ /*}}}*/