summaryrefslogtreecommitdiff
path: root/apt-pkg/version.h
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/version.h')
-rw-r--r--apt-pkg/version.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/apt-pkg/version.h b/apt-pkg/version.h
new file mode 100644
index 000000000..a30246946
--- /dev/null
+++ b/apt-pkg/version.h
@@ -0,0 +1,45 @@
+// -*- mode: cpp; mode: fold -*-
+// Description /*{{{*/
+// $Id: version.h,v 1.1 1998/07/02 02:58:13 jgg Exp $
+/* ######################################################################
+
+ Version - Version string
+
+ This class implements storage and operators for version strings.
+
+ The client is responsible for stripping epochs should it be desired.
+
+ ##################################################################### */
+ /*}}}*/
+// Header section: pkglib
+#ifndef PKGLIB_VERSION_H
+#define PKGLIB_VERSION_H
+
+#include <string>
+
+class pkgVersion
+{
+ string Value;
+
+ public:
+
+ inline operator string () const {return Value;};
+
+ // Assignmnet
+ void operator =(string rhs) {Value = rhs;};
+
+ // Comparitors. STL will provide the rest
+ bool operator ==(const pkgVersion &rhs) const;
+ bool operator <(const pkgVersion &rhs) const;
+
+ pkgVersion();
+ pkgVersion(string Version) : Value(Version) {};
+};
+
+int pkgVersionCompare(const char *A, const char *B);
+int pkgVersionCompare(const char *A, const char *AEnd, const char *B,
+ const char *BEnd);
+int pkgVersionCompare(string A,string B);
+bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op);
+
+#endif