version.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // -*- mode: cpp; mode: fold -*-
  2. // Description /*{{{*/
  3. // $Id: version.h,v 1.3 1998/07/12 23:58:43 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. #ifdef __GNUG__
  14. #pragma interface "apt-pkg/version.h"
  15. #endif
  16. #include <string>
  17. class pkgVersion
  18. {
  19. string Value;
  20. public:
  21. inline operator string () const {return Value;};
  22. // Assignmnet
  23. void operator =(string rhs) {Value = rhs;};
  24. // Comparitors. STL will provide the rest
  25. bool operator ==(const pkgVersion &rhs) const;
  26. bool operator <(const pkgVersion &rhs) const;
  27. pkgVersion();
  28. pkgVersion(string Version) : Value(Version) {};
  29. };
  30. int pkgVersionCompare(const char *A, const char *B);
  31. int pkgVersionCompare(const char *A, const char *AEnd, const char *B,
  32. const char *BEnd);
  33. int pkgVersionCompare(string A,string B);
  34. bool pkgCheckDep(const char *DepVer,const char *PkgVer,int Op);
  35. #endif