fw4spl
fwRuntime/include/fwRuntime/Version.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2017.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWRUNTIME_VERSION_HPP__
8 #define __FWRUNTIME_VERSION_HPP__
9 
10 #include "fwRuntime/config.hpp"
11 
12 #include <iostream>
13 #include <string>
14 
15 namespace fwRuntime
16 {
17 
21 struct Version
22 {
23 
29  FWRUNTIME_API Version();
30 
36  FWRUNTIME_API Version(const std::string& version);
37 
45  FWRUNTIME_API Version(const int major, const int minor = 0, const int patch = -1);
46 
50  FWRUNTIME_API bool operator==(const Version& version) const;
51 
55  FWRUNTIME_API const std::string string() const;
56 
60  FWRUNTIME_API friend std::ostream& operator<<(std::ostream& os, const Version& version);
61 
62  private:
63 
64  int m_major;
65  int m_minor;
66  int m_patch;
67  bool m_defined;
68 };
69 
70 } // namespace fwRuntime
71 
72 #endif /*__FWRUNTIME_VERSION_HPP__*/
FWRUNTIME_API Version()
Constructor.
The namespace fwRuntime contains classes to manage bundle, configuration element, extension point in ...
FWRUNTIME_API friend std::ostream & operator<<(std::ostream &os, const Version &version)
Return an ostream representation of a version.
FWRUNTIME_API bool operator==(const Version &version) const
Equality test.
Holds version information for libraries and bundles.
FWRUNTIME_API const std::string string() const
String converter.