Version
Version

Class that represents, and provides helper functions for, a Version number

Functions
Version
Version(
uint32 major,
uint32 minor,
uint32 patch
)

Create a Version object from major, minor, patch.

Parameters
major
uint32

The major part of the version (ie. 1 in 1.23.97).

minor
uint32

The minor part of the version (ie. 23 in 1.23.97).

patch
uint32

The patch part of the version (ie. 97 in 1.23.97).

Version
Version(
uint32 major,
uint32 minor
)

Create a Version object from major and minor.

Parameters
major
uint32

The major part of the version (ie. 1 in 1.23.97).

minor
uint32

The minor part of the version (ie. 23 in 1.23.97).

Version
Version(
const Version &other
)

The copy constructor for a Version object.

Parameters
other
const Version&

The Version to be copied.

Variables
m_major
uint32 m_major

The major part of the Version.

m_minor
uint32 m_minor

The minor part of the Version.

m_patch
uint32 m_patch

The patch part of the Version.

Functions
str
std::string str() const

Gets a string representation of the Version.

Returns

A string representing the Version.

fromString
bool fromString(
const std::string &strVersion
)

Builds the Version object from the given string.  If successful, the Version object will be updated to the given string.

Parameters
strVersion
const std::string&

The string representation of a version (ie. "1.23")

Returns

true if the string was parsed successfully and the Version was updated, false if the string failed to parse

majorPart
uint32 majorPart() const

Gets the major part of the Version

Returns

The major part of the Version (ie. 1 in 1.23.97)

minorPart
uint32 minorPart() const

Gets the minor part of the Version

Returns

The minor part of the Version (ie. 23 in 1.23.97)

patchPart
uint32 patchPart() const

Gets the patch part of the Version

Returns

The patch part of the Version (ie. 97 in 1.23.97)

compare
int compare(
const Version &cmp
) const

Compares the current Version to the given Version parameter

Parameters
cmp
const Version&

The Version to compare to the current Version

Returns

0 if the 2 versions are equal, a negative number if the current Version is less than the parameter Version, a positive number if the current Version is greater than the parameter Version.