-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathversion.h
46 lines (34 loc) · 929 Bytes
/
version.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*! @file
* @brief Software versioning of source code tree.
*
* This file is automatically mentained by the do-tag script.
*/
#ifndef VERSION_H_
#define VERSION_H_
/* stl */
#include <string>
#include <sstream>
using namespace std;
#define VERSION_MAJOR 1 /*<! @brief Major version number. */
#define VERSION_MINOR 0 /*<! @brief Minor version number. */
#define VERSION_PATCH 1 /*<! @brief patch number. */
struct VERSION {
VERSION() : bSet(false) {}
VERSION(int vmajor, int vminor, int vpatch) : bSet(true) {
this->major=vmajor; this->minor=vminor; this->patch=vpatch;
}
bool bSet;
int major;
int minor;
int patch;
string toStr() {
// version has the format: v<major>.<minor>[-p<patch>]
if(!bSet) return("");
ostringstream stream;
stream << "v" << major << "." << minor;
if(patch!=0) stream << "-p" << patch;
return(stream.str());
}
};
VERSION getAppVersion();
#endif /* VERSION_H_ */