diff options
author | chriseth <chris@ethereum.org> | 2016-10-25 19:20:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-25 19:20:08 +0800 |
commit | 2f7c847ce40fe6726d270a2997b380177ab6e03e (patch) | |
tree | a214bf1a29a8efd0a3b04d1f1fc254e56b7d968f | |
parent | e00a4b47c06d412cd9342b8be2163e861c591c28 (diff) | |
parent | 7a988555c36f00ef019b2221daf224966d8b4c6c (diff) | |
download | dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar.gz dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar.bz2 dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar.lz dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar.xz dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.tar.zst dexon-solidity-2f7c847ce40fe6726d270a2997b380177ab6e03e.zip |
Merge pull request #1279 from ethereum/semver-helper
Export major/minor/patch helpers on SemVerVersion
-rw-r--r-- | libsolidity/analysis/SemVerHandler.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libsolidity/analysis/SemVerHandler.h b/libsolidity/analysis/SemVerHandler.h index 3c110b19..e3b642db 100644 --- a/libsolidity/analysis/SemVerHandler.h +++ b/libsolidity/analysis/SemVerHandler.h @@ -40,6 +40,12 @@ struct SemVerVersion std::string prerelease; std::string build; + unsigned major() const { return numbers[0]; } + unsigned minor() const { return numbers[1]; } + unsigned patch() const { return numbers[2]; } + + bool isPrerelease() const { return !prerelease.empty(); } + explicit SemVerVersion(std::string const& _versionString = "0.0.0"); }; |