]>
git.saurik.com Git - apt.git/blob - apt-pkg/version.h
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $
4 /* ######################################################################
6 Version - Versioning system..
8 The versioning system represents how versions are compared, represented
9 and how dependencies are evaluated. As a general rule versioning
10 systems are not compatible unless specifically allowed by the
11 TestCompatibility query.
13 The versions are stored in a global list of versions, but that is just
14 so that they can be queried when someone does 'apt-get -v'.
15 pkgSystem provides the proper means to access the VS for the active
18 ##################################################################### */
20 #ifndef PKGLIB_VERSION_H
21 #define PKGLIB_VERSION_H
23 #include <apt-pkg/strutl.h>
26 class pkgVersioningSystem
29 // Global list of VS's
30 static pkgVersioningSystem
**GlobalList
;
31 static unsigned long GlobalListLen
;
32 static pkgVersioningSystem
*GetVS(const char *Label
);
37 virtual int DoCmpVersion(const char *A
,const char *Aend
,
38 const char *B
,const char *Bend
) = 0;
40 virtual bool CheckDep(const char *PkgVer
,int Op
,const char *DepVer
) = 0;
41 virtual int DoCmpReleaseVer(const char *A
,const char *Aend
,
42 const char *B
,const char *Bend
) = 0;
43 virtual std::string
UpstreamVersion(const char *A
) = 0;
45 // See if the given VS is compatible with this one..
46 virtual bool TestCompatibility(pkgVersioningSystem
const &Against
)
47 {return this == &Against
;};
50 APT_MKSTRCMP(CmpVersion
,DoCmpVersion
);
51 APT_MKSTRCMP(CmpReleaseVer
,DoCmpReleaseVer
);
53 pkgVersioningSystem();
54 virtual ~pkgVersioningSystem() {};