diff --git a/include/openPMD/version.hpp b/include/openPMD/version.hpp index e9748b3939..b976da1c91 100644 --- a/include/openPMD/version.hpp +++ b/include/openPMD/version.hpp @@ -86,7 +86,10 @@ std::string getVersion(); * * @return std::string openPMD standard version (dot separated) */ -std::string getStandard(); +[[deprecated( + "Deprecated due to unclear semantics. Use one of getStandardMinimum, " + "getStandardMaximum() or getStandardDefault instead.")]] std::string +getStandard(); /** Return the default used version of the openPMD standard (read & write, * run-time) @@ -102,6 +105,13 @@ std::string getStandardDefault(); */ std::string getStandardMinimum(); +/** Return the minimum supported version of the openPMD standard (read, + * run-time) + * + * @return std::string minimum openPMD standard version (dot separated) + */ +std::string getStandardMaximum(); + /** Return the feature variants of the openPMD-api library (run-time) * * @return std::map< std::string, bool > with variants such as backends diff --git a/src/version.cpp b/src/version.cpp index 1f89156695..78f09ca733 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -35,10 +35,7 @@ std::string openPMD::getVersion() std::string openPMD::getStandard() { - std::stringstream standard; - standard << OPENPMD_STANDARD_MAJOR << "." << OPENPMD_STANDARD_MINOR << "." - << OPENPMD_STANDARD_PATCH; - return standard.str(); + return getStandardMaximum(); } std::string openPMD::getStandardDefault() @@ -58,3 +55,11 @@ std::string openPMD::getStandardMinimum() << OPENPMD_STANDARD_MIN_PATCH; return standardMin.str(); } + +std::string openPMD::getStandardMaximum() +{ + std::stringstream standard; + standard << OPENPMD_STANDARD_MAJOR << "." << OPENPMD_STANDARD_MINOR << "." + << OPENPMD_STANDARD_PATCH; + return standard.str(); +} diff --git a/test/CoreTest.cpp b/test/CoreTest.cpp index 7c119ca0b6..d27d68a8c5 100644 --- a/test/CoreTest.cpp +++ b/test/CoreTest.cpp @@ -1,6 +1,4 @@ // expose private and protected members for invasive testing -#include "openPMD/Datatype.hpp" -#include "openPMD/Error.hpp" #if openPMD_USE_INVASIVE_TESTS #define OPENPMD_private public: #define OPENPMD_protected public: @@ -39,7 +37,7 @@ TEST_CASE("versions_test", "[core]") auto const standardDefault = getStandardDefault(); REQUIRE(standardDefault == "1.1.0"); - auto const standard = getStandard(); + auto const standard = getStandardMaximum(); REQUIRE(standard == "2.0.0"); auto const standardMin = getStandardMinimum();