Base revisions
[ntk/apt.git] / apt-pkg / version.h
1 // -*- mode: cpp; mode: fold -*-
2 // Description /*{{{*/
3 // $Id: version.h,v 1.1 1998/07/02 02:58:13 jgg Exp $
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
18 #include <string>
19
20 class pkgVersion
21 {
22 string Value;
23
24 public:
25
26 inline operator string () const {return Value;};
27
28 // Assignmnet
29 void operator =(string rhs) {Value = rhs;};
30
31 // Comparitors. STL will provide the rest
32 bool operator ==(const pkgVersion &rhs) const;
33 bool operator <(const pkgVersion &rhs) const;
34
35 pkgVersion();
36 pkgVersion(string Version) : Value(Version) {};
37 };
38
39 int pkgVersionCompare(const char *A, const char *B);
40 int pkgVersionCompare(const char *A, const char *AEnd, const char *B,
41 const char *BEnd);
42 int pkgVersionCompare(string A,string B);
43 bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op);
44
45 #endif