aboutsummaryrefslogtreecommitdiff
path: root/butl/standard-version.ixx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-05-01 16:08:43 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-05-01 16:59:24 +0300
commit61377c582e0f2675baa5f5e6e30a35d1a4164b33 (patch)
tree11cdca992834d7f7f197f72856712fbcb3020e3d /butl/standard-version.ixx
parent442c1a6790e52baa0c081f310d4d9e9b6f1ff638 (diff)
Add hxx extension for headers and lib prefix for library dir
Diffstat (limited to 'butl/standard-version.ixx')
-rw-r--r--butl/standard-version.ixx100
1 files changed, 0 insertions, 100 deletions
diff --git a/butl/standard-version.ixx b/butl/standard-version.ixx
deleted file mode 100644
index 6908ed5..0000000
--- a/butl/standard-version.ixx
+++ /dev/null
@@ -1,100 +0,0 @@
-// file : butl/standard-version.ixx -*- C++ -*-
-// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
-// license : MIT; see accompanying LICENSE file
-
-namespace butl
-{
- inline std::uint16_t standard_version::
- major () const noexcept
- {
- std::uint64_t e (version % 10);
- std::uint64_t v (version / 10);
- std::uint64_t ab (v % 1000);
- if (ab != 0 || e == 1)
- v += 1000 - ab;
-
- return static_cast<std::uint16_t> (v / 1000000000 % 1000);
- }
-
- inline std::uint16_t standard_version::
- minor () const noexcept
- {
- std::uint64_t e (version % 10);
- std::uint64_t v (version / 10);
- std::uint64_t ab (v % 1000);
- if (ab != 0 || e == 1)
- v += 1000 - ab;
-
- return static_cast<std::uint16_t> (v / 1000000 % 1000);
- }
-
- inline std::uint16_t standard_version::
- patch () const noexcept
- {
- std::uint64_t e (version % 10);
- std::uint64_t v (version / 10);
- std::uint64_t ab (v % 1000);
- if (ab != 0 || e == 1)
- v += 1000 - ab;
-
- return static_cast<std::uint16_t> (v / 1000 % 1000);
- }
-
- inline std::uint16_t standard_version::
- pre_release () const noexcept
- {
- std::uint64_t ab (version / 10 % 1000);
- if (ab > 500)
- ab -= 500;
-
- return static_cast<std::uint16_t> (ab);
- }
-
- inline bool standard_version::
- alpha () const noexcept
- {
- std::uint64_t abe (version % 10000);
- return abe > 0 && abe < 5000 && !stub ();
- }
-
- inline bool standard_version::
- beta () const noexcept
- {
- std::uint64_t abe (version % 10000);
- return abe > 5000 && !stub ();
- }
-
- inline bool standard_version::
- earliest () const noexcept
- {
- return version % 10000 == 1 && !snapshot () && !stub ();
- }
-
- inline standard_version::flags
- operator& (standard_version::flags x, standard_version::flags y)
- {
- return x &= y;
- }
-
- inline standard_version::flags
- operator| (standard_version::flags x, standard_version::flags y)
- {
- return x |= y;
- }
-
- inline standard_version::flags
- operator&= (standard_version::flags& x, standard_version::flags y)
- {
- return x = static_cast<standard_version::flags> (
- static_cast<std::uint16_t> (x) &
- static_cast<std::uint16_t> (y));
- }
-
- inline standard_version::flags
- operator|= (standard_version::flags& x, standard_version::flags y)
- {
- return x = static_cast<standard_version::flags> (
- static_cast<std::uint16_t> (x) |
- static_cast<std::uint16_t> (y));
- }
-}