version.cpp

Engine/source/app/version.cpp

More...

Public Functions

ConsoleFunctionGroupBegin(CompileInformation , "Functions <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get version information about the current executable." )
ConsoleFunctionGroupEnd(CompileInformation )
DefineEngineFunction(getAppVersionNumber , S32 , () , "Get the version of the application build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )
DefineEngineFunction(getAppVersionString , const char * , () , "Get the version of the aplication build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> human readable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )
DefineEngineFunction(getBuildString , const char * , () , "Get the type of build, \"Debug\" or \"Release\".\n\n" "@ingroup Debugging" )
DefineEngineFunction(getCompileTimeString , const char * , () , "Get the time of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">compilation.\n\n</a>" "@ingroup Debugging" )
DefineEngineFunction(getEngineName , const char * , () , "Get the name of the engine product that this is running from, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )
DefineEngineFunction(getVersionNumber , S32 , () , "Get the version of the engine build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )
DefineEngineFunction(getVersionString , const char * , () , "Get the version of the engine build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> human readable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

Gets the application version number. The version number is specified as a global in torqueConfig.h.

const char *

Gets the human readable application version string.

const char *

Gets the compile date and time.

const char *

TGE 0001 TGEA 0002 TGB 0003 TGEA 360 0004 TGE WII 0005 Torque 3D 0006 Torque 3D MIT 0007.

Gets the engine version number. The version number is specified as a global in version.cc.

const char *

Gets the engine version number in a human readable form.

Detailed Description

Public Variables

const U32 appVersionNumber 
const U32 csgVersionNumber 

Public Functions

ConsoleFunctionGroupBegin(CompileInformation , "Functions <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> get version information about the current executable." )

ConsoleFunctionGroupEnd(CompileInformation )

DefineEngineFunction(getAppVersionNumber , S32 , () , "Get the version of the application build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

DefineEngineFunction(getAppVersionString , const char * , () , "Get the version of the aplication build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> human readable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

DefineEngineFunction(getBuildString , const char * , () , "Get the type of build, \"Debug\" or \"Release\".\n\n" "@ingroup Debugging" )

DefineEngineFunction(getCompileTimeString , const char * , () , "Get the time of <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">compilation.\n\n</a>" "@ingroup Debugging" )

DefineEngineFunction(getEngineName , const char * , () , "Get the name of the engine product that this is running from, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

DefineEngineFunction(getVersionNumber , S32 , () , "Get the version of the engine build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

DefineEngineFunction(getVersionString , const char * , () , "Get the version of the engine build, as <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> human readable <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">string.\n\n</a>" " @ingroup Debugging" )

getAppVersionNumber()

Gets the application version number. The version number is specified as a global in torqueConfig.h.

getAppVersionString()

Gets the human readable application version string.

getCompileTimeString()

Gets the compile date and time.

getEngineProductString()

TGE 0001 TGEA 0002 TGB 0003 TGEA 360 0004 TGE WII 0005 Torque 3D 0006 Torque 3D MIT 0007.

Gets the engine product name in string form.

getVersionNumber()

Gets the engine version number. The version number is specified as a global in version.cc.

getVersionString()

Gets the engine version number in a human readable form.

  1
  2//-----------------------------------------------------------------------------
  3// Copyright (c) 2012 GarageGames, LLC
  4//
  5// Permission is hereby granted, free of charge, to any person obtaining a copy
  6// of this software and associated documentation files (the "Software"), to
  7// deal in the Software without restriction, including without limitation the
  8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9// sell copies of the Software, and to permit persons to whom the Software is
 10// furnished to do so, subject to the following conditions:
 11//
 12// The above copyright notice and this permission notice shall be included in
 13// all copies or substantial portions of the Software.
 14//
 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 21// IN THE SOFTWARE.
 22//-----------------------------------------------------------------------------
 23
 24#include "platform/platform.h"
 25#include "app/version.h"
 26#include "console/console.h"
 27#include "console/engineAPI.h"
 28
 29static const U32 csgVersionNumber = TORQUE_GAME_ENGINE;
 30static const U32 appVersionNumber = TORQUE_APP_VERSION;
 31
 32U32 getVersionNumber()
 33{
 34   return csgVersionNumber;
 35}
 36
 37U32 getAppVersionNumber()
 38{
 39   return appVersionNumber;
 40}
 41
 42const char* getVersionString()
 43{
 44   return TORQUE_GAME_ENGINE_VERSION_STRING;
 45}
 46
 47const char* getAppVersionString()
 48{
 49   return TORQUE_APP_VERSION_STRING;
 50}
 51
 52/// TGE       0001
 53/// TGEA      0002
 54/// TGB       0003
 55/// TGEA 360  0004
 56/// TGE  WII  0005
 57/// Torque 3D 0006
 58/// Torque 3D MIT 0007
 59
 60const char* getEngineProductString()
 61{
 62#ifndef TORQUE_ENGINE_PRODUCT
 63   return "Torque Engine";
 64#else
 65   switch (TORQUE_ENGINE_PRODUCT)
 66   {
 67      case 0001:
 68         return "Torque Game Engine";
 69      case 0002:
 70         return "Torque Game Engine Advanced";
 71      case 0003:
 72         return "Torque 2D";
 73      case 0004:
 74         return "Torque 360";
 75      case 0005:
 76         return "Torque for Wii";
 77      case 0006:
 78         return "Torque 3D";
 79      case 0007:
 80        return "Torque 3D MIT";
 81       
 82      default:
 83         return "Torque Engine";
 84   };
 85#endif
 86}
 87
 88const char* getCompileTimeString()
 89{
 90   return __DATE__ " at " __TIME__;
 91}
 92//----------------------------------------------------------------
 93
 94ConsoleFunctionGroupBegin( CompileInformation, "Functions to get version information about the current executable." );
 95
 96DefineEngineFunction( getVersionNumber, S32, (), , "Get the version of the engine build, as a string.\n\n" 
 97            "@ingroup Debugging")
 98{
 99   return getVersionNumber();
100}
101
102DefineEngineFunction( getAppVersionNumber, S32, (), , "Get the version of the application build, as a string.\n\n" 
103            "@ingroup Debugging")
104{
105   return getAppVersionNumber();
106}
107
108
109DefineEngineFunction( getVersionString, const char*, (), , "Get the version of the engine build, as a human readable string.\n\n" 
110            "@ingroup Debugging")
111{
112   return getVersionString();
113}
114
115DefineEngineFunction( getAppVersionString, const char*, (), , "Get the version of the aplication build, as a human readable string.\n\n" 
116            "@ingroup Debugging")
117{
118   return getAppVersionString();
119}
120
121DefineEngineFunction( getEngineName, const char*, (), , "Get the name of the engine product that this is running from, as a string.\n\n" 
122            "@ingroup Debugging")
123{
124   return getEngineProductString();
125}
126
127DefineEngineFunction( getCompileTimeString, const char*, (), , "Get the time of compilation.\n\n" 
128            "@ingroup Debugging")
129{
130   return getCompileTimeString();
131}
132
133DefineEngineFunction( getBuildString, const char*, (), , "Get the type of build, \"Debug\" or \"Release\".\n\n"
134            "@ingroup Debugging")
135{
136#ifdef TORQUE_DEBUG
137   return "Debug";
138#else
139   return "Release";
140#endif
141}
142
143ConsoleFunctionGroupEnd( CompileInformation );
144