summaryrefslogtreecommitdiff
path: root/apt-pkg/version.h
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:36 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:36 +0000
commit578bfd0aed2ec993f4ad85fa6a7094a852261422 (patch)
tree737f52267f6468a4b6754f8c6665824767352746 /apt-pkg/version.h
downloadapt-578bfd0aed2ec993f4ad85fa6a7094a852261422.tar.gz
Base revisions
Author: jgg Date: 1998-07-02 02:58:12 GMT Base revisions
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