An implementation of the Semantic Versioning 2.0.0 specification. More...
Classes | |
| class | sourcemeta::core::SemVer |
An implementation of the Semantic Versioning 2.0.0 specification.
This functionality is included as follows:
| class sourcemeta::core::SemVer |
A non-owning view over a parsed SemVer 2.0.0 version string. The input string must outlive this object.
Public Types | |
| enum class | Mode : std::uint8_t { Strict , Loose } |
| The level of strictness applied when parsing a version string. More... | |
Public Member Functions | |
| SemVer (std::string_view input, Mode mode=Mode::Strict) | |
| Construct a version by parsing the given string, throwing on failure. | |
| SOURCEMETA_FORCEINLINE auto | major () const noexcept -> std::uint64_t |
| The major version number. | |
| SOURCEMETA_FORCEINLINE auto | minor () const noexcept -> std::uint64_t |
| The minor version number. | |
| SOURCEMETA_FORCEINLINE auto | patch () const noexcept -> std::uint64_t |
| The patch version number. | |
| SOURCEMETA_FORCEINLINE auto | pre_release () const noexcept -> std::string_view |
| The pre-release identifier, or empty if none is present. | |
| SOURCEMETA_FORCEINLINE auto | build () const noexcept -> std::string_view |
| The build metadata, or empty if none is present. | |
| auto | to_string () const -> std::string |
| Serialise the version back into its string representation. | |
Static Public Member Functions | |
| static auto | from (std::string_view input, Mode mode=Mode::Strict) noexcept -> std::optional< SemVer > |
| Parse a version from the given string, returning no value on failure. | |
|
strong |