Loading...
Searching...
No Matches
buildFeature.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "indep/common.hpp"
5#include "indep/macro.hpp"
6
7namespace by {
38 class _nout buildFeature {
39 BY_ME(buildFeature)
40
41 public:
46 struct _nout date {
47 BY_ME(date)
48
49 public:
50 static const std::string& get();
51
52 static constexpr nint getYear() { return BY_BUILD_DATE_YEAR; }
53
54 static constexpr nint getMonth() { return BY_BUILD_DATE_MONTH; }
55
56 static constexpr nint getDay() { return BY_BUILD_DATE_DAY; }
57 };
58
63 struct _nout time {
64 BY_ME(time)
65
66 public:
67 static const std::string& get();
68
69 static constexpr nint getHour() { return BY_BUILD_TIME_HOUR; }
70
71 static constexpr nint getMin() { return BY_BUILD_TIME_MINUTE; }
72
73 static constexpr nint getSec() { return BY_BUILD_TIME_SECOND; }
74 };
75
80 struct _nout version {
81 BY_ME(version)
82
83 public:
84 static const std::string& get();
85 static const std::string& getValue();
86
87 static constexpr nint getMajor() { return BY_BUILD_VER_MAJOR; }
88
89 static constexpr nint getMinor() { return BY_BUILD_VER_MINOR; }
90
91 static constexpr nint getPatch() { return BY_BUILD_VER_PATCH; }
92
93 static constexpr const nchar* getCommitHash() { return BY_BUILD_GIT_COMMIT_HASH; }
94 };
95
96 enum platformType {
97 PLATFORM_TYPE_START = -1,
98 WINDOW,
99 LINUX,
100 MACOS,
101 OTHERS,
102 PLATFORM_TYPE_END,
103 };
104
109 struct _nout platform {
110 BY_ME(platform)
111
112 public:
113 static platformType get();
114 static const std::string& getName();
115 static const std::string& getVersion();
116
117 static constexpr ncnt getArchBits() { return sizeof(void*) * 8; }
118 };
119
120 enum buildType {
121 BUILD_TYPE_START = -1,
122 DEBUG,
123 RELEASE,
124 BUILD_TYPE_END,
125 };
126
131 struct _nout config {
132 BY_ME(config)
133
134 public:
135 static buildType get();
136
141 constexpr static nbool isDbg() {
142#if BY_IS_DBG
143 return true;
144#else
145 return false;
146#endif
147 }
148
149 static const std::string& getName();
150 };
151 };
152} // namespace by
Provides build-time information and feature detection.
Definition buildFeature.hpp:38
Build configuration information.
Definition buildFeature.hpp:131
static constexpr nbool isDbg()
Checks if this is a debug build.
Definition buildFeature.hpp:141
Build date information.
Definition buildFeature.hpp:46
Platform information.
Definition buildFeature.hpp:109
Build time information.
Definition buildFeature.hpp:63
Version information.
Definition buildFeature.hpp:80
Rich logging support with polymorphic type conversion.
Definition richLog.hpp:34