/src/jsoncons/include/jsoncons/config/version.hpp
Line | Count | Source |
1 | | // Copyright 2013-2025 Daniel Parker |
2 | | // Distributed under the Boost license, Version 1.0. |
3 | | // (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
4 | | |
5 | | // See https://github.com/danielaparker/jsoncons for latest version |
6 | | |
7 | | #ifndef JSONCONS_CONFIG_VERSION_HPP |
8 | | #define JSONCONS_CONFIG_VERSION_HPP |
9 | | |
10 | | #include <ostream> |
11 | | |
12 | | #define JSONCONS_VERSION_MAJOR 1 |
13 | | #define JSONCONS_VERSION_MINOR 5 |
14 | | #define JSONCONS_VERSION_PATCH 0 |
15 | | |
16 | | #define JSONCONS_VERSION_CONCAT_EX(major, minor, patch) \ |
17 | | # major ## "." ## # minor ## "." ## # patch |
18 | | |
19 | | #define JSONCONS_VERSION_CONCAT(major, minor, patch) \ |
20 | | JSONCONS_VERSION_CONCAT_EX(major, minor, patch) |
21 | | |
22 | | #define JSONCONS_VERSION_STRING \ |
23 | | JSONCONS_VERSION_CONCAT(JSONCONS_VERSION_MAJOR, JSONCONS_VERSION_MINOR, JSONCONS_VERSION_PATCH) |
24 | | |
25 | | namespace jsoncons { |
26 | | |
27 | | struct versioning_info |
28 | | { |
29 | | unsigned int const major; |
30 | | unsigned int const minor; |
31 | | unsigned int const patch; |
32 | | |
33 | | friend std::ostream& operator<<(std::ostream& os, const versioning_info& ver) |
34 | 0 | { |
35 | 0 | os << ver.major << '.' |
36 | 0 | << ver.minor << '.' |
37 | 0 | << ver.patch; |
38 | 0 | return os; |
39 | 0 | } |
40 | | }; |
41 | | |
42 | | constexpr versioning_info version() |
43 | 0 | { |
44 | 0 | return versioning_info{JSONCONS_VERSION_MAJOR, JSONCONS_VERSION_MINOR, JSONCONS_VERSION_PATCH}; |
45 | 0 | } |
46 | | |
47 | | } // namespace jsoncons |
48 | | |
49 | | #endif // JSONCONS_CONFIG_VERSION_HPP |