Description of an application version. More...
Public Member Functions | |
QtlVersion () | |
Default constructor. More... | |
QtlVersion (const QString &text) | |
Constructor. More... | |
QtlVersion (const QList< int > &values, int beta=-1) | |
Constructor. More... | |
int | betaIndex () const |
Get the beta release index. More... | |
void | clear () |
Invalidate the version content. More... | |
int | elementCount () const |
Get the number of integer elements in the version. More... | |
bool | isBeta () const |
Check if this is a beta release. More... | |
bool | isValid () const |
Check if the version is valid. More... | |
bool | operator!= (const QtlVersion &other) const |
Comparison operator. More... | |
bool | operator< (const QtlVersion &other) const |
Comparison operator. More... | |
bool | operator<= (const QtlVersion &other) const |
Comparison operator. More... | |
bool | operator== (const QtlVersion &other) const |
Comparison operator. More... | |
bool | operator> (const QtlVersion &other) const |
Comparison operator. More... | |
bool | operator>= (const QtlVersion &other) const |
Comparison operator. More... | |
void | setText (const QString &text) |
Set the version from a text representation. More... | |
void | setValues (const QList< int > &values, int beta=-1) |
Set the version from a list of integer values. More... | |
QString | text () const |
Get the textual representation of the version. More... | |
QList< int > | values () const |
Get the version as a list of integer values. More... | |
Private Attributes | |
int | _beta |
Beta release index, negative for release versions. More... | |
QString | _text |
Original textual representation. More... | |
QList< int > | _values |
The list of integer values. More... | |
Description of an application version.
A version is typically a list of integers. The text representation is the list of integers, separated by dots or dashes.
Examples: "1", "1.3.0", "1.2-45".
If the last field starts with letters and ends with digits, it is considered as a "beta" or "early" version, preceeding the official release.
Examples: "1.2-beta1", "4.3.7-rc2".
QtlVersion::QtlVersion | ( | ) |
Default constructor.
The version is invalid.
QtlVersion::QtlVersion | ( | const QString & | text | ) |
Constructor.
[in] | text | Text representation of the version. The version is invalid if the syntax of text is incorrect. |
QtlVersion::QtlVersion | ( | const QList< int > & | values, |
int | beta = -1 |
||
) |
Constructor.
[in] | values | List of integer values. |
[in] | beta | Beta release index. Ignored if negative (the default). The version is invalid if the list is empty or any value is negative. |
|
inline |
Get the version as a list of integer values.
|
inline |
Check if this is a beta release.
|
inline |
Get the beta release index.
void QtlVersion::setValues | ( | const QList< int > & | values, |
int | beta = -1 |
||
) |
Set the version from a list of integer values.
[in] | values | List of integer values. |
[in] | beta | Beta release index. Ignored if negative (the default). The version is invalid if the list is empty or any value is negative. |
QString QtlVersion::text | ( | ) | const |
Get the textual representation of the version.
void QtlVersion::setText | ( | const QString & | text | ) |
Set the version from a text representation.
[in] | text | Text representation of the version. The version is invalid if the syntax of text is incorrect. |
bool QtlVersion::operator== | ( | const QtlVersion & | other | ) | const |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Comparison operator.
[in] | other | Other instance to compare. |
bool QtlVersion::operator< | ( | const QtlVersion & | other | ) | const |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Comparison operator.
[in] | other | Other instance to compare. |
|
inline |
Check if the version is valid.
|
inline |
Get the number of integer elements in the version.
void QtlVersion::clear | ( | ) |
Invalidate the version content.
|
private |
The list of integer values.
|
private |
Beta release index, negative for release versions.
|
private |
Original textual representation.