Class to retrieve version information about the application or shared library. More...
#include <UTVersionInfo.h>
Public Member Functions | |
VersionInfo_t () | |
void | Init (stringliteral *library_name=NULL) |
uint8 | MajorVersion () const |
uint8 | MinorVersion () const |
uint8 | SubminorVersion () const |
uint8 | SubSubminorVersion () const |
bool | IsAlphaVersion () const |
bool | IsBetaVersion () const |
bool | IsReleaseCandidate () const |
bool | HasBuildNumber () const |
uint16 | BuildNumber () const |
void | GetVersionString (String_t *version_string) const |
Class to retrieve version information about the application or shared library. Version numbers consist of a major, minor, subminor, and sub-subminor version number. The version can optionally be flagged as an alpha, beta, or release candidate version. There is no provision for an A1, A2, B1, B2, RC1, RC2, etc system since the version info provides a significant amount of precision, and the use of such a system invariably progresses from alpha to beta to RC, but the problem is that if another alpha version is needed after a beta or release candidate, how should it be numbered? Instead, the system implemented here implies that with each new version, the SubSubminor version should be incremented, and the build can optionally be flagged as being an alpha, beta, or RC version without applying an integer directly to to that flag in the sense of A1, A2, etc. Each version number progresses from 0-9 before being rolled back to zero and incrementing the next most significant version number. If more precision is needed, a build number can be included. When the build number is used, the build number should be incremented with each version until the subminor version is incremented, and the alpha, beta, and RC flags can be on or off for any build number, provided that the build number continues to be incremented. An example version progression is:
0.0.0.0 (internal release) 0.0.0.1 (internal release) 0.0.1.0 (internal release) 0.0.1.1 (internal release) 0.1.0.0 (internal release) 0.1.0.1 (internal release) 0.1.1.0 (internal release) 0.1.1.1 (internal release) 0.9.0.0 (internal release) 0.9.1.0 (internal release) 1.0.0.0a build 1 1.0.0.0a build 2 1.0.0.0b build 1 1.0.0.0b build 2 1.0.0.0rc build 1 1.0.0.0rc build 2 1.0.0.0 (full public release) 1.0.0.1 (internal release) 1.0.0.2 (internal release) 1.0.1.0 (internal release) 1.0.1.1 (internal release) 1.1.0.0a build 1 1.1.0.0a build 2 1.1.0.0b build 1 1.1.0.1a build 1 (1.1.0.0b build 1 was deemed unsuitable for progression to rc status) 1.1.0.1a build 2 1.1.0.1rc build 1 1.1.0.1rc build 2 1.1.0.1 (full public release) 1.2.0.0 (internal release) 1.2.0.1 (internal release) 1.2.0.2 (internal release) 1.2.1.0 (internal release) 1.2.1.1 (internal release) 2.0.0.0a build 1 2.0.0.0a build 2 2.0.0.0b build 1 2.0.0.0rc build 1 2.0.0.0rc build 2 2.0.0.0 (full public release)
On Windows systems:
- The version information is in a VS_VERSION_INFO resource.
- The version numbering is in the PRODUCTVERSION field, and mirrored in the FILEVERSION field
- The SpecialBuild field can be "alpha" "beta" "RC" or any of those followed by " build #" for example "alpha build 12" or "RC build 23", or "build #" by itself. The # should be a decimal integer from 1 to 65535.
On Linux systems, version information is retrieved through the resources support system. Because of Linux's nonexistant support for resource sections in an executable, resources are simply normal code (.text) section data. See UTResources_t for more information.
Definition at line 63 of file UTVersionInfo.h.
VersionInfo_t::VersionInfo_t | ( | ) | [inline] |
Constructor for an empty version info object.
Definition at line 212 of file UTVersionInfo.h.
void VersionInfo_t::Init | ( | stringliteral * | library_name = NULL |
) |
If library_name is NULL, loads the version information for the application. If library_name is not NULL, loads the version information for a library of the specified name. The ".dll" or ".so" extension should not be included. If version info is not present, an assertion failure will occur, even if release builds, unless must_be_present is false, in which case false will be returned. Because version information depends on resources, which are not guarenteed to be available before main is called or after main has returned, attempts to obtain it at those times will result in an assertion failure.
uint8 VersionInfo_t::MajorVersion | ( | ) | const [inline] |
Returns the major version number e.g. 1 in 1.2.3.4, 1.2.4 or 1.3
Definition at line 219 of file UTVersionInfo.h.
uint8 VersionInfo_t::MinorVersion | ( | ) | const [inline] |
Returns the minor version number e.g. 2 in 1.2.3.4, 0.2.1 or 3.2
Definition at line 227 of file UTVersionInfo.h.
uint8 VersionInfo_t::SubminorVersion | ( | ) | const [inline] |
Returns the subminor version number e.g. 3 in 1.2.3.4 or 2.0.3
Definition at line 235 of file UTVersionInfo.h.
uint8 VersionInfo_t::SubSubminorVersion | ( | ) | const [inline] |
Returns the sub-subminor version number e.g. 4 in 1.2.3.4
Definition at line 243 of file UTVersionInfo.h.
bool VersionInfo_t::IsAlphaVersion | ( | ) | const [inline] |
Returns whether or not the version info indicates that this is an alpha version
Definition at line 251 of file UTVersionInfo.h.
bool VersionInfo_t::IsBetaVersion | ( | ) | const [inline] |
Returns whether or not the version info indicates that this is a beta version
Definition at line 259 of file UTVersionInfo.h.
bool VersionInfo_t::IsReleaseCandidate | ( | ) | const [inline] |
Returns whether or not the version info indicates that this is a release candidate version.
Definition at line 267 of file UTVersionInfo.h.
bool VersionInfo_t::HasBuildNumber | ( | ) | const [inline] |
Returns whether or not the version info includes a build number.
Definition at line 275 of file UTVersionInfo.h.
uint16 VersionInfo_t::BuildNumber | ( | ) | const [inline] |
Returns the build number, which must exist.
Definition at line 283 of file UTVersionInfo.h.
void VersionInfo_t::GetVersionString | ( | String_t * | version_string | ) | const |
Returns the version string.