libcommonc++
0.7
|
A class representing an interface version number. More...
#include <Version.h++>
Public Member Functions | |
Version (const String &version) | |
Construct a new Version from the specified string representation. More... | |
Version (uint_t current=0, uint_t revision=0, uint_t age=0) | |
Construct a new Version for the given components. More... | |
Version (const Version &other) | |
Copy constructor. More... | |
virtual | ~Version () |
Destructor. More... | |
bool | satisfies (const Version &requested) const |
Determine if an interface with this version satisfies a request for an interface with a specific requested version (i.e., if it is API-compatible with the requested interface). More... | |
bool | satisfiedBy (const Version &available) const |
Determine if a requested interface with this version is satisfied by a specific available version (i.e., if the available interface is API-compatible with the requested version of the interface). More... | |
uint_t | getCurrent () const |
Get the current component of the version. More... | |
uint_t | getRevision () const |
Get the revision component of the version. More... | |
uint_t | getAge () const |
Get the age component of the version. More... | |
void | interfacesAdded () |
Adjust the version to reflect the addition of new interfaces. More... | |
void | interfacesRemoved () |
Adjust the version to reflect the removal of existing interfaces. More... | |
void | interfacesChanged () |
Adjust the version to reflect non-backward-compatible changes to the interfaces. More... | |
void | implementationChanged () |
Adjust the version to reflect internal implementation changes. More... | |
String | toString () const |
Get a String representation of the version, in C-A.A.R form. More... | |
String | toCRAString () const |
Get a String representation of the version, in C:R:A form. More... | |
void | fromString (const String &version) |
Parse the verison from a String. More... | |
bool | operator== (const Version &other) const |
Equality operator. More... | |
bool | operator!= (const Version &other) const |
Inequality operator. More... | |
bool | operator< (const Version &other) const |
Determine if this Version is older than another version. More... | |
bool | operator<= (const Version &other) const |
Determine if this Version is older than or equal to another version. More... | |
bool | operator> (const Version &other) const |
Determine if this Version is newer than another version. More... | |
bool | operator>= (const Version &other) const |
Determine if this Version is newer than or equal to another version. More... | |
Version & | operator= (const Version &other) |
Assignment operator. More... | |
A class representing an interface version number.
The version number consists of three components:
These three components are not to be interpreted as major version, minor version, and build number.
A version begins at 0:0:0. The version number changes according to the following rules:
Construct a new Version from the specified string representation.
version | The string representation of a version, in the form C:R:A or C-A.A.R. For example, 9:0:6 and 3.6.0 are equivalent. |
Construct a new Version for the given components.
current | The current component. |
revision | The revision component. |
age | The age component, which must always be less than or equal to current; if an invalid age is specified, the value of current is used for age. |
|
virtual |
Destructor.
|
inline |
Get the age component of the version.
|
inline |
Get the current component of the version.
|
inline |
Get the revision component of the version.
void implementationChanged | ( | ) |
Adjust the version to reflect internal implementation changes.
void interfacesAdded | ( | ) |
Adjust the version to reflect the addition of new interfaces.
void interfacesChanged | ( | ) |
Adjust the version to reflect non-backward-compatible changes to the interfaces.
void interfacesRemoved | ( | ) |
Adjust the version to reflect the removal of existing interfaces.
|
inline |
Inequality operator.
bool operator< | ( | const Version & | other | ) | const |
Determine if this Version is older than another version.
|
inline |
Determine if this Version is older than or equal to another version.
bool operator== | ( | const Version & | other | ) | const |
Equality operator.
bool operator> | ( | const Version & | other | ) | const |
Determine if this Version is newer than another version.
|
inline |
Determine if this Version is newer than or equal to another version.
bool satisfiedBy | ( | const Version & | available | ) | const |
Determine if a requested interface with this version is satisfied by a specific available version (i.e., if the available interface is API-compatible with the requested version of the interface).
available | The version that is available. |
bool satisfies | ( | const Version & | requested | ) | const |
Determine if an interface with this version satisfies a request for an interface with a specific requested version (i.e., if it is API-compatible with the requested interface).
requested | The requested version. |