QtlMovie 1.12 (A specialized FFmpeg front-end)
QtlVersion Class Reference

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...
 

Detailed Description

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".

Constructor & Destructor Documentation

◆ QtlVersion() [1/3]

QtlVersion::QtlVersion ( )

Default constructor.

The version is invalid.

◆ QtlVersion() [2/3]

QtlVersion::QtlVersion ( const QString &  text)

Constructor.

Parameters
[in]textText representation of the version. The version is invalid if the syntax of text is incorrect.

◆ QtlVersion() [3/3]

QtlVersion::QtlVersion ( const QList< int > &  values,
int  beta = -1 
)

Constructor.

Parameters
[in]valuesList of integer values.
[in]betaBeta release index. Ignored if negative (the default). The version is invalid if the list is empty or any value is negative.

Member Function Documentation

◆ values()

QList<int> QtlVersion::values ( ) const
inline

Get the version as a list of integer values.

Returns
The list of integer values (empty if the version is invalid).

◆ isBeta()

bool QtlVersion::isBeta ( ) const
inline

Check if this is a beta release.

Returns
True for beta release, false for official release.

◆ betaIndex()

int QtlVersion::betaIndex ( ) const
inline

Get the beta release index.

Returns
Beta release index, -1 for official release.

◆ setValues()

void QtlVersion::setValues ( const QList< int > &  values,
int  beta = -1 
)

Set the version from a list of integer values.

Parameters
[in]valuesList of integer values.
[in]betaBeta release index. Ignored if negative (the default). The version is invalid if the list is empty or any value is negative.

◆ text()

QString QtlVersion::text ( ) const

Get the textual representation of the version.

Returns
The textual representation of the version. If the version was built from a valid textual representation, return the same string. Otherwise, return a dotted representation.

◆ setText()

void QtlVersion::setText ( const QString &  text)

Set the version from a text representation.

Parameters
[in]textText representation of the version. The version is invalid if the syntax of text is incorrect.

◆ operator==()

bool QtlVersion::operator== ( const QtlVersion other) const

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is equal to other. False otherwise.

◆ operator!=()

bool QtlVersion::operator!= ( const QtlVersion other) const
inline

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is different from other. False otherwise.

◆ operator<()

bool QtlVersion::operator< ( const QtlVersion other) const

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is less than other. False otherwise.

◆ operator<=()

bool QtlVersion::operator<= ( const QtlVersion other) const
inline

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is less than or equal to other. False otherwise.

◆ operator>()

bool QtlVersion::operator> ( const QtlVersion other) const
inline

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is greater than other. False otherwise.

◆ operator>=()

bool QtlVersion::operator>= ( const QtlVersion other) const
inline

Comparison operator.

Parameters
[in]otherOther instance to compare.
Returns
True if this instance is greater than or equal to other. False otherwise.

◆ isValid()

bool QtlVersion::isValid ( ) const
inline

Check if the version is valid.

Returns
True if this instance is valid. False otherwise.

◆ elementCount()

int QtlVersion::elementCount ( ) const
inline

Get the number of integer elements in the version.

Returns
The number of integer elements in the version.

◆ clear()

void QtlVersion::clear ( )

Invalidate the version content.

Member Data Documentation

◆ _values

QList<int> QtlVersion::_values
private

The list of integer values.

◆ _beta

int QtlVersion::_beta
private

Beta release index, negative for release versions.

◆ _text

QString QtlVersion::_text
private

Original textual representation.


The documentation for this class was generated from the following files: