@brief returns version information on the library @sa https://json.nlohmann.me/api/basic_json/meta/
| 19547 | /// @brief returns version information on the library |
| 19548 | /// @sa https://json.nlohmann.me/api/basic_json/meta/ |
| 19549 | JSON_HEDLEY_WARN_UNUSED_RESULT |
| 19550 | static basic_json meta() |
| 19551 | { |
| 19552 | basic_json result; |
| 19553 | |
| 19554 | result["copyright"] = "(C) 2013-2023 Niels Lohmann"; |
| 19555 | result["name"] = "JSON for Modern C++"; |
| 19556 | result["url"] = "https://github.com/nlohmann/json"; |
| 19557 | result["version"]["string"] = |
| 19558 | detail::concat(std::to_string(NLOHMANN_JSON_VERSION_MAJOR), '.', |
| 19559 | std::to_string(NLOHMANN_JSON_VERSION_MINOR), '.', |
| 19560 | std::to_string(NLOHMANN_JSON_VERSION_PATCH)); |
| 19561 | result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR; |
| 19562 | result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR; |
| 19563 | result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH; |
| 19564 | |
| 19565 | #ifdef _WIN32 |
| 19566 | result["platform"] = "win32"; |
| 19567 | #elif defined __linux__ |
| 19568 | result["platform"] = "linux"; |
| 19569 | #elif defined __APPLE__ |
| 19570 | result["platform"] = "apple"; |
| 19571 | #elif defined __unix__ |
| 19572 | result["platform"] = "unix"; |
| 19573 | #else |
| 19574 | result["platform"] = "unknown"; |
| 19575 | #endif |
| 19576 | |
| 19577 | #if defined(__ICC) || defined(__INTEL_COMPILER) |
| 19578 | result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; |
| 19579 | #elif defined(__clang__) |
| 19580 | result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}}; |
| 19581 | #elif defined(__GNUC__) || defined(__GNUG__) |
| 19582 | result["compiler"] = {{"family", "gcc"}, {"version", detail::concat( |
| 19583 | std::to_string(__GNUC__), '.', |
| 19584 | std::to_string(__GNUC_MINOR__), '.', |
| 19585 | std::to_string(__GNUC_PATCHLEVEL__)) |
| 19586 | } |
| 19587 | }; |
| 19588 | #elif defined(__HP_cc) || defined(__HP_aCC) |
| 19589 | result["compiler"] = "hp" |
| 19590 | #elif defined(__IBMCPP__) |
| 19591 | result["compiler"] = {{"family", "ilecpp"}, {"version", __IBMCPP__}}; |
| 19592 | #elif defined(_MSC_VER) |
| 19593 | result["compiler"] = {{"family", "msvc"}, {"version", _MSC_VER}}; |
| 19594 | #elif defined(__PGI) |
| 19595 | result["compiler"] = {{"family", "pgcpp"}, {"version", __PGI}}; |
| 19596 | #elif defined(__SUNPRO_CC) |
| 19597 | result["compiler"] = {{"family", "sunpro"}, {"version", __SUNPRO_CC}}; |
| 19598 | #else |
| 19599 | result["compiler"] = {{"family", "unknown"}, {"version", "unknown"}}; |
| 19600 | #endif |
| 19601 | |
| 19602 | #if defined(_MSVC_LANG) |
| 19603 | result["compiler"]["c++"] = std::to_string(_MSVC_LANG); |
| 19604 | #elif defined(__cplusplus) |
| 19605 | result["compiler"]["c++"] = std::to_string(__cplusplus); |
| 19606 | #else |