Qx v0.5.8
Qt Extensions Library
|
The VersionNumber class extends QVersionNumber to include a dedicated constructor and getter for the fourth version segment. More...
#include <qx/core/qx-versionnumber.h>
Public Member Functions | |
VersionNumber () | |
VersionNumber (const QList< int > &seg) | |
VersionNumber (int maj) | |
VersionNumber (int maj, int min) | |
VersionNumber (int maj, int min, int mic) | |
VersionNumber (int maj, int min, int mic, int nan) | |
VersionNumber (QList< int > &&seg) | |
VersionNumber (std::initializer_list< int > args) | |
VersionNumber | first (qsizetype n) const |
int | nanoVersion () const |
VersionNumber | normalized (qsizetype min=0) const |
Public Member Functions inherited from QVersionNumber | |
QVersionNumber (const QList< int > &seg) | |
QVersionNumber (const QVarLengthArray< int, N > &seg) | |
QVersionNumber (int maj) | |
QVersionNumber (int maj, int min) | |
QVersionNumber (int maj, int min, int mic) | |
QVersionNumber (QList< int > &&seg) | |
QVersionNumber (std::initializer_list< int > args) | |
bool | isNormalized () const const |
bool | isNull () const const |
bool | isPrefixOf (const QVersionNumber &other) const const |
int | majorVersion () const const |
int | microVersion () const const |
int | minorVersion () const const |
QVersionNumber | normalized () const const |
bool | operator!= (const QVersionNumber &lhs, const QVersionNumber &rhs) |
bool | operator< (const QVersionNumber &lhs, const QVersionNumber &rhs) |
QDataStream & | operator<< (QDataStream &out, const QVersionNumber &version) |
bool | operator<= (const QVersionNumber &lhs, const QVersionNumber &rhs) |
bool | operator== (const QVersionNumber &lhs, const QVersionNumber &rhs) |
bool | operator> (const QVersionNumber &lhs, const QVersionNumber &rhs) |
bool | operator>= (const QVersionNumber &lhs, const QVersionNumber &rhs) |
QDataStream & | operator>> (QDataStream &in, QVersionNumber &version) |
int | segmentAt (qsizetype index) const const |
qsizetype | segmentCount () const const |
QList< int > | segments () const const |
QString | toString () const const |
Static Public Member Functions | |
static VersionNumber | commonPrefix (const VersionNumber &v1, const VersionNumber &v2) |
static VersionNumber | fromString (const QString &string, int *suffixIndex=nullptr) |
static VersionNumber | fromString (QLatin1String string, int *suffixIndex=nullptr) |
static VersionNumber | fromString (QStringView string, int *suffixIndex=nullptr) |
Static Public Member Functions inherited from QVersionNumber | |
QVersionNumber | commonPrefix (const QVersionNumber &v1, const QVersionNumber &v2) |
int | compare (const QVersionNumber &v1, const QVersionNumber &v2) |
QVersionNumber | fromString (QAnyStringView string, qsizetype *suffixIndex) |
While there are many terms used to describe each segment in a typical four part version number, the fourth segment in this class is dubbed "Nano Version" to stay consistent with the naming scheme of QVersionNumber.
Qx::VersionNumber::VersionNumber | ( | int | maj, |
int | min, | ||
int | mic, | ||
int | nan ) |
Constructs a VersionNumber consisting of the major, minor, micro, and nano version numbers maj, min, mic, and nan, respectively.
Qx::VersionNumber::VersionNumber | ( | int | maj, |
int | min, | ||
int | mic ) |
Constructs a VersionNumber consisting of the major, minor and micro version numbers maj, min and mic, respectively.
Qx::VersionNumber::VersionNumber | ( | int | maj, |
int | min ) |
Constructs a VersionNumber consisting of the major and minor version numbers maj and min, respectively.
Qx::VersionNumber::VersionNumber | ( | int | maj | ) |
Constructs a VersionNumber consisting of just the major version number maj.
Qx::VersionNumber::VersionNumber | ( | std::initializer_list< int > | args | ) |
Construct a version number from the std::initializer_list specified by args.
Qx::VersionNumber::VersionNumber | ( | QList< int > && | seg | ) |
Move-constructs a version number from the list of numbers contained in seg.
Qx::VersionNumber::VersionNumber | ( | const QList< int > & | seg | ) |
Construct a version number from the std::initializer_list specified by args.
Qx::VersionNumber::VersionNumber | ( | ) |
Produces a null version.
|
static |
Returns a version number that is a parent version of both v1 and v2.
VersionNumber Qx::VersionNumber::first | ( | qsizetype | n | ) | const |
Returns a version number that contains the first n segments of this version number, or all segments if there are less than n available.
|
static |
Constructs a VersionNumber from a specially formatted string of non-negative decimal delimited by a period (.)
.
Once the numerical segments have been parsed, the remainder of the string is considered to be the suffix string. The start index of that string will be stored in suffixIndex if it is not null.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
static |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
int Qx::VersionNumber::nanoVersion | ( | ) | const |
Returns the nano version number, that is, the fourth segment. This function is equivalent to segmentAt(3). If this VersionNumber object is null, this function returns 0.
VersionNumber Qx::VersionNumber::normalized | ( | qsizetype | min = 0 | ) | const |
Returns an equivalent version number but with all trailing zeros removed.
If min is greater than 0, at least that many segments, up to segmentCount(), are kept in the resultant version number, even if some of them are trailing zeros.