Version identifier for CppMicroServices modules.
More...
#include <usModuleVersion.h>
|
| | ModuleVersion (unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion) |
| | Creates a version identifier from the specified numerical components. More...
|
| |
| | ModuleVersion (unsigned int majorVersion, unsigned int minorVersion, unsigned int microVersion, const std::string &qualifier) |
| | Creates a version identifier from the specified components. More...
|
| |
| | ModuleVersion (const std::string &version) |
| | Created a version identifier from the specified string. More...
|
| |
| | ModuleVersion (const ModuleVersion &version) |
| | Create a version identifier from another. More...
|
| |
| bool | IsUndefined () const |
| | Returns the undefined state of this version identifier. More...
|
| |
| unsigned int | GetMajor () const |
| | Returns the majorVersion component of this version identifier. More...
|
| |
| unsigned int | GetMinor () const |
| | Returns the minorVersion component of this version identifier. More...
|
| |
| unsigned int | GetMicro () const |
| | Returns the microVersion component of this version identifier. More...
|
| |
| std::string | GetQualifier () const |
| | Returns the qualifier component of this version identifier. More...
|
| |
| std::string | ToString () const |
| | Returns the string representation of this version identifier. More...
|
| |
| bool | operator== (const ModuleVersion &object) const |
| | Compares this ModuleVersion object to another object. More...
|
| |
| int | Compare (const ModuleVersion &object) const |
| | Compares this ModuleVersion object to another object. More...
|
| |
Version identifier for CppMicroServices modules.
Version identifiers have four components.
-
Major version. A non-negative integer.
-
Minor version. A non-negative integer.
-
Micro version. A non-negative integer.
-
Qualifier. A text string. See
ModuleVersion(const std::string&) for the format of the qualifier string.
ModuleVersion objects are immutable.
Definition at line 41 of file usModuleVersion.h.
◆ ModuleVersion() [1/4]
| 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.
- Parameters
-
| [in] | majorVersion | Major component of the version identifier. |
| [in] | minorVersion | Minor component of the version identifier. |
| [in] | microVersion | Micro component of the version identifier. |
◆ ModuleVersion() [2/4]
| us::ModuleVersion::ModuleVersion |
( |
unsigned int |
majorVersion, |
|
|
unsigned int |
minorVersion, |
|
|
unsigned int |
microVersion, |
|
|
const std::string & |
qualifier |
|
) |
| |
Creates a version identifier from the specified components.
- Parameters
-
| [in] | majorVersion | Major component of the version identifier. |
| [in] | minorVersion | Minor component of the version identifier. |
| [in] | microVersion | Micro component of the version identifier. |
| [in] | qualifier | Qualifier component of the version identifier. |
◆ ModuleVersion() [3/4]
| 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.
- Parameters
-
| [in] | version | string representation of the version identifier. |
- Exceptions
-
| std::invalid_argument | If version is not a valid version string. |
◆ ModuleVersion() [4/4]
| us::ModuleVersion::ModuleVersion |
( |
const ModuleVersion & |
version | ) |
|
Create a version identifier from another.
- Parameters
-
| [in] | version | Another version identifier |
◆ Compare()
| 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.
- Parameters
-
- Returns
- A negative integer, zero, or a positive integer if this object is less than, equal to, or greater than the specified
ModuleVersion object.
- Exceptions
-
| std::logic_error | If either version is undefined. |
◆ EmptyVersion()
The empty version "0.0.0".
◆ GetMajor()
| unsigned int us::ModuleVersion::GetMajor |
( |
| ) |
const |
Returns the majorVersion component of this version identifier.
- Returns
- The majorVersion component.
- Exceptions
-
| std::logic_error | If this version is undefined. |
◆ GetMicro()
| unsigned int us::ModuleVersion::GetMicro |
( |
| ) |
const |
Returns the microVersion component of this version identifier.
- Returns
- The microVersion component.
- Exceptions
-
| std::logic_error | If this version is undefined. |
◆ GetMinor()
| unsigned int us::ModuleVersion::GetMinor |
( |
| ) |
const |
Returns the minorVersion component of this version identifier.
- Returns
- The minorVersion component.
- Exceptions
-
| std::logic_error | If this version is undefined. |
◆ GetQualifier()
| std::string us::ModuleVersion::GetQualifier |
( |
| ) |
const |
Returns the qualifier component of this version identifier.
- Returns
- The qualifier component.
- Exceptions
-
| std::logic_error | If this version is undefined. |
◆ IsUndefined()
| bool us::ModuleVersion::IsUndefined |
( |
| ) |
const |
Returns the undefined state of this version identifier.
- Returns
true if this version identifier is undefined, false otherwise.
◆ operator==()
| 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.
- Parameters
-
- Returns
true if object is a ModuleVersion and is equal to this object; false otherwise.
◆ ParseVersion()
| static ModuleVersion us::ModuleVersion::ParseVersion |
( |
const std::string & |
version | ) |
|
|
static |
Parses a version identifier from the specified string.
See ModuleVersion(const std::string&) for the format of the version string.
- Parameters
-
| [in] | version | string representation of the version identifier. Leading and trailing whitespace will be ignored. |
- Returns
- A
ModuleVersion object representing the version identifier. If version is the empty string then EmptyVersion will be returned.
◆ ToString()
| 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.
- Returns
- The string representation of this version identifier.
◆ UndefinedVersion()
Creates an undefined version identifier, representing either infinity or minus infinity.
The documentation for this class was generated from the following file: