#include <Version.hpp>
|
|
| Version ()=default |
| |
| | Version (StringView version) |
| |
| | Version (int major, int minor, int patch=-1, StringView prerelease={}, StringView build={}) |
| |
|
int | compare (const Version &other) const |
| |
|
bool | operator== (const Version &other) const |
| |
|
bool | operator!= (const Version &other) const |
| |
|
bool | operator< (const Version &other) const |
| |
|
bool | operator> (const Version &other) const |
| |
|
bool | operator<= (const Version &other) const |
| |
|
bool | operator>= (const Version &other) const |
| |
|
bool | valid () const |
| |
|
int | major () const |
| |
|
void | setMajor (int major) |
| |
|
int | minor () const |
| |
|
void | setMinor (int minor) |
| |
|
int | patch () const |
| |
|
void | setPatch (int patch) |
| |
|
const std::string & | prerelease () const |
| |
|
void | setPrerelease (StringView prerelease) |
| |
|
const std::string & | build () const |
| |
|
void | setBuild (StringView build) |
| |
版本号
根据 Semantic Versioning 2.0.0 规范定义的版本号 版本号的格式为:主版本号.次版本号.修订版本号[-预发布版本号+构建版本号]
- 参见
- https://semver.org/lang/zh-CN/
◆ Version() [1/2]
◆ Version() [2/2]
| ast::Version::Version |
( |
int | major, |
|
|
int | minor, |
|
|
int | patch = -1, |
|
|
StringView | prerelease = {}, |
|
|
StringView | build = {} ) |
- 参数
-
| major | 主版本号 |
| minor | 次版本号 |
| patch | 修订版本号,如果<0,则不包含修订版本号 |
| prerelease | 预发布版本号,如果为空,则不包含预发布版本号 |
| build | 构建版本号,如果为空,则不包含构建版本号 |
◆ Parse()
该类的文档由以下文件生成: