|
Mantid
|
Implementation of a SemVer parser. More...
#include <SemanticVersion.h>
Public Member Functions | |
| const std::string & | getBuild () const |
| std::uint32_t | getMajor () const |
| std::uint32_t | getMinor () const |
| std::uint32_t | getPatch () const |
| const std::string & | getPrerelease () const |
| const std::string & | getVersion () const |
| std::strong_ordering | operator<=> (const SemanticVersion &other) const |
| Comparison operator. | |
| std::strong_ordering | operator<=> (const std::string &versionStr) const |
| Comparison operator. | |
| SemanticVersion & | operator= (const SemanticVersion &other)=default |
| bool | operator== (const SemanticVersion &other) const |
| Check if two versions are equivalent. | |
| SemanticVersion ()=delete | |
| SemanticVersion (const SemanticVersion &other)=default | |
| SemanticVersion (const std::string &) | |
| Constructor using a full version string. | |
| SemanticVersion (std::uint32_t major, std::uint32_t minor=0, std::uint32_t patch=0, const std::string &prerelease="", const std::string &build="") | |
| Constructor using the full version string from the indidual major, minor, patch, etc. | |
| ~SemanticVersion ()=default | |
Static Public Attributes | |
| static std::regex | version_regex |
Private Member Functions | |
| void | parse_version (const std::string &) |
| Check and split the version string into major, minor, patch, etc. | |
Private Attributes | |
| std::string | m_build = "" |
| std::uint32_t | m_major = 0 |
| std::uint32_t | m_minor = 0 |
| std::uint32_t | m_patch = 0 |
| std::string | m_prerelease = "" |
| std::string | m_version = "" |
Implementation of a SemVer parser.
It supports th following formats :
The implementation is not strict in the sense that:
so e.g.:
Definition at line 41 of file SemanticVersion.h.
|
delete |
Referenced by operator<=>().
|
default |
| Mantid::DataObjects::SemanticVersion::SemanticVersion | ( | const std::string & | version | ) |
Constructor using a full version string.
The version string is parsed and separated into major, minor, patch, etc.
| version | The full version string |
| std::runtime_error | if parsing fails |
Definition at line 45 of file SemanticVersion.cpp.
References parse_version().
| Mantid::DataObjects::SemanticVersion::SemanticVersion | ( | std::uint32_t | major, |
| std::uint32_t | minor = 0, |
||
| std::uint32_t | patch = 0, |
||
| const std::string & | prerelease = "", |
||
| const std::string & | build = "" |
||
| ) |
Constructor using the full version string from the indidual major, minor, patch, etc.
values
| major | Major number of the release |
| minor | Minor number of the release |
| patch | patch number |
| prerelease | pre-release string |
| build | build id string |
Definition at line 55 of file SemanticVersion.cpp.
References m_build, m_prerelease, and m_version.
|
default |
| const std::string & Mantid::DataObjects::SemanticVersion::getBuild | ( | ) | const |
Definition at line 106 of file SemanticVersion.cpp.
References m_build.
| std::uint32_t Mantid::DataObjects::SemanticVersion::getMajor | ( | ) | const |
Definition at line 108 of file SemanticVersion.cpp.
References m_major.
| std::uint32_t Mantid::DataObjects::SemanticVersion::getMinor | ( | ) | const |
Definition at line 110 of file SemanticVersion.cpp.
References m_minor.
| std::uint32_t Mantid::DataObjects::SemanticVersion::getPatch | ( | ) | const |
Definition at line 112 of file SemanticVersion.cpp.
References m_patch.
| const std::string & Mantid::DataObjects::SemanticVersion::getPrerelease | ( | ) | const |
Definition at line 114 of file SemanticVersion.cpp.
References m_prerelease.
| const std::string & Mantid::DataObjects::SemanticVersion::getVersion | ( | ) | const |
Definition at line 116 of file SemanticVersion.cpp.
References m_version.
| std::strong_ordering Mantid::DataObjects::SemanticVersion::operator<=> | ( | const SemanticVersion & | other | ) | const |
Comparison operator.
the build string is not considered
| other | Other SemanticVersion class |
Definition at line 82 of file SemanticVersion.cpp.
| std::strong_ordering Mantid::DataObjects::SemanticVersion::operator<=> | ( | const std::string & | otherVersionStr | ) | const |
Comparison operator.
the build string is not considered
| otherVersionStr | other version string |
Definition at line 102 of file SemanticVersion.cpp.
References SemanticVersion().
|
default |
| bool Mantid::DataObjects::SemanticVersion::operator== | ( | const SemanticVersion & | other | ) | const |
Check if two versions are equivalent.
the build string is not considered
Definition at line 71 of file SemanticVersion.cpp.
References m_major, m_minor, m_patch, and m_prerelease.
|
private |
Check and split the version string into major, minor, patch, etc.
| version | full version string |
Definition at line 122 of file SemanticVersion.cpp.
References Mantid::Geometry::m, m_build, m_major, m_minor, m_patch, m_prerelease, value, and version_regex.
Referenced by SemanticVersion().
|
private |
Definition at line 111 of file SemanticVersion.h.
Referenced by getBuild(), parse_version(), and SemanticVersion().
|
private |
Definition at line 99 of file SemanticVersion.h.
Referenced by getMajor(), operator==(), and parse_version().
|
private |
Definition at line 102 of file SemanticVersion.h.
Referenced by getMinor(), operator==(), and parse_version().
|
private |
Definition at line 105 of file SemanticVersion.h.
Referenced by getPatch(), operator==(), and parse_version().
|
private |
Definition at line 108 of file SemanticVersion.h.
Referenced by getPrerelease(), operator==(), parse_version(), and SemanticVersion().
|
private |
Definition at line 96 of file SemanticVersion.h.
Referenced by getVersion(), and SemanticVersion().
|
static |
Definition at line 45 of file SemanticVersion.h.
Referenced by parse_version().