MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / basic_json meta

Function basic_json meta

Source/Utils/json.hpp:16829–16883  ·  view source on GitHub ↗

! @brief returns version information on the library This function returns a JSON object with information about the library, including the version number and information on the platform and compiler. @return JSON object holding version information key | description ----------- | --------------- `compiler` | Information on the used c

Source from the content-addressed store, hash-verified

16827 @since 2.1.0
16828 */
16829 JSON_HEDLEY_WARN_UNUSED_RESULT
16830 static basic_json meta()
16831 {
16832 basic_json result;
16833
16834 result["copyright"] = "(C) 2013-2020 Niels Lohmann";
16835 result["name"] = "JSON for Modern C++";
16836 result["url"] = "https://github.com/nlohmann/json";
16837 result["version"]["string"] =
16838 std::to_string(NLOHMANN_JSON_VERSION_MAJOR) + "." +
16839 std::to_string(NLOHMANN_JSON_VERSION_MINOR) + "." +
16840 std::to_string(NLOHMANN_JSON_VERSION_PATCH);
16841 result["version"]["major"] = NLOHMANN_JSON_VERSION_MAJOR;
16842 result["version"]["minor"] = NLOHMANN_JSON_VERSION_MINOR;
16843 result["version"]["patch"] = NLOHMANN_JSON_VERSION_PATCH;
16844
16845#ifdef _WIN32
16846 result["platform"] = "win32";
16847#elif defined __linux__
16848 result["platform"] = "linux";
16849#elif defined __APPLE__
16850 result["platform"] = "apple";
16851#elif defined __unix__
16852 result["platform"] = "unix";
16853#else
16854 result["platform"] = "unknown";
16855#endif
16856
16857#if defined(__ICC) || defined(__INTEL_COMPILER)
16858 result["compiler"] = { {"family", "icc"}, {"version", __INTEL_COMPILER} };
16859#elif defined(__clang__)
16860 result["compiler"] = { {"family", "clang"}, {"version", __clang_version__} };
16861#elif defined(__GNUC__) || defined(__GNUG__)
16862 result["compiler"] = { {"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)} };
16863#elif defined(__HP_cc) || defined(__HP_aCC)
16864 result["compiler"] = "hp"
16865#elif defined(__IBMCPP__)
16866 result["compiler"] = { {"family", "ilecpp"}, {"version", __IBMCPP__} };
16867#elif defined(_MSC_VER)
16868 result["compiler"] = { {"family", "msvc"}, {"version", _MSC_VER} };
16869#elif defined(__PGI)
16870 result["compiler"] = { {"family", "pgcpp"}, {"version", __PGI} };
16871#elif defined(__SUNPRO_CC)
16872 result["compiler"] = { {"family", "sunpro"}, {"version", __SUNPRO_CC} };
16873#else
16874 result["compiler"] = { {"family", "unknown"}, {"version", "unknown"} };
16875#endif
16876
16877#ifdef __cplusplus
16878 result["compiler"]["c++"] = std::to_string(__cplusplus);
16879#else
16880 result["compiler"]["c++"] = "unknown";
16881#endif
16882 return result;
16883 }
16884
16885
16886 ///////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected