31 #ifndef HELPER_VERSIONS_HPP_ 32 #define HELPER_VERSIONS_HPP_ 34 #include "../Helper/FileSystem.hpp" 35 #include "../Helper/Portability/mysqlcppconn.h" 36 #include "../Helper/SilentInclude/EigenRand.h" 37 #include "../Helper/SilentInclude/tidy.h" 39 #include "../_extern/asio/asio/include/asio/version.hpp" 40 #include "../_extern/jsoncons/include/jsoncons/config/version.hpp" 41 #include "../_extern/rapidjson/include/rapidjson/rapidjson.h" 42 #include "../_extern/wapiti/wapiti.h" 45 #include "../_extern/mongoose/mongoose.h" 51 #include <boost/version.hpp> 52 #include <cppconn/driver.h> 53 #include <curl/curl.h> 54 #include <mapbox/variant.hpp> 56 #include <pugixml.hpp> 57 #include <uriparser/UriBase.h> 64 #include <string_view> 71 using std::string_view_literals::operator
""sv;
157 std::vector<StringString> result;
166 + std::to_string(ASIO_VERSION %
asioPatch)
182 std::to_string(EIGEN_WORLD_VERSION)
184 + std::to_string(EIGEN_MAJOR_VERSION)
186 + std::to_string(EIGEN_MINOR_VERSION)
192 std::to_string(EIGENRAND_WORLD_VERSION)
194 + std::to_string(EIGENRAND_MAJOR_VERSION)
196 + std::to_string(EIGENRAND_MINOR_VERSION)
200 result.emplace_back(
"GNU Aspell", aspell_version_string());
203 result.emplace_back(
"Howard E. Hinnant's date.h",
"");
208 std::to_string(JSONCONS_VERSION_MAJOR)
210 + std::to_string(JSONCONS_VERSION_MINOR)
212 + std::to_string(JSONCONS_VERSION_PATCH)
216 result.emplace_back(
"libcurl", curl_version_info(CURLVERSION_NOW)->version);
219 result.emplace_back(
"libzip", zip_libzip_version());
224 std::to_string(VARIANT_MAJOR_VERSION)
226 + std::to_string(VARIANT_MINOR_VERSION)
228 + std::to_string(VARIANT_PATCH_VERSION)
232 result.emplace_back(
"Mongoose", MG_VERSION);
235 sql::Driver * driver{get_driver_instance()};
237 if(driver !=
nullptr) {
240 std::to_string(driver->getMajorVersion())
242 + std::to_string(driver->getMinorVersion())
244 + std::to_string(driver->getPatchVersion())
251 std::to_string(PCRE2_MAJOR)
253 + std::to_string(PCRE2_MINOR)
257 result.emplace_back(
"porter2_stemmer",
"");
270 result.emplace_back(
"RapidJSON", RAPIDJSON_VERSION_STRING);
276 result.emplace_back(
"tidy-html5", tidyLibraryVersion());
281 std::to_string(URI_VER_MAJOR)
283 + std::to_string(URI_VER_MINOR)
285 + std::to_string(URI_VER_RELEASE)
286 + URI_VER_SUFFIX_ANSI
293 result.emplace_back(
"Wapiti", Data::wapiti::version);
296 result.emplace_back(
"zlib", ZLIB_VERSION);
317 for(
const auto& version : versions) {
319 result += version.first;
321 if(!(version.second.empty())) {
323 result += version.second;
329 if(!versions.empty()) {
343 std::string pathToFile;
347 pathToFile += pathElement;
348 pathToFile += pathSeparator;
351 if(!pathToFile.empty()) {
352 pathToFile.pop_back();
355 std::ifstream in(pathToFile);
360 while(std::getline(in, line)) {
366 if(end != std::string::npos) {
367 version = line.substr(
378 if(version.empty()) {
constexpr auto pugixmlMajor
Divisor to retrieve the major version of the pugixml library.
Definition: Versions.hpp:102
constexpr auto boostMinor
Divisor to retrieve the minor version of the Boost library.
Definition: Versions.hpp:96
constexpr auto asioMajor
Divisor to retrieve the major version of the Asio library.
Definition: Versions.hpp:81
constexpr auto asioPatch
Mod divisor to retrieve the patch version of the Asio library.
Definition: Versions.hpp:90
Namespace for functions getting the versions of the different libraries used by the application...
Definition: Versions.hpp:69
constexpr auto tomotoVersionBegin
The beginning of the line containing the version of the tomoto library.
Definition: Versions.hpp:117
constexpr std::string_view utf8CppVersion
The version of the UTF8-CPP library.
Definition: Versions.hpp:127
std::string getTomotoVersion()
Gets the version of the tomoto library if available.
Definition: Versions.hpp:341
std::vector< StringString > getLibraryVersions()
Gets the versions of the used libraries.
Definition: Versions.hpp:156
std::pair< std::string, std::string > StringString
A pair of strings.
Definition: Versions.hpp:136
char getPathSeparator()
Gets the preferred separator for file paths in the current operating system.
Definition: FileSystem.hpp:187
constexpr auto tomotoVersionEnd
The end of the line containing the version of the tomoto library.
Definition: Versions.hpp:120
constexpr auto asioModMinor
Mod divisor to retrieve the minor version of the Asio library.
Definition: Versions.hpp:87
constexpr auto boostPatch
Mod divisor to retrieve the patch level of the Boost library.
Definition: Versions.hpp:99
constexpr auto boostMajor
Divisor to retrieve the major version of the Boost library.
Definition: Versions.hpp:93
constexpr std::array tomotoVersionFile
The path from where to read the version of the tomoto library from.
Definition: Versions.hpp:108
std::string getLibraryVersionsStr(const std::string &indent)
Gets the versions of the used libraries as one indented string.
Definition: Versions.hpp:310
constexpr auto pugixmlMinor
Divisor to retrieve the minor version of the pugixml library.
Definition: Versions.hpp:105
constexpr auto asioMinor
Divisor to retrieve the minor version of the Asio library.
Definition: Versions.hpp:84