core-adapters 0.1.1
Third-party adapters for snicholls-core: nanobind helpers, nlohmann/json hooks, the snicholls_core Python package
Loading...
Searching...
No Matches
version.hpp
Go to the documentation of this file.
1//
2// version.hpp
3// core-adapters
4//
5// Copyright 2010-2026 Saxon Herschel Nicholls
6//
7
35
38
39#ifndef snicholls_core_adapters_version_hpp
40#define snicholls_core_adapters_version_hpp
41
42#include <snicholls/core/version.hpp>
43
44#include <string_view>
45
47#define SNICHOLLS_CORE_ADAPTERS_VERSION_MAJOR 0
49#define SNICHOLLS_CORE_ADAPTERS_VERSION_MINOR 1
51#define SNICHOLLS_CORE_ADAPTERS_VERSION_PATCH 1
52
54#define SNICHOLLS_CORE_ADAPTERS_VERSION \
55 SNICHOLLS_CORE_VERSION_CHECK(SNICHOLLS_CORE_ADAPTERS_VERSION_MAJOR, SNICHOLLS_CORE_ADAPTERS_VERSION_MINOR, \
56 SNICHOLLS_CORE_ADAPTERS_VERSION_PATCH)
57
59#define SNICHOLLS_CORE_ADAPTERS_VERSION_STRING \
60 SNICHOLLS_CORE_VERSION_STRINGIFY(SNICHOLLS_CORE_ADAPTERS_VERSION_MAJOR) "." \
61 SNICHOLLS_CORE_VERSION_STRINGIFY(SNICHOLLS_CORE_ADAPTERS_VERSION_MINOR) "." \
62 SNICHOLLS_CORE_VERSION_STRINGIFY(SNICHOLLS_CORE_ADAPTERS_VERSION_PATCH)
63
65#define SNICHOLLS_CORE_ADAPTERS_REQUIRE_VERSION(major, minor, patch) \
66 static_assert(SNICHOLLS_CORE_ADAPTERS_VERSION >= SNICHOLLS_CORE_VERSION_CHECK(major, minor, patch), \
67 "core-adapters " SNICHOLLS_CORE_ADAPTERS_VERSION_STRING " is older than the " #major "." #minor \
68 "." #patch " this code requires")
69
70namespace snicholls::core_adapters {
71
73constexpr int version_major() noexcept { return SNICHOLLS_CORE_ADAPTERS_VERSION_MAJOR; }
75constexpr int version_minor() noexcept { return SNICHOLLS_CORE_ADAPTERS_VERSION_MINOR; }
77constexpr int version_patch() noexcept { return SNICHOLLS_CORE_ADAPTERS_VERSION_PATCH; }
79constexpr int version() noexcept { return SNICHOLLS_CORE_ADAPTERS_VERSION; }
81constexpr std::string_view version_string() noexcept { return SNICHOLLS_CORE_ADAPTERS_VERSION_STRING; }
83constexpr std::string_view core_version_string() noexcept { return SNICHOLLS_CORE_VERSION_STRING; }
84
85} // namespace snicholls::core_adapters
86
87#endif /* snicholls_core_adapters_version_hpp */
constexpr int version_major() noexcept
The major version.
Definition version.hpp:73
#define SNICHOLLS_CORE_ADAPTERS_VERSION_MAJOR
The major version.
Definition version.hpp:47
constexpr int version() noexcept
The version as one integer.
Definition version.hpp:79
#define SNICHOLLS_CORE_ADAPTERS_VERSION_STRING
The version as a string literal, "major.minor.patch".
Definition version.hpp:59
constexpr int version_minor() noexcept
The minor version.
Definition version.hpp:75
#define SNICHOLLS_CORE_ADAPTERS_VERSION
The version as one comparable integer: major * 10000 + minor * 100 + patch.
Definition version.hpp:54
constexpr int version_patch() noexcept
The patch version.
Definition version.hpp:77
#define SNICHOLLS_CORE_ADAPTERS_VERSION_PATCH
The patch version.
Definition version.hpp:51
constexpr std::string_view version_string() noexcept
The version as text.
Definition version.hpp:81
#define SNICHOLLS_CORE_ADAPTERS_VERSION_MINOR
The minor version.
Definition version.hpp:49
constexpr std::string_view core_version_string() noexcept
The snicholls-core version these headers were compiled against.
Definition version.hpp:83