1 // -*- mode: cpp; mode: fold -*-
3 // $Id: debversion.h,v 1.3 2001/05/03 05:25:04 jgg Exp $
4 /* ######################################################################
6 Debian Version - Versioning system for Debian
8 This implements the standard Debian versioning system.
10 ##################################################################### */
12 #ifndef PKGLIB_DEBVERSION_H
13 #define PKGLIB_DEBVERSION_H
17 #include <apt-pkg/version.h>
19 class debVersioningSystem
: public pkgVersioningSystem
23 static int CmpFragment(const char *A
, const char *AEnd
, const char *B
,
27 virtual int DoCmpVersion(const char *A
,const char *Aend
,
28 const char *B
,const char *Bend
);
29 virtual bool CheckDep(const char *PkgVer
,int Op
,const char *DepVer
);
30 virtual int DoCmpReleaseVer(const char *A
,const char *Aend
,
31 const char *B
,const char *Bend
)
33 return DoCmpVersion(A
,Aend
,B
,Bend
);
35 virtual string
UpstreamVersion(const char *A
);
37 debVersioningSystem();
40 extern debVersioningSystem debVS
;
42 #ifdef APT_COMPATIBILITY
43 #if APT_COMPATIBILITY != 986
44 #warning "Using APT_COMPATIBILITY"
47 inline int pkgVersionCompare(const char *A
, const char *B
)
49 return debVS
.CmpVersion(A
,B
);
51 inline int pkgVersionCompare(const char *A
, const char *AEnd
,
52 const char *B
, const char *BEnd
)
54 return debVS
.DoCmpVersion(A
,AEnd
,B
,BEnd
);
56 inline int pkgVersionCompare(string A
,string B
)
58 return debVS
.CmpVersion(A
,B
);
60 inline bool pkgCheckDep(const char *DepVer
,const char *PkgVer
,int Op
)
62 return debVS
.CheckDep(PkgVer
,Op
,DepVer
);
64 inline string
pkgBaseVersion(const char *Ver
)
66 return debVS
.UpstreamVersion(Ver
);