LMMS
Loading...
Searching...
No Matches
lmms::ProjectVersion Class Reference

Version number parsing and comparison. More...

#include <ProjectVersion.h>

Public Types

enum class  CompareType : int {
  None = 0 , Major =1 , Minor =2 , Release =3 ,
  Stage =4 , Build =5 , All = std::numeric_limits<int>::max()
}

Public Member Functions

 ProjectVersion (QString version, CompareType c=CompareType::All)
 ProjectVersion (const char *version, CompareType c=CompareType::All)
const QString & getVersion () const
int getMajor () const
int getMinor () const
int getPatch () const
const QStringList & getLabels () const
CompareType getCompareType () const
ProjectVersion setCompareType (CompareType compareType)

Static Public Member Functions

static int compare (const ProjectVersion &a, const ProjectVersion &b, CompareType c)
static int compare (ProjectVersion v1, ProjectVersion v2)

Private Attributes

QString m_version
int m_major = 0
int m_minor = 0
int m_patch = 0
QStringList m_labels
CompareType m_compareType

Detailed Description

Version number parsing and comparison.

Parses and compares version information. i.e. "1.0.3" < "1.0.10"

Member Enumeration Documentation

◆ CompareType

Enumerator
None 
Major 
Minor 
Release 
Stage 
Build 
All 

Constructor & Destructor Documentation

◆ ProjectVersion() [1/2]

lmms::ProjectVersion::ProjectVersion ( QString version,
CompareType c = CompareType::All )

◆ ProjectVersion() [2/2]

lmms::ProjectVersion::ProjectVersion ( const char * version,
CompareType c = CompareType::All )

Member Function Documentation

◆ compare() [1/2]

int lmms::ProjectVersion::compare ( const ProjectVersion & a,
const ProjectVersion & b,
CompareType c )
static
Parameters
cDetermines the number of identifiers to check when comparing

◆ compare() [2/2]

int lmms::ProjectVersion::compare ( ProjectVersion v1,
ProjectVersion v2 )
static

◆ getCompareType()

CompareType lmms::ProjectVersion::getCompareType ( ) const
inline

◆ getLabels()

const QStringList & lmms::ProjectVersion::getLabels ( ) const
inline

◆ getMajor()

int lmms::ProjectVersion::getMajor ( ) const
inline

◆ getMinor()

int lmms::ProjectVersion::getMinor ( ) const
inline

◆ getPatch()

int lmms::ProjectVersion::getPatch ( ) const
inline

◆ getVersion()

const QString & lmms::ProjectVersion::getVersion ( ) const
inline

◆ setCompareType()

ProjectVersion lmms::ProjectVersion::setCompareType ( CompareType compareType)
inline

Member Data Documentation

◆ m_compareType

CompareType lmms::ProjectVersion::m_compareType
private

◆ m_labels

QStringList lmms::ProjectVersion::m_labels
private

◆ m_major

int lmms::ProjectVersion::m_major = 0
private

◆ m_minor

int lmms::ProjectVersion::m_minor = 0
private

◆ m_patch

int lmms::ProjectVersion::m_patch = 0
private

◆ m_version

QString lmms::ProjectVersion::m_version
private

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