VersionNumber represents a single version number. More...
#include <VersionInformation.h>
Public Member Functions | |
int | fieldWidthMinor () const |
Gets the minor version's field width. | |
int | fieldWidthRevision () const |
Gets the revision version's field width. | |
virtual void | fromString (const QString &version, const QString &seperator=".") |
Gets the version information from a string represenation, thus the major, minor and revision parts of the version. | |
bool | isVersionMinorUsed () const |
Gets if the minor version is part of the version. | |
bool | isVersionRevisionUsed () const |
Gets if the minor version is part of the version. | |
bool | operator!= (const VersionNumber &ref) const |
Operator overload to compare two VersionNumber objects are not equal. | |
bool | operator< (const VersionNumber &ref) |
Operator overload to check if one VersionNumber to smaller than another VersionNumber. | |
bool | operator<= (const VersionNumber &ref) |
Operator overload to check if one VersionNumber to smaller than or equal to another VersionNumber. | |
VersionNumber & | operator= (const VersionNumber &ref) |
Operator overload to assign one VersionNumber to another VersionNumber. | |
bool | operator== (const VersionNumber &ref) const |
Operator overload to compare two VersionNumber objects with each other. | |
bool | operator> (const VersionNumber &ref) |
Operator overload to check if one VersionNumber to bigger than another VersionNumber. | |
bool | operator>= (const VersionNumber &ref) |
Operator overload to check if one VersionNumber to bigger than or equal to another VersionNumber. | |
void | setFieldWidthMinor (int field_width) |
Sets the minor version's field width. | |
void | setFieldWidthRevision (int field_width) |
Sets the revision version's field width. | |
void | setIsVersionMinorUsed (bool is_used) |
Sets if the minor version is part of the version. | |
void | setIsVersionRevisionUsed (bool is_used) |
Sets if the minor version is part of the version. | |
void | setVersionMajor (int version) |
Sets the major version. | |
void | setVersionMinor (int version) |
Sets the minor version. | |
void | setVersionRevision (int version) |
Sets the revision version. | |
virtual QString | toString (const QString &seperator=".") const |
Returns a string represenation of the complete VersionNumber, thus the major, minor and revision parts of the version. | |
int | versionMajor () const |
Gets the major version. | |
int | versionMinor () const |
Gets the minor version. | |
int | versionRevision () const |
Gets the revision version. |
VersionNumber represents a single version number.
The VersionNumber class represents a version on three levels:
For example, to construct a version number for v1.0.3 you would do something like this:
For Minor and Revision numbers you can specify the fieldWidth using setFieldWidthMinor() and setFieldWidthRevision() respectively.
VersionNumber provides a range of functions to compare version numbers with each other. For example:
This class was added in Qtilities v1.0.
int Qtilities::Core::VersionNumber::fieldWidthMinor | ( | ) | const |
Gets the minor version's field width.
By default this is not defined and not taken into account in string representations of this version number.
|
virtual |
Gets the version information from a string represenation, thus the major, minor and revision parts of the version.
version | The version string. |
seperator | By default this is a point, thus ".". In some cases it is desirable to use a custom field seperator. For example as an underscore "_" can be desirable when the version information must be appended to a file name. |
This function keeps the used parts of the version, thus it does not change that.
void Qtilities::Core::VersionNumber::setFieldWidthRevision | ( | int | field_width | ) |
Sets the revision version's field width.
By default this is not defined and not taken into account in string representations of this version number.
|
virtual |
Returns a string represenation of the complete VersionNumber, thus the major, minor and revision parts of the version.
seperator | By default this is a point, thus ".". In some cases it is desirable to use a custom field seperator. For example as an underscore "_" can be desirable when the version information must be appended to a file name. |
Qtilities : Reference Documentation | Back to top |
Copyright © 2009-2013, Jaco Naudé
|