version.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: version.h,v 1.1 1998/07/02 02:58:13 jgg Exp $
  4. /* ######################################################################
  5. Version - Version string
  6. This class implements storage and operators for version strings.
  7. The client is responsible for stripping epochs should it be desired.
  8. ##################################################################### */
  9. /*}}}*/
  10. // Header section: pkglib
  11. #ifndef PKGLIB_VERSION_H
  12. #define PKGLIB_VERSION_H
  13. #include <string>
  14. class pkgVersion
  15. {
  16. string Value;
  17. public:
  18. inline operator string () const {return Value;};
  19. // Assignmnet
  20. void operator =(string rhs) {Value = rhs;};
  21. // Comparitors. STL will provide the rest
  22. bool operator ==(const pkgVersion &rhs) const;
  23. bool operator <(const pkgVersion &rhs) const;
  24. pkgVersion();
  25. pkgVersion(string Version) : Value(Version) {};
  26. };
  27. int pkgVersionCompare(const char *A, const char *B);
  28. int pkgVersionCompare(const char *A, const char *AEnd, const char *B,
  29. const char *BEnd);
  30. int pkgVersionCompare(string A,string B);
  31. bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op);
  32. #endif