Parses a version string "Major.Minor.Patch-PreRelease+Build" and allow versions to be compared. Try to follow semantic versioning: http://semver.org/ A nuanced picture, i.e. reasons why you do not necessarily need to follow semantic versioning: "Why Semantic Versioning Isn't": https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e.
More...
#include <version.h>
|
constexpr | Version (std::string_view version) |
| Parses the version.
|
|
constexpr | Version (const char *version) |
|
constexpr | Version (unsigned int major=1, unsigned int minor=0, unsigned int patch=0, std::string_view preRelease="", std::string_view build="") |
|
constexpr bool | semanticVersionEqual (const Version &other) const |
|
constexpr std::strong_ordering | operator<=> (const Version &rhs) const |
| Compares major, minor, patch and prerelease versions in order.
|
|
constexpr bool | operator== (const Version &rhs) const |
|
constexpr std::string_view | preRelease () const |
|
constexpr std::string_view | build () const |
|
|
unsigned int | major = 0 |
| Increases when you make incompatible API changes.
|
|
unsigned int | minor |
| Increases when you add functionality in a backwards-compatible manner.
|
|
unsigned int | patch = 0 |
| Increases when you make backwards-compatible bug fixes.
|
|
|
IVW_CORE_API friend std::ostream & | operator<< (std::ostream &ss, const Version &v) |
|
Parses a version string "Major.Minor.Patch-PreRelease+Build" and allow versions to be compared. Try to follow semantic versioning: http://semver.org/ A nuanced picture, i.e. reasons why you do not necessarily need to follow semantic versioning: "Why Semantic Versioning Isn't": https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e.
- MAJOR version when you make incompatible API changes,
- MINOR version when you add functionality in a backwards-compatible manner, and
- PATCH version when you make backwards-compatible bug fixes.
- PRE-RELEASE Annotate pre-release versions with a hyphen and a series of dot separated identifiers.
- BUILD Build metadata denoted by appending a plus sign and a series of dot separated identifiers immediately following the patch or pre-release version. The build metadata is ignored when comparing versions.
Major and minor versions are used during equal comparison since API changes should not exist in patch and build version changes (unless major version is zero).
- Note
- Module versions are tied to the Inviwo core version, which means that there is no need to update module version if it is built for a new Inviwo core version.
◆ Version()
inviwo::Version::Version |
( |
std::string_view | version | ) |
|
|
constexpr |
Parses the version.
- Parameters
-
version | Dot separated version string "Major.Minor.Patch.Build" |
◆ semanticVersionEqual()
bool inviwo::Version::semanticVersionEqual |
( |
const Version & | other | ) |
const |
|
constexpr |
Major version >= 1: Return true if major and minor versions are equal, false otherwise. Major version < 1: Return true if major, minor and patch versions are equal, false otherwise.
- Note
- Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable. Patch and build versions are ignored since API should not have changed in those cases.
- Returns
- bool true if major and minor versions are equal, false otherwise.
◆ minor
unsigned int inviwo::Version::minor |
Initial value:
Increases when you add functionality in a backwards-compatible manner.
The documentation for this class was generated from the following file: