Commit | Line | Data |
---|---|---|
578bfd0a AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
c24972cb | 3 | // $Id: version.h,v 1.8 2001/05/27 05:55:27 jgg Exp $ |
578bfd0a AL |
4 | /* ###################################################################### |
5 | ||
b2e465d6 AL |
6 | Version - Versioning system.. |
7 | ||
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. | |
578bfd0a | 12 | |
b2e465d6 AL |
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 | |
16 | system. | |
578bfd0a AL |
17 | |
18 | ##################################################################### */ | |
19 | /*}}}*/ | |
578bfd0a AL |
20 | #ifndef PKGLIB_VERSION_H |
21 | #define PKGLIB_VERSION_H | |
22 | ||
6c139d6e | 23 | |
c24972cb | 24 | #include <apt-pkg/strutl.h> |
578bfd0a AL |
25 | #include <string> |
26 | ||
b2e465d6 AL |
27 | class pkgVersioningSystem |
28 | { | |
29 | public: | |
30 | // Global list of VS's | |
31 | static pkgVersioningSystem **GlobalList; | |
32 | static unsigned long GlobalListLen; | |
33 | static pkgVersioningSystem *GetVS(const char *Label); | |
34 | ||
35 | const char *Label; | |
36 | ||
37 | // Compare versions.. | |
38 | virtual int DoCmpVersion(const char *A,const char *Aend, | |
39 | const char *B,const char *Bend) = 0; | |
851a45a8 | 40 | |
b2e465d6 AL |
41 | virtual bool CheckDep(const char *PkgVer,int Op,const char *DepVer) = 0; |
42 | virtual int DoCmpReleaseVer(const char *A,const char *Aend, | |
43 | const char *B,const char *Bend) = 0; | |
8f3ba4e8 | 44 | virtual std::string UpstreamVersion(const char *A) = 0; |
b2e465d6 AL |
45 | |
46 | // See if the given VS is compatible with this one.. | |
47 | virtual bool TestCompatibility(pkgVersioningSystem const &Against) | |
48 | {return this == &Against;}; | |
49 | ||
50 | // Shortcuts | |
c24972cb AL |
51 | APT_MKSTRCMP(CmpVersion,DoCmpVersion); |
52 | APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer); | |
b2e465d6 AL |
53 | |
54 | pkgVersioningSystem(); | |
55 | virtual ~pkgVersioningSystem() {}; | |
56 | }; | |
57 | ||
58 | #ifdef APT_COMPATIBILITY | |
59 | #include <apt-pkg/debversion.h> | |
60 | #endif | |
578bfd0a AL |
61 | |
62 | #endif |