| 95 | } |
| 96 | |
| 97 | bool checkVersionMatch(json const &epJSON) |
| 98 | { |
| 99 | auto it = epJSON.find("Version"); |
| 100 | if (it != epJSON.end()) { |
| 101 | for (auto const &version : it.value()) { |
| 102 | std::string v = version["version_identifier"].get<std::string>(); |
| 103 | if (v.empty()) { |
| 104 | displayMessage("Input errors occurred and version ID was left blank, verify file version"); |
| 105 | } else { |
| 106 | std::string::size_type const lenVer(len(EnergyPlus::DataStringGlobals::MatchVersion)); |
| 107 | int Which; |
| 108 | if ((lenVer > 0) && (EnergyPlus::DataStringGlobals::MatchVersion[lenVer - 1] == '0')) { |
| 109 | Which = static_cast<int>(index(v.substr(0, lenVer - 2), EnergyPlus::DataStringGlobals::MatchVersion.substr(0, lenVer - 2))); |
| 110 | } else { |
| 111 | Which = static_cast<int>(index(v, EnergyPlus::DataStringGlobals::MatchVersion)); |
| 112 | } |
| 113 | if (Which != 0) { |
| 114 | displayMessage(R"(Version: in IDF="{}" not the same as expected="{}")", v, EnergyPlus::DataStringGlobals::MatchVersion); |
| 115 | return false; |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | return true; |
| 121 | } |
| 122 | |
| 123 | bool checkForUnsupportedObjects(json const &epJSON, bool convertHVACTemplate) |
| 124 | { |
no test coverage detected