// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: version.h,v 1.6 2001/02/20 07:03:17 jgg Exp $
+// $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $
/* ######################################################################
Version - Versioning system..
#pragma interface "apt-pkg/version.h"
#endif
+#include <apt-pkg/strutl.h>
#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;
{return this == &Against;};
// Shortcuts
- inline int CmpVersion(const char *A, const char *B)
- {
- return DoCmpVersion(A,A+strlen(A),B,B+strlen(B));
- };
- inline int CmpVersion(string A,string B)
- {
- return DoCmpVersion(A.begin(),A.end(),B.begin(),B.end());
- };
- inline int CmpReleaseVer(const char *A, const char *B)
- {
- return DoCmpReleaseVer(A,A+strlen(A),B,B+strlen(B));
- };
- inline int CmpReleaseVer(string A,string B)
- {
- return DoCmpReleaseVer(A.begin(),A.end(),B.begin(),B.end());
- };
+ APT_MKSTRCMP(CmpVersion,DoCmpVersion);
+ APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer);
pkgVersioningSystem();
virtual ~pkgVersioningSystem() {};