Commit dd45ba6f by Niels Lohmann

🚧 renamed `version()` to `meta()`

parent e1b89dd1
...@@ -284,11 +284,11 @@ class basic_json ...@@ -284,11 +284,11 @@ class basic_json
/*! /*!
@brief returns version information on the library @brief returns version information on the library
*/ */
static basic_json version() static basic_json meta()
{ {
basic_json result; basic_json result;
result["copyright"] = "(C) 2013-2016 Niels Lohmann"; result["copyright"] = "(C) 2013-2017 Niels Lohmann";
result["name"] = "JSON for Modern C++"; result["name"] = "JSON for Modern C++";
result["url"] = "https://github.com/nlohmann/json"; result["url"] = "https://github.com/nlohmann/json";
result["version"] = result["version"] =
...@@ -312,11 +312,11 @@ class basic_json ...@@ -312,11 +312,11 @@ class basic_json
#endif #endif
#if defined(__clang__) #if defined(__clang__)
result["compiler"] = {{"family", "clang"}, {"version", CLANG_VERSION}}; result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}};
#elif defined(__ICC) || defined(__INTEL_COMPILER) #elif defined(__ICC) || defined(__INTEL_COMPILER)
result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}};
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
result["compiler"] = {{"family", "gcc"}, {"version", GCC_VERSION}}; result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}};
#elif defined(__HP_cc) || defined(__HP_aCC) #elif defined(__HP_cc) || defined(__HP_aCC)
result["compiler"] = "hp" result["compiler"] = "hp"
#elif defined(__IBMCPP__) #elif defined(__IBMCPP__)
......
...@@ -284,11 +284,11 @@ class basic_json ...@@ -284,11 +284,11 @@ class basic_json
/*! /*!
@brief returns version information on the library @brief returns version information on the library
*/ */
static basic_json version() static basic_json meta()
{ {
basic_json result; basic_json result;
result["copyright"] = "(C) 2013-2016 Niels Lohmann"; result["copyright"] = "(C) 2013-2017 Niels Lohmann";
result["name"] = "JSON for Modern C++"; result["name"] = "JSON for Modern C++";
result["url"] = "https://github.com/nlohmann/json"; result["url"] = "https://github.com/nlohmann/json";
result["version"] = result["version"] =
...@@ -312,11 +312,11 @@ class basic_json ...@@ -312,11 +312,11 @@ class basic_json
#endif #endif
#if defined(__clang__) #if defined(__clang__)
result["compiler"] = {{"family", "clang"}, {"version", CLANG_VERSION}}; result["compiler"] = {{"family", "clang"}, {"version", __clang_version__}};
#elif defined(__ICC) || defined(__INTEL_COMPILER) #elif defined(__ICC) || defined(__INTEL_COMPILER)
result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}}; result["compiler"] = {{"family", "icc"}, {"version", __INTEL_COMPILER}};
#elif defined(__GNUC__) || defined(__GNUG__) #elif defined(__GNUC__) || defined(__GNUG__)
result["compiler"] = {{"family", "gcc"}, {"version", GCC_VERSION}}; result["compiler"] = {{"family", "gcc"}, {"version", std::to_string(__GNUC__) + "." + std::to_string(__GNUC_MINOR__) + "." + std::to_string(__GNUC_PATCHLEVEL__)}};
#elif defined(__HP_cc) || defined(__HP_aCC) #elif defined(__HP_cc) || defined(__HP_aCC)
result["compiler"] = "hp" result["compiler"] = "hp"
#elif defined(__IBMCPP__) #elif defined(__IBMCPP__)
......
...@@ -35,6 +35,7 @@ TEST_CASE("version information") ...@@ -35,6 +35,7 @@ TEST_CASE("version information")
{ {
SECTION("version()") SECTION("version()")
{ {
CHECK(json::version()["name"] == "JSON for Modern C++"); CHECK(json::meta()["name"] == "JSON for Modern C++");
CHECK(json::meta()["compiler"] == "JSON for Modern C++");
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment