// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: configuration.cc,v 1.21 2001/04/29 05:24:42 jgg Exp $
+// $Id: configuration.cc,v 1.22 2001/05/14 05:47:30 jgg Exp $
/* ######################################################################
Configuration Class
#include <vector>
#include <algorithm>
#include <fstream>
+#include <iostream>
#include <stdio.h>
#include <dirent.h>
#include <sys/stat.h>
#include <unistd.h>
+
+using namespace std;
/*}}}*/
Configuration *_config = new Configuration;
if (Len != 0)
{
for (; I != 0; Last = &I->Next, I = I->Next)
- if ((Res = stringcasecmp(I->Tag.begin(),I->Tag.end(),S,S + Len)) == 0)
+ if ((Res = stringcasecmp(I->Tag,S,S + Len)) == 0)
break;
}
else
unsigned Depth)
{
// Open the stream for reading
- ifstream F(FName.c_str(),ios::in | ios::nocreate);
+ ifstream F(FName.c_str(),ios::in);
if (!F != 0)
return _error->Errno("ifstream::ifstream",_("Opening configuration file %s"),FName.c_str());
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: pkgcache.cc,v 1.34 2001/04/29 05:13:51 jgg Exp $
+// $Id: pkgcache.cc,v 1.35 2001/05/14 05:54:10 jgg Exp $
/* ######################################################################
Package Cache - Accessor code for the cache
#include <sys/stat.h>
#include <unistd.h>
+#include <ctype.h>
#include <system.h>
-
/*}}}*/
+using std::string;
+
// Cache::Header::Header - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* Simply initialize the header */
unsigned long pkgCache::sHash(string Str) const
{
unsigned long Hash = 0;
- for (const char *I = Str.begin(); I != Str.end(); I++)
+ for (string::const_iterator I = Str.begin(); I != Str.end(); I++)
Hash = 5*Hash + tolower(*I);
return Hash % _count(HeaderP->HashTable);
}
for (; Pkg != PkgP; Pkg = PkgP + Pkg->NextPackage)
{
if (Pkg->Name != 0 && StrP[Pkg->Name] == Name[0] &&
- stringcasecmp(Name.begin(),Name.end(),StrP + Pkg->Name) == 0)
+ stringcasecmp(Name,StrP + Pkg->Name) == 0)
return PkgIterator(*this,Pkg);
}
return PkgIterator(*this,0);
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: tagfile.cc,v 1.29 2001/04/22 05:42:52 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 /*{{{*/
// ---------------------------------------------------------------------
/* */
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: version.h,v 1.6 2001/02/20 07:03:17 jgg Exp $
+// $Id: version.h,v 1.7 2001/05/14 05:58:33 jgg Exp $
/* ######################################################################
Version - Versioning system..
#include <string>
+using std::string;
+
class pkgVersioningSystem
{
public:
// Compare versions..
virtual int DoCmpVersion(const char *A,const char *Aend,
const char *B,const char *Bend) = 0;
+
virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) = 0;
virtual int DoCmpReleaseVer(const char *A,const char *Aend,
const char *B,const char *Bend) = 0;
};
inline int CmpVersion(string A,string B)
{
- return DoCmpVersion(A.begin(),A.end(),B.begin(),B.end());
+ return DoCmpVersion(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());
};
inline int CmpReleaseVer(const char *A, const char *B)
{
};
inline int CmpReleaseVer(string A,string B)
{
- return DoCmpReleaseVer(A.begin(),A.end(),B.begin(),B.end());
+ return DoCmpReleaseVer(A.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());
};
pkgVersioningSystem();