From 578bfd0aed2ec993f4ad85fa6a7094a852261422 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:50:36 +0000 Subject: Base revisions Author: jgg Date: 1998-07-02 02:58:12 GMT Base revisions --- apt-pkg/version.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 apt-pkg/version.h (limited to 'apt-pkg/version.h') 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 + +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 -- cgit v1.2.3