TurtleBrains  0.3.5
High quality, portable, C++ framework for rapid 2D game development.
TurtleBrains::Core::Version Namespace Reference

Contains functionality for retrieving and comparing the version of the TurtleBrains framework. More...

Enumerations

enum  FeatureKit {
  kUnspecified , kApplicationKit , kAudioKit , kDebugKit ,
  kGameKit , kGraphicsKit , kMathKit
}
 

Functions

int GetMajor (void)
 
int GetMinor (void)
 
int GetPatch (void)
 
const StringVersionString (void)
 
const StringProjectVersionString (void)
 
bool IsExactly (const int major, const int minor, const int patch)
 
bool IsAtLeast (const int major, const int minor, const int patch)
 
bool IsFeatureSupported (const String &featureName)
 
bool IsKitMinimallySupported (const FeatureKit &kit)
 
bool IsKitCompletelySupported (const FeatureKit &kit)
 

Detailed Description

Retrieves information regarding the version of the TurtleBrains framework added to your project to make allow testing that the implementation is newer than, or exactly as expected.

Enumeration Type Documentation

◆ FeatureKit

Describes a "feature kit" for minimal or complete testing of several features at once. Typically the feature kits are based on the namespace regions of the TurtleBrains framework or the tb_yyy_kit headers that provide everything within a kit, though that may not always be the case as these kits are just describing a collection of features.

Enumerator
kUnspecified 

This is for features that don't fit in an a kit, misc, basic features.

kApplicationKit 

Features within the tbApplication namespace, or for Application Development.

kAudioKit 

Features within the tbAudio namespace, or audio development.

kDebugKit 

Features within the tbCore::Debug namespace, or debugging helpers.

kGameKit 

Features within the tbGame namespace, or Game Development.

kGraphicsKit 

Features within the tbGraphics namespace, or graphical helpers.

kMathKit 

Features within the tbMath namespace, or math helpers.

Function Documentation

◆ GetMajor()

int TurtleBrains::Core::Version::GetMajor ( void  )

Retrieves the major part of the TurtleBrains framework version number.

Returns
If the version of the framework is: 1.3.2, the value returned will be 1.

◆ GetMinor()

int TurtleBrains::Core::Version::GetMinor ( void  )

Retrieves the minor part of the TurtleBrains framework version number.

Returns
If the version of the framework is: 1.3.2, the value returned will be 3.

◆ GetPatch()

int TurtleBrains::Core::Version::GetPatch ( void  )

Retrieves the patch part of the TurtleBrains framework version number.

Returns
If the version of the framework is: 1.3.2, the value returned will be 2.

◆ IsAtLeast()

bool TurtleBrains::Core::Version::IsAtLeast ( const int  major,
const int  minor,
const int  patch 
)

Compares the version with the inputs to be sure that the framework is equal or newer, in the event new features are added to the framework, you can use this to make sure those features are available.

Parameters
majorThe value of the major portion to be compared with the current major of the framework.
minorThe value of the minor portion to be compared with the current minor of the framework.
patchThe value of the patch to be compared with the current patch of the framework.
Returns
True will be returned if the version of the framework is equal or newer than the version created by each component supplied. 1.3.2 is newer than 1.2.4 2.1.0 is newer than 1.9.9. False will be returned if the framework is older than the version created by each supplied component.

◆ IsExactly()

bool TurtleBrains::Core::Version::IsExactly ( const int  major,
const int  minor,
const int  patch 
)

Compares the version with the inputs to be sure that the framework version matches.

Parameters
majorThe value of the major portion to be compared with the current major of the framework.
minorThe value of the minor portion to be compared with the current minor of the framework.
patchThe value of the patch to be compared with the current patch of the framework.
Returns
True will be returned if the version of the framework exactly matches each component supplied otherwise false will be returned if the framework version is newer or older than desired.

◆ IsFeatureSupported()

bool TurtleBrains::Core::Version::IsFeatureSupported ( const String featureName)

Checks to see if a specific feature is supported or not which would be used for features that either don't have a kit, or are extra features of a kit, or perhaps a feature kit is only minimally supported but a specific feature above minimal support can still be checked.

Parameters
featureNameThe name of the feature to check, there may be a table of known feature names made available, or displayed in the reference level documentation for an object/function.
Returns
True will be returned if the feature exists in the internal table and it was set to supported for the platform used.
Note
The features are added to the table during static initialization. Using IsFeatureSupported() before main() gets invoked may cause undefined results based on the order of that initialization, which is undefined.
As of TurtleBrains 0.3.0 this is not fully loaded with supported features. If a feature is claimed to have support, the public facing interface of that API is much less likely to be changed.

◆ IsKitCompletelySupported()

bool TurtleBrains::Core::Version::IsKitCompletelySupported ( const FeatureKit kit)

Checks to see if ALL the features of the specified kit, at a complete level, is supported or not. All features marked in the complete kit level must be supported for this to return true, if even a single feature required for the complete kit support is not supported, this returns false. Though it sounds like EVERY feature ever added to the kit must be supported, some features can be marked as "extra special" which does not require them to be supported for the feature kit to be considered complete.

Parameters
kitThe FeatureKit to test for complete feature support.
Returns
True will be returned if all features of the complete kit are supported on the platform used.
Note
The features are added to the table during static initialization. Using IsKitMinimallySupported() before main() gets invoked may cause undefined results based on the order of that initialization, which is undefined.
As of TurtleBrains 0.3.0 this is not fully loaded with supported features. If a feature is claimed to have support, the public facing interface of that API is much less likely to be changed.

◆ IsKitMinimallySupported()

bool TurtleBrains::Core::Version::IsKitMinimallySupported ( const FeatureKit kit)

Checks to see if ALL the features of the specified kit, at a minimal level, is supported or not. All features marked in the minimum kit level must be supported for this to return true, if even a single feature required for the minimum kit support is not supported, this returns false.

Parameters
kitThe FeatureKit to test for minimal feature support.
Returns
True will be returned if all the minimum features of the kit are supported on the platform used.
Note
The features are added to the table during static initialization. Using IsKitMinimallySupported() before main() gets invoked may cause undefined results based on the order of initialization.
As of TurtleBrains 0.3.0 this is not fully loaded with supported features. If a feature is claimed to have support, the public facing interface of that API is much less likely to be changed.

◆ ProjectVersionString()

const String& TurtleBrains::Core::Version::ProjectVersionString ( void  )

Retrieves a string with the major, minor and patch of the framework combined with the framework name in a string like: "TurtleBrains v1.0.0"

Returns
If the version of the framework is: 1.3.2, the value returned will be "TurtleBrains v1.3.2".

◆ VersionString()

const String& TurtleBrains::Core::Version::VersionString ( void  )

Retrieves a string with the major, minor and patch of the framework combined without the framework name in a string like: "1.0.0"

Returns
If the version of the framework is: 1.3.2, the value returned will be "1.3.2".