PWToolBox::VersionInformation Class Reference

This can be used so libraries or plugins and describe their version information in a uniform way. More...

#include <VersionInformation.h>

List of all members.

Public Types

typedef boost::uintmax_t VersionNumber

Public Member Functions

 VersionInformation (VersionNumber const majorVersion, VersionNumber const minorVersion, VersionNumber const maintenanceVersion, std::string const buildType="")
 VersionInformation (VersionNumber const majorVersion, VersionNumber const minorVersion, VersionNumber const maintenanceVersion, VersionNumber const revisionVersion, std::string const buildType="")
VersionNumber const getMajorVersion () const
VersionNumber const getMinorVersion () const
VersionNumber const getMaintenanceVersion () const
VersionNumber const getRevisionNumber () const
std::string const & getBuildType () const
void setMajorVersion (VersionNumber const versionNumber)
 Sets the major version number.
void setMinorVersion (VersionNumber const versionNumber)
 Sets the minor version number.
void setMaintenanceVersion (VersionNumber const versionNumber)
 Sets the maintenance version number.
void setRevisionNumber (VersionNumber const versionNumber)
 Sets the revision number.
void setBuildType (std::string const &buildType)
 Sets the build type.
bool const operator== (VersionInformation const &other) const
 Tests if two versions are equal by checking each version number and the build type.
bool const operator!= (VersionInformation const &other) const
 Tests if two versions are not equal by checking each version number and the build type.
bool const operator< (VersionInformation const &other) const
 Tests if a version is less than another version.
bool const operator<= (VersionInformation const &other) const
 Tests if a version is less than or equal to another version.
bool const operator> (VersionInformation const &other) const
 Tests if a version is greater than another version.
bool const operator>= (VersionInformation const &other) const
 Tests if a version is greater than or equal to another version.
VersionInformationoperator= (VersionInformation const &other)
 Copies over all version information from other such that the two object will be equal when compared.
std::string const getVersionString (bool const useRevisionNumber=false) const

Static Public Attributes

static std::string const BT_ALPHA
 Default build type string for alpha builds. Defaults to "alpha".
static std::string const BT_BETA
 Default build type string for beta builds. Defaults to "beta".
static std::string const BT_RELEASE_CANDIDATE
 Default build type string for release candidate builds. Defaults to "rc".
static std::string const BT_RELEASE
 Default build type string for final builds. Defaults to "".


Detailed Description

This can be used so libraries or plugins and describe their version information in a uniform way.

VersionInformation object can be compared using the standard comparison operators.

When checked for equality, all four of the version numbers and the build type must match to be considered equal.

A VersionInformation object is considered less than another VersionInformation object if any of the following conditions are true.

Note that the build type is not compared in the list above. This is because only the user of the class knows how to compare build types, since they can be customized.


Member Typedef Documentation

typedef boost::uintmax_t PWToolBox::VersionInformation::VersionNumber


Constructor & Destructor Documentation

PWToolBox::VersionInformation::VersionInformation ( VersionNumber const  majorVersion,
VersionNumber const  minorVersion,
VersionNumber const  maintenanceVersion,
std::string const  buildType = "" 
) [inline]

This version of the constructor sets the revision version to 0.

Parameters:
majorVersion The major version number
minorVersion The minor version number
maintenanceVersion The maintenance version number
buildType The build type - the additional version number should be specified as part of this parameter

PWToolBox::VersionInformation::VersionInformation ( VersionNumber const  majorVersion,
VersionNumber const  minorVersion,
VersionNumber const  maintenanceVersion,
VersionNumber const  revisionVersion,
std::string const  buildType = "" 
) [inline]

Parameters:
majorVersion The major version number
minorVersion The minor version number
maintenanceVersion The maintenance version number
revisionVersion The revision version number
buildType The build type - the additional version number should be specified as part of this parameter


Member Function Documentation

VersionNumber const PWToolBox::VersionInformation::getMajorVersion (  )  const [inline]

Returns:
Returns the major version number

VersionNumber const PWToolBox::VersionInformation::getMinorVersion (  )  const [inline]

Returns:
Returns the minor version number

VersionNumber const PWToolBox::VersionInformation::getMaintenanceVersion (  )  const [inline]

Returns:
Returns the maintenance version number

VersionNumber const PWToolBox::VersionInformation::getRevisionNumber (  )  const [inline]

Returns:
Returns the revision number

std::string const& PWToolBox::VersionInformation::getBuildType (  )  const [inline]

Returns:
Returns the build type

void PWToolBox::VersionInformation::setMajorVersion ( VersionNumber const  versionNumber  )  [inline]

Sets the major version number.

Parameters:
versionNumber The major version number

void PWToolBox::VersionInformation::setMinorVersion ( VersionNumber const  versionNumber  )  [inline]

Sets the minor version number.

Parameters:
versionNumber The minor version number

void PWToolBox::VersionInformation::setMaintenanceVersion ( VersionNumber const  versionNumber  )  [inline]

Sets the maintenance version number.

Parameters:
versionNumber The maintenance version number

void PWToolBox::VersionInformation::setRevisionNumber ( VersionNumber const  versionNumber  )  [inline]

Sets the revision number.

Parameters:
versionNumber The revision version number

void PWToolBox::VersionInformation::setBuildType ( std::string const &  buildType  )  [inline]

Sets the build type.

Parameters:
buildType A string containing additional information about the build type, such as "alpha", "beta", "rc", or "".

bool const PWToolBox::VersionInformation::operator== ( VersionInformation const &  other  )  const [inline]

Tests if two versions are equal by checking each version number and the build type.

Parameters:
other The version to check for equality with.
Returns:
Returns true if this is equal to other

bool const PWToolBox::VersionInformation::operator!= ( VersionInformation const &  other  )  const [inline]

Tests if two versions are not equal by checking each version number and the build type.

Parameters:
other The version to check for non-equality with.
Returns:
Returns true if this is not equal to other

bool const PWToolBox::VersionInformation::operator< ( VersionInformation const &  other  )  const [inline]

Tests if a version is less than another version.

Parameters:
other The version to check for less-than with.
Returns:
Returns true if this is less than other

bool const PWToolBox::VersionInformation::operator<= ( VersionInformation const &  other  )  const [inline]

Tests if a version is less than or equal to another version.

Parameters:
other The version to check for <= with.
Returns:
Returns true if this is less than other

bool const PWToolBox::VersionInformation::operator> ( VersionInformation const &  other  )  const [inline]

Tests if a version is greater than another version.

Parameters:
other The version to check for greater-than with.
Returns:
Returns true if this is greater than other

bool const PWToolBox::VersionInformation::operator>= ( VersionInformation const &  other  )  const [inline]

Tests if a version is greater than or equal to another version.

Parameters:
other The version to check for >= with.
Returns:
Returns true if this is greater than or equal to other

VersionInformation& PWToolBox::VersionInformation::operator= ( VersionInformation const &  other  )  [inline]

Copies over all version information from other such that the two object will be equal when compared.

Parameters:
other The VersionInformation to copy
Returns:
A reference to this

std::string const PWToolBox::VersionInformation::getVersionString ( bool const  useRevisionNumber = false  )  const

Parameters:
useRevisionNumber If true, the revision version will be included in the string.
Returns:
Returns a string representation of the version


Member Data Documentation

std::string const PWToolBox::VersionInformation::BT_ALPHA [static]

Default build type string for alpha builds. Defaults to "alpha".

std::string const PWToolBox::VersionInformation::BT_BETA [static]

Default build type string for beta builds. Defaults to "beta".

std::string const PWToolBox::VersionInformation::BT_RELEASE_CANDIDATE [static]

Default build type string for release candidate builds. Defaults to "rc".

std::string const PWToolBox::VersionInformation::BT_RELEASE [static]

Default build type string for final builds. Defaults to "".


The documentation for this class was generated from the following file:
Generated on Sun Jul 13 14:18:26 2008 for PWToolBox by  doxygen 1.5.1