apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

version.h
Go to the documentation of this file.
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 /* ######################################################################
4 
5  Version - Versioning system..
6 
7  The versioning system represents how versions are compared, represented
8  and how dependencies are evaluated. As a general rule versioning
9  systems are not compatible unless specifically allowed by the
10  TestCompatibility query.
11 
12  The versions are stored in a global list of versions, but that is just
13  so that they can be queried when someone does 'apt-get -v'.
14  pkgSystem provides the proper means to access the VS for the active
15  system.
16 
17  ##################################################################### */
18  /*}}}*/
19 #ifndef PKGLIB_VERSION_H
20 #define PKGLIB_VERSION_H
21 
22 #include <apt-pkg/strutl.h>
23 #include <string>
24 
25 
27 {
28  public:
29  // Global list of VS's
31  static unsigned long GlobalListLen;
32  static pkgVersioningSystem *GetVS(const char *Label) APT_PURE;
33 
34  const char *Label;
35 
36  // Compare versions..
37  virtual int DoCmpVersion(const char *A,const char *Aend,
38  const char *B,const char *Bend) = 0;
39 
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;
44 
45  // See if the given VS is compatible with this one..
46  virtual bool TestCompatibility(pkgVersioningSystem const &Against)
47  {return this == &Against;};
48 
49  // Shortcuts
50  APT_MKSTRCMP(CmpVersion,DoCmpVersion);
51  APT_MKSTRCMP(CmpReleaseVer,DoCmpReleaseVer);
52 
54  virtual ~~pkgVersioningSystem();
55 };
56 
57 #endif
APT_MKSTRCMP(CmpReleaseVer, DoCmpReleaseVer)
static pkgVersioningSystem ** GlobalList
Definition: version.h:30
const char * Label
Definition: version.h:34
virtual bool CheckDep(const char *PkgVer, int Op, const char *DepVer)=0
virtual bool TestCompatibility(pkgVersioningSystem const &Against)
Definition: version.h:46
virtual int DoCmpVersion(const char *A, const char *Aend, const char *B, const char *Bend)=0
APT_MKSTRCMP(CmpVersion, DoCmpVersion)
virtual std::string UpstreamVersion(const char *A)=0
static unsigned long GlobalListLen
Definition: version.h:31
virtual int DoCmpReleaseVer(const char *A, const char *Aend, const char *B, const char *Bend)=0
#define APT_PURE
Definition: macros.h:56
#define APT_PUBLIC
Definition: macros.h:77