38
38
* values for different parts of the game.
39
39
* @todo: increment build number on compile, and stamp exe with username
40
40
*/
41
+ // TheSuperHackers @tweak The Version class now also provides Git information
42
+ // alongside the original Version information.
41
43
class Version
42
44
{
43
45
public:
44
46
Version ();
45
47
46
- UnsignedInt getVersionNumber ( void ) const ; // /< Return a 4-byte integer suitable for WOLAPI
47
- AsciiString getAsciiVersion ( void ) const ; // /< Return a human-readable version number
48
- UnicodeString getUnicodeVersion ( void ) const ; // /< Return a human-readable version number
49
- AsciiString getAsciiBuildTime ( void ) const ; // /< Return a formated date/time string for build time
50
- UnicodeString getUnicodeBuildTime ( void ) const ; // /< Return a formated date/time string for build time
51
- AsciiString getAsciiBuildLocation ( void ) const ; // /< Return a string with the build location
52
- UnicodeString getUnicodeBuildLocation ( void ) const ; // /< Return a string with the build location
53
- AsciiString getAsciiBuildUser ( void ) const ; // /< Return a string with the build user
54
- UnicodeString getUnicodeBuildUser ( void ) const ; // /< Return a string with the build user
55
-
56
- static Int getGitRevision ();
57
- static time_t getGitCommitTime ();
58
- AsciiString getAsciiGitRevision ( void ) const { return m_asciiGitRevision; }
59
- AsciiString getAsciiGitVersion ( void ) const { return m_asciiGitVersion; }
60
- AsciiString getAsciiGitCommitTime ( void ) const { return m_asciiGitCommitTime; }
61
- UnicodeString getUnicodeGitRevision ( void ) const { return m_unicodeGitRevision; }
62
- UnicodeString getUnicodeGitVersion ( void ) const { return m_unicodeGitVersion; }
63
- UnicodeString getUnicodeGitCommitTime ( void ) const { return m_unicodeGitCommitTime; }
64
- UnicodeString getUnicodeGameAndGitVersion ( void ) const ;
65
-
66
- Bool showFullVersion ( void ) { return m_showFullVersion; }
48
+ UnsignedInt getVersionNumber () const ; // /< Return a 4-byte integer suitable for WOLAPI
49
+
50
+ AsciiString getAsciiVersion () const ; // /< Return a human-readable version number
51
+ UnicodeString getUnicodeVersion () const ; // /< Return a human-readable version number. Is decorated with localized string
52
+
53
+ AsciiString getAsciiBuildTime () const ; // /< Return a formated date/time string for build time
54
+ UnicodeString getUnicodeBuildTime () const ; // /< Return a formated date/time string for build time. Is decorated with localized string
55
+
56
+ AsciiString getAsciiBuildLocation () const ; // /< Return a string with the build location
57
+ UnicodeString getUnicodeBuildLocation () const ; // /< Return a string with the build location. Is decorated with localized string
58
+
59
+ AsciiString getAsciiBuildUser () const ; // /< Return a string with the build user
60
+ UnicodeString getUnicodeBuildUser () const ; // /< Return a string with the build user. Is decorated with localized string
61
+
62
+ static Int getGitRevision (); // /< Returns the total git commit count as a number
63
+ static time_t getGitCommitTime (); // /< Returns the last git commit time as a UTC timestamp
64
+ static const char * getGitCommitAuthorName (); // /< Returns the last git commit author name
65
+
66
+ AsciiString getAsciiGitRevision () const ; // /< Returns the total git commit count. Is prefixed with ~ if there were uncommitted changes.
67
+ UnicodeString getUnicodeGitRevision () const ; // /< Returns the total git commit count. Is prefixed with ~ if there were uncommitted changes.
68
+
69
+ AsciiString getAsciiGitVersion () const ; // /< Returns the last git commit tag or hash. Is prefixed with ~ if there were uncommitted changes.
70
+ UnicodeString getUnicodeGitVersion () const ; // /< Returns the last git commit tag or hash. Is prefixed with ~ if there were uncommitted changes.
71
+
72
+ AsciiString getAsciiGitCommitTime () const ; // /< Returns the last git commit time in YYYY-mm-dd HH:MM:SS format
73
+ UnicodeString getUnicodeGitCommitTime () const ; // /< Returns the last git commit time in YYYY-mm-dd HH:MM:SS format
74
+
75
+ AsciiString getAsciiGameAndGitVersion () const ; // /< Returns the game and git version
76
+ UnicodeString getUnicodeGameAndGitVersion () const ; // /< Returns the game and git version. Is decorated with localized string
77
+
78
+ AsciiString getAsciiBuildUserOrGitCommitAuthorName () const ;
79
+ UnicodeString getUnicodeBuildUserOrGitCommitAuthorName () const ; // /< Is decorated with localized string
80
+
81
+ Bool showFullVersion () const { return m_showFullVersion; }
67
82
void setShowFullVersion ( Bool val ) { m_showFullVersion = val; }
68
83
69
84
void setVersion (Int major, Int minor, Int buildNum,
70
85
Int localBuildNum, AsciiString user, AsciiString location,
71
- AsciiString buildTime, AsciiString buildDate); // /< Set version info
86
+ AsciiString buildTime, AsciiString buildDate);
72
87
73
88
private:
74
89
static AsciiString buildAsciiGitRevision ();
75
- static AsciiString buildAsciiGitVersion ();
76
- static AsciiString buildAsciiGitCommitTime ();
77
90
static UnicodeString buildUnicodeGitRevision ();
91
+
92
+ static AsciiString buildAsciiGitVersion ();
78
93
static UnicodeString buildUnicodeGitVersion ();
94
+
95
+ static AsciiString buildAsciiGitCommitTime ();
79
96
static UnicodeString buildUnicodeGitCommitTime ();
80
97
81
98
private:
@@ -96,6 +113,6 @@ class Version
96
113
Bool m_showFullVersion;
97
114
};
98
115
99
- extern Version *TheVersion; // /< The Version singleton
116
+ extern Version *TheVersion;
100
117
101
118
#endif // __VERSION_H__
0 commit comments