Medical Imaging Interaction Toolkit
2016.11.0
Medical Imaging Interaction Toolkit
|
#include <usModuleVersion.h>
Public Member Functions | |
ModuleVersion (unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion) | |
ModuleVersion (unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion, const std::string &qualifier) | |
ModuleVersion (const std::string &version) | |
ModuleVersion (const ModuleVersion &version) | |
bool | IsUndefined () const |
unsigned int | GetMajor () const |
unsigned int | GetMinor () const |
unsigned int | GetMicro () const |
std::string | GetQualifier () const |
std::string | ToString () const |
bool | operator== (const ModuleVersion &object) const |
int | Compare (const ModuleVersion &object) const |
Static Public Member Functions | |
static ModuleVersion | EmptyVersion () |
static ModuleVersion | UndefinedVersion () |
static ModuleVersion | ParseVersion (const std::string &version) |
Version identifier for CppMicroServices modules.
Version identifiers have four components.
ModuleVersion(const std::string&)
for the format of the qualifier string. ModuleVersion
objects are immutable.
Definition at line 54 of file usModuleVersion.h.
us::ModuleVersion::ModuleVersion | ( | unsigned int | majorVersion, |
unsigned int | minorVersion, | ||
unsigned int | microVersion | ||
) |
Creates a version identifier from the specified numerical components.
The qualifier is set to the empty string.
majorVersion | Major component of the version identifier. |
minorVersion | Minor component of the version identifier. |
microVersion | Micro component of the version identifier. |
Definition at line 75 of file usModuleVersion.cpp.
us::ModuleVersion::ModuleVersion | ( | unsigned int | majorVersion, |
unsigned int | minorVersion, | ||
unsigned int | microVersion, | ||
const std::string & | qualifier | ||
) |
Creates a version identifier from the specified components.
majorVersion | Major component of the version identifier. |
minorVersion | Minor component of the version identifier. |
microVersion | Micro component of the version identifier. |
qualifier | Qualifier component of the version identifier. |
Definition at line 82 of file usModuleVersion.cpp.
us::ModuleVersion::ModuleVersion | ( | const std::string & | version | ) |
Created a version identifier from the specified string.
Here is the grammar for version strings.
version ::= majorVersion('.'minorVersion('.'microVersion('.'qualifier)?)?)? majorVersion ::= digit+ minorVersion ::= digit+ microVersion ::= digit+ qualifier ::= (alpha|digit|'_'|'-')+ digit ::= [0..9] alpha ::= [a..zA..Z]
There must be no whitespace in version.
version | string representation of the version identifier. |
Definition at line 89 of file usModuleVersion.cpp.
References min().
us::ModuleVersion::ModuleVersion | ( | const ModuleVersion & | version | ) |
Create a version identifier from another.
version | Another version identifier |
Definition at line 145 of file usModuleVersion.cpp.
int us::ModuleVersion::Compare | ( | const ModuleVersion & | object | ) | const |
Compares this ModuleVersion
object to another object.
A version is considered to be less than another version if its majorVersion component is less than the other version's majorVersion component, or the majorVersion components are equal and its minorVersion component is less than the other version's minorVersion component, or the majorVersion and minorVersion components are equal and its microVersion component is less than the other version's microVersion component, or the majorVersion, minorVersion and microVersion components are equal and it's qualifier component is less than the other version's qualifier component (using std::string::operator<()
).
A version is considered to be equal to another version if the majorVersion, minorVersion and microVersion components are equal and the qualifier component is equal.
object | The ModuleVersion object to be compared. |
ModuleVersion
object. Definition at line 228 of file usModuleVersion.cpp.
|
static |
The empty version "0.0.0".
Definition at line 39 of file usModuleVersion.cpp.
Referenced by ParseVersion().
unsigned int us::ModuleVersion::GetMajor | ( | ) | const |
Returns the majorVersion component of this version identifier.
Definition at line 176 of file usModuleVersion.cpp.
unsigned int us::ModuleVersion::GetMicro | ( | ) | const |
Returns the microVersion component of this version identifier.
Definition at line 188 of file usModuleVersion.cpp.
unsigned int us::ModuleVersion::GetMinor | ( | ) | const |
Returns the minorVersion component of this version identifier.
Definition at line 182 of file usModuleVersion.cpp.
std::string us::ModuleVersion::GetQualifier | ( | ) | const |
Returns the qualifier component of this version identifier.
Definition at line 194 of file usModuleVersion.cpp.
bool us::ModuleVersion::IsUndefined | ( | ) | const |
Returns the undefined state of this version identifier.
true
if this version identifier is undefined, false
otherwise. Definition at line 171 of file usModuleVersion.cpp.
bool us::ModuleVersion::operator== | ( | const ModuleVersion & | object | ) | const |
Compares this ModuleVersion
object to another object.
A version is considered to be equal to another version if the majorVersion, minorVersion and microVersion components are equal and the qualifier component is equal.
object | The ModuleVersion object to be compared. |
true
if object
is a ModuleVersion
and is equal to this object; false
otherwise. Definition at line 213 of file usModuleVersion.cpp.
|
static |
Parses a version identifier from the specified string.
See ModuleVersion(const std::string&)
for the format of the version string.
version | string representation of the version identifier. Leading and trailing whitespace will be ignored. |
ModuleVersion
object representing the version identifier. If version
is the empty string then EmptyVersion
will be returned. Definition at line 153 of file usModuleVersion.cpp.
References EmptyVersion().
std::string us::ModuleVersion::ToString | ( | ) | const |
Returns the string representation of this version identifier.
The format of the version string will be majorVersion.minorVersion.microVersion
if qualifier is the empty string or majorVersion.minorVersion.microVersion.qualifier
otherwise.
Definition at line 200 of file usModuleVersion.cpp.
Referenced by QmitkModuleTableModel::data().
|
static |
Creates an undefined version identifier, representing either infinity or minus infinity.
Definition at line 45 of file usModuleVersion.cpp.