module_version.h¶
| File Path | engine/include/conjure/modules/module_version.h |
| API ↗ | Writing a module |
Semantic versions and version ranges of the module system.
Structs¶
| File | Description |
|---|---|
semantic_version |
major.minor.patch, each at most 65535. Field names avoid major/minor, which glibc defines as macros. |
std::formatter<conjure::modules::semantic_version> |
|
std::formatter<conjure::modules::version_range> |
|
version_range |
Half-open range [minInclusive, maxExclusive). The default is "*": every version. |
Constants¶
| Name | Type | Value | Description |
|---|---|---|---|
MAX_SEMANTIC_VERSION |
inline constexpr semantic_ |
{0xFFFF, 0xFFFF, 0xFFFF} |
Largest representable version; the open upper bound of unbounded ranges. |
Functions¶
Public¶
host_engine_version¶
host_engine_version¶[[nodiscard]] constexpr semantic_version host_engine_version() noexcept;The version of the engine this code was compiled from (build_info.h).
parse_version¶
parse_version¶[[nodiscard]] CONJURE_API core::result<semantic_version> parse_version(
std::string_view text);Parses "major.minor.patch" (all three required, decimal without leading zeros, no sign, no tags, each at most 65535). PARSE_FAILURE otherwise.
parse_version_range¶
parse_version_range¶[[nodiscard]] CONJURE_API core::result<version_range> parse_version_range(
std::string_view text);Parses the range grammar described in the header comment. A reversed or empty range (">=2.0.0 <1.0.0") is PARSE_FAILURE.
to_string¶
to_string¶[[nodiscard]] CONJURE_API std::string to_string(
semantic_version version);"major.minor.patch".
[[nodiscard]] CONJURE_API std::string to_string(
const version_range &range);Canonical text that parse_version_range() turns back into the same range: "*" for an unbounded range, "1.2.3" for a single version, ">=a.b.c" for an open range and ">=a.b.c <d.e.f" otherwise (caret and tilde forms are not preserved).