// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: version.h,v 1.7 2001/05/14 05:58:33 jgg Exp $
+// $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $
/* ######################################################################
Version - Versioning system..
#ifndef PKGLIB_VERSION_H
#define PKGLIB_VERSION_H
-#ifdef __GNUG__
-#pragma interface "apt-pkg/version.h"
-#endif
-
+#include <apt-pkg/strutl.h>
#include <string>
+#ifndef APT_8_CLEANER_HEADERS
using std::string;
+#endif
class pkgVersioningSystem
{
// Global list of VS's
static pkgVersioningSystem **GlobalList;
static unsigned long GlobalListLen;
- static pkgVersioningSystem *GetVS(const char *Label);
+ static pkgVersioningSystem *GetVS(const char *Label) APT_PURE;
const char *Label;
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;
- virtual string UpstreamVersion(const char *A) = 0;
+ virtual std::string UpstreamVersion(const char *A) = 0;
// See if the given VS is compatible with this one..
virtual bool TestCompatibility(pkgVersioningSystem const &Against)
{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.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());
- };
- 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.c_str(),A.c_str()+A.length(),B.c_str(),B.c_str()+B.length());
- };
+ APT_MKSTRCMP(CmpVersion,DoCmpVersion);
+ APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer);
pkgVersioningSystem();
virtual ~pkgVersioningSystem() {};
};
-#ifdef APT_COMPATIBILITY
-#include <apt-pkg/debversion.h>
-#endif
-
#endif