// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tagfile.cc,v 1.28 2001/03/13 06:51:46 jgg Exp $
+// $Id: tagfile.cc,v 1.30 2001/05/14 05:56:26 jgg Exp $
/* ######################################################################
Fast scanner for RFC-822 type header information
#include <string>
#include <stdio.h>
+#include <ctype.h>
/*}}}*/
+using std::string;
+
// TagFile::pkgTagFile - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
{
Buffer = 0;
Start = End = Buffer = 0;
- Left = 0;
+ Done = true;
iOffset = 0;
return;
}
Buffer = new char[Size];
Start = End = Buffer;
- Left = Fd.Size();
- TotalSize = Fd.Size();
+ Done = false;
iOffset = 0;
Fill();
}
Start = Buffer;
End = Buffer + EndSize;
- if (Left == 0)
+ if (Done == true)
{
if (EndSize <= 3)
return false;
}
// See if only a bit of the file is left
+ unsigned long Actual;
+ if (Fd.Read(End,Size - (End - Buffer),&Actual) == false)
+ return false;
+ if (Actual != Size - (End - Buffer))
+ Done = true;
+ End += Actual;
+/*
if (Left < Size - (End - Buffer))
{
if (Fd.Read(End,Left) == false)
Left -= Size - (End - Buffer);
End = Buffer + Size;
- }
+ }*/
+
return true;
}
/*}}}*/
// Reposition and reload..
iOffset = Offset;
- Left = TotalSize - Offset;
+ Done = false;
if (Fd.Seek(Offset) == false)
return false;
End = Start = Buffer;