![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/util/Version.h>
Public Member Functions | |
Version (int major=0, int minor=0, int release=0) | |
Version (const Version &version) | |
Version (const char *text) | |
Version (const cstring text) | |
Version (const string &text) | |
Version | nextRelease (void) const |
Version | nextMinor (void) const |
Version | nextMajor (void) const |
int | major (void) const |
int | minor (void) const |
int | release (void) const |
bool | accepts (const Version &version) const |
int | compare (const Version &version) const |
operator bool (void) const | |
Version & | operator= (const Version &version) |
Version & | operator= (const char *text) |
Version & | operator= (const cstring text) |
Version & | operator= (const string &text) |
bool | operator== (const Version &version) const |
bool | operator!= (const Version &version) const |
bool | operator> (const Version &version) const |
bool | operator>= (const Version &version) const |
bool | operator< (const Version &version) const |
bool | operator<= (const Version &version) const |
Static Public Attributes | |
static const Version | ZERO |
Useful for representing versions. The versions are represented as a triplet composed of a major number, a minor number and a release number. Different major numbers means that two versions are uncompatible. The minor version number means ascending compatibility. The release number versions only denotes different debugging versions (no change in the interface of a compilation unit).
|
inline |
Build a new version.
major | Major number. |
minor | Minor number. |
release | Release number. |
References Version::major(), Version::minor(), and Version::release().
Referenced by Version::nextMajor(), Version::nextMinor(), and Version::nextRelease().
Build a version by cloning.
version | Cloned version. |
|
inline |
Build a version from a string.
text | String to build from. |
Test if the current version accepts the given one, that is, the current one is ascendent-compatible with the given one.
version | Version to compare with. |
Referenced by Plugger::plugFile().
|
inline |
Compare two versions. Notice that comparison is only performed on major and minor numbers.
version | Version to compare with. |
Referenced by Version::operator!=(), Version::operator<(), Version::operator<=(), Version::operator==(), Version::operator>(), and Version::operator>=().
|
inline |
Get the major number.
Referenced by elm::operator<<(), and Version::Version().
|
inline |
Get the minor number.
Referenced by elm::operator<<(), and Version::Version().
Build a version with the next major number.
References Version::Version().
Build a version with the next minor number.
References Version::Version().
Build a version with the next release.
References Version::Version().
References Version::compare().
References Version::compare().
References Version::compare().
|
inline |
Set a version from a text string. The text string must have the following form: [0-9]+(.[0-9]+([0-9]+)?)?. If the string does not match, the version 0.0.0 is set.
text | Text containing the version. |
References String::indexOf(), String::substring(), and Version::ZERO.
References Version::compare().
References Version::compare().
References Version::compare().
|
inline |
Get the release number.
Referenced by elm::operator<<(), and Version::Version().
|
static |
Zero version, that is, 0.0.0.
Referenced by Manager::displayHelp(), and Version::operator=().