]>
Commit | Line | Data |
---|---|---|
578bfd0a AL |
1 | // -*- mode: cpp; mode: fold -*- |
2 | // Description /*{{{*/ | |
6c139d6e | 3 | // $Id: version.h,v 1.2 1998/07/07 04:17:09 jgg Exp $ |
578bfd0a AL |
4 | /* ###################################################################### |
5 | ||
6 | Version - Version string | |
7 | ||
8 | This class implements storage and operators for version strings. | |
9 | ||
10 | The client is responsible for stripping epochs should it be desired. | |
11 | ||
12 | ##################################################################### */ | |
13 | /*}}}*/ | |
14 | // Header section: pkglib | |
15 | #ifndef PKGLIB_VERSION_H | |
16 | #define PKGLIB_VERSION_H | |
17 | ||
6c139d6e AL |
18 | #ifdef __GNUG__ |
19 | #pragma interface "pkglib/version.h" | |
20 | #endif | |
21 | ||
578bfd0a AL |
22 | #include <string> |
23 | ||
24 | class pkgVersion | |
25 | { | |
26 | string Value; | |
27 | ||
28 | public: | |
29 | ||
30 | inline operator string () const {return Value;}; | |
31 | ||
32 | // Assignmnet | |
33 | void operator =(string rhs) {Value = rhs;}; | |
34 | ||
35 | // Comparitors. STL will provide the rest | |
36 | bool operator ==(const pkgVersion &rhs) const; | |
37 | bool operator <(const pkgVersion &rhs) const; | |
38 | ||
39 | pkgVersion(); | |
40 | pkgVersion(string Version) : Value(Version) {}; | |
41 | }; | |
42 | ||
43 | int pkgVersionCompare(const char *A, const char *B); | |
44 | int pkgVersionCompare(const char *A, const char *AEnd, const char *B, | |
45 | const char *BEnd); | |
46 | int pkgVersionCompare(string A,string B); | |
47 | bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op); | |
48 | ||
49 | #endif |