libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
version.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3 ** Copyright (C) 2010 Aldebaran Robotics
4 ** See COPYING for the license
5 */
6 
7 
8 #ifndef _QI_VERSION_HPP_
9 # define _QI_VERSION_HPP_
10 
11 // scoped_ptr needs to have dll-interface to be used
12 # ifdef _MSC_VER
13 # pragma warning( push )
14 # pragma warning( disable: 4251 )
15 # endif
16 
17 # include <qi/api.hpp>
18 # include <vector>
19 # include <string>
20 # include <boost/scoped_ptr.hpp>
21 
22 namespace qi {
27  namespace version {
28 
29  class VersionPrivate;
30 
36  {
37  public:
39  Version();
41  Version(const Version &other);
43  Version(const std::string &version);
45  Version(const char *version);
47  ~Version();
48 
50  Version &operator= (const Version& rhs);
51 
53  operator const std::string&() const;
54 
60  bool operator< (const Version& pi) const;
66  bool operator> (const Version& pi) const;
72  bool operator==(const Version& pi) const;
78  bool operator!=(const Version& pi) const;
84  bool operator<=(const Version& pi) const;
90  bool operator>=(const Version& pi) const;
91 
92  private:
93  boost::scoped_ptr<VersionPrivate> _p;
94  };
95 
103  QI_API std::vector<std::string> explode(const std::string &version);
104 
111  QI_API int compare(const std::string &versionA,
112  const std::string &versionB);
113 
119  QI_API std::string extract(const std::string &version);
120  }
121 }
122 
123 #ifdef _MSC_VER
124 # pragma warning( pop )
125 #endif
126 
127 #endif // _QI_VERSION_HPP_
#define QI_API
Definition: api.hpp:33
dll import/export and compiler message
Compare version strings Simple class that allow comparing two version number.
Definition: version.hpp:35
bool operator==(const Signature &lhs, const Signature &rhs)
int compare(const std::string &versionA, const std::string &versionB)
Compare version numbers.
std::string extract(const std::string &version)
Extract version number from string.
bool operator<(const AnyReference &a, const AnyReference &b)
bool operator!=(const Signature &lhs, const Signature &rhs)
Definition: signature.hpp:157
std::vector< std::string > explode(const std::string &version)
Explode a version string to an array of strings.