Represents a simple Semantic Version number such as "4.3.7-beta".
More...
#include <semver.h>
|
bool | operator== (const SemVer &) const =default |
| Default equality operator.
|
|
std::strong_ordering | operator<=> (const SemVer &other) const |
| Compare two SemVer objects.
|
|
|
uint8_t | major |
| Major version.
|
|
uint8_t | minor |
| Minor version.
|
|
uint8_t | patch |
| Patch version.
|
|
std::string_view | pre_release {} |
| Pre-release string.
|
|
Represents a simple Semantic Version number such as "4.3.7-beta".
◆ operator<=>()
std::strong_ordering SemVer::operator<=> |
( |
const SemVer & | other | ) |
const |
Compare two SemVer objects.
This is a custom operator implementation (instead of default) due due to the way semver handles "pre-release" information. If a SemVer has a pre-release extension, it is considered older (less than) than the same SemVer without that extension. This means that simple field-by-field compare cannot be done, as the pre-release would normally require lexicographical comparison and count anything longer as "greater than", which is the opposite of what's desired.
◆ parse()
Parse a SemVer from a string.
This is just a helper object to construct the parser and run it
- Parameters
-
- Returns
- std::expected<SemVer, Parser::Error> Either the successfully parsed SemVer, or the Error that arose during parsing.
The documentation for this struct was generated from the following files:
- src/deluge/util/semver.h
- src/deluge/util/semver.cpp