File: GameVersion.h

package info (click to toggle)
spring 104.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 47,512 kB
  • sloc: cpp: 391,093; ansic: 79,943; python: 12,356; java: 12,201; awk: 5,889; sh: 1,826; xml: 655; makefile: 486; perl: 405; php: 211; objc: 194; sed: 2
file content (120 lines) | stat: -rw-r--r-- 3,594 bytes parent folder | download | duplicates (4)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
/* This file is part of the Spring engine (GPL v2 or later), see LICENSE.html */

#ifndef GAME_VERSION_H
#define GAME_VERSION_H

#include <string>

/**
 * Allows fetching of all build-specific info.
 *
 * until 0.82:
 * - 0.82.0                (release)
 * - 0.82.0.2              (release)
 * - 0.82.7                (release)
 * - 0.82.7.1              (release)
 * - 0.82+.0               (development version from after 0.82.0)
 * - 0.82+.7.1             (development version from after 0.82.7.1)
 * since 0.83:
 * - 83.0                (release or hotfix preparation)
 * - 83.0.1              (main development version after the 0.83.0 release)
 */
namespace SpringVersion
{
	/**
	 * Major version number (e.g. "83")
	 * The feature integration version part.
	 * This should change roughtly every 1 till 6 months.
	 * This matches the regex "[0-9]+".
	 */
	extern const std::string& GetMajor();

	/**
	 * Minor version number (e.g. "5")
	 * @deprecated since 4. October 2011 (pre release 83), will always return "0"
	 * Bug-fix version part, for changes which break sync between clients.
	 * This may be a pure number (matching "[0-9]+") only on the <i>master</i>
	 * and on <i>hotfix</i> branches.
	 * It will match "[0-9]+[-]" on <i>release</i> branches and on
	 * <i>develop</i> (and <i>feature</i> branches) before a release.
	 * It will match "[0-9]+[+]" on <i>develop</i> (and <i>feature</i> branches)
	 * after a release.
	 * This matches the regex "[0-9]+[+-]?".
	 */
	extern const std::string& GetMinor();

	/**
	 * Patch-set version part (e.g. "0" or "2")
	 * Bug-fix version part, for changes which preserve sync between clients.
	 * Demos should also be compatible between patch-sets.
	 * This matches the regex "[0-9]+".
	 */
	extern const std::string& GetPatchSet();

	/**
	 * SCM Commits version part (e.g. "" or "13")
	 * Number of commits since the last version tag.
	 * This matches the regex "[0-9]*".
	 */
	extern const std::string& GetCommits();

	/**
	 * SCM unique identifier for the current commit.
	 * This matches the regex "([0-9a-f]{6})?".
	 */
	extern const std::string& GetHash();

	/**
	 * SCM branch name (e.g. "master" or "develop")
	 */
	extern const std::string& GetBranch();

	/// additional information (compiler flags, VCS revision etc.)
	extern const std::string& GetAdditional();

	/// build options
	extern const std::string& GetBuildEnvironment();

	/// compiler information
	extern const std::string& GetCompiler();

	/// Returns whether this is a release build of the engine
	extern bool IsRelease();

	/// Returns true if this build is a "HEADLESS" build
	extern bool IsHeadless();

	/// Returns true if this build is a "UNITSYNC" build
	extern bool IsUnitsync();

	/**
	 * The basic part of a spring version.
	 * This may only be used for sync-checking if IsRelease() returns true.
	 * @return "Major.PatchSet" or "Major.PatchSet.1"
	 * @see GetSync
	 */
	extern const std::string& Get();

	/**
	 * The sync relevant part of a spring version.
	 * This may be used for sync-checking through a simple string-equality test.
	 * In essence this means, that only releases with the same Major release
	 * number may be detected as syncing.
	 * @return "Major" or "Major.PatchSet.1-Commits-gHash Branch"
	 */
	extern const std::string& GetSync();

	/**
	 * The verbose, human readable version.
	 * @return "Major.Patchset[.1-Commits-gHash Branch] (Additional)"
	 * @see GetMajor
	 * @see GetPatchSet
	 * @see GetCommits
	 * @see GetHash
	 * @see GetBranch
	 * @see GetAdditional
	 */
	extern const std::string& GetFull();
}

#endif // GAME_VERSION_H