cleanCppProject  0.2.0
version.cpp.in
Go to the documentation of this file.
1 #include "version.h"
2 
3 using namespace std;
4 
5 
6 std::string Version::getBuildTime()
7 {
8  return std::string(__DATE__) + " " + __TIME__;
9 }
10 //-----------------------------------------------------------------------------------
11 int Version::getMajor()
12 {
13  return @MAJOR_VERSION@;
14 }
15 //-----------------------------------------------------------------------------------
16 int Version::getMinor()
17 {
18  return @MINOR_VERSION@;
19 }
20 //-----------------------------------------------------------------------------------
21 int Version::getPatch()
22 {
23  return @PATCH_VERSION@;
24 }
25 //-----------------------------------------------------------------------------------
26 long long Version::getVersionNumber()
27 {
28  return @MAJOR_VERSION@ * 10000 * 10000 + @MINOR_VERSION@ * 10000 +
29  @PATCH_VERSION@;
30 }
31 //-----------------------------------------------------------------------------------
32 std::string Version::getVersionShort()
33 {
34  string version = to_string(getMajor()) + "." + to_string(getMinor()) + "." +
35  to_string(getPatch()) + " @VERSION_TYPE@";
36  return version;
37 }
38 //-----------------------------------------------------------------------------------
39 std::string Version::getVersionLong()
40 {
41  return getVersionShort() + " / " + getBuildTime() + " / @VERSION_HOST@";
42 }
43 //-----------------------------------------------------------------------------------
44 std::string Version::getBuildMachine()
45 {
46  return "@VERSION_HOST@";
47 }
48 //-----------------------------------------------------------------------------------