aboutsummaryrefslogtreecommitdiff
path: root/libbutl/standard-version.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-12-14 10:24:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-12-14 10:24:09 +0200
commitcc8b52be1e02802ef82ff474721d78815ab4e63a (patch)
tree9651227fdc009ecd7a95e5bb138e20d39206e892 /libbutl/standard-version.ixx
parente724cff5ecc71ac4b128b545f5add51eaccee271 (diff)
Various improvements to standard_version
Diffstat (limited to 'libbutl/standard-version.ixx')
-rw-r--r--libbutl/standard-version.ixx42
1 files changed, 41 insertions, 1 deletions
diff --git a/libbutl/standard-version.ixx b/libbutl/standard-version.ixx
index f24e358..c488284 100644
--- a/libbutl/standard-version.ixx
+++ b/libbutl/standard-version.ixx
@@ -44,7 +44,7 @@ namespace butl
pre_release () const noexcept
{
std::uint64_t ab (version / 10 % 1000);
- if (ab > 500)
+ if (ab >= 500)
ab -= 500;
return static_cast<std::uint16_t> (ab);
@@ -70,6 +70,46 @@ namespace butl
return version % 10000 == 1 && !snapshot () && !stub ();
}
+ inline standard_version::
+ standard_version (std::uint16_t ep,
+ std::uint16_t mj,
+ std::uint16_t mi,
+ std::uint16_t pa,
+ std::uint16_t pr,
+ std::uint16_t rv)
+ : standard_version (ep,
+ // AAABBBCCCDDDE
+ (mj * 10000000000ULL +
+ mi * 10000000ULL +
+ pa * 10000ULL +
+ pr * 10ULL),
+ "" /* snapshot */,
+ rv)
+ {
+ }
+
+ inline standard_version::
+ standard_version (std::uint16_t ep,
+ std::uint16_t mj,
+ std::uint16_t mi,
+ std::uint16_t pa,
+ std::uint16_t pr,
+ std::uint64_t sn,
+ std::string si,
+ std::uint16_t rv)
+ : standard_version (ep,
+ // AAABBBCCCDDDE
+ (mj * 10000000000ULL +
+ mi * 10000000ULL +
+ pa * 10000ULL +
+ pr * 10ULL +
+ /**/ 1ULL /* snapshot */),
+ sn,
+ si,
+ rv)
+ {
+ }
+
inline standard_version::flags
operator& (standard_version::flags x, standard_version::flags y)
{