MCPcopy Create free account
hub / github.com/NatLabRockies/EnergyPlus / checkVersionMatch

Function checkVersionMatch

src/ConvertInputFormat/main.cpp:97–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95}
96
97bool 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
123bool checkForUnsupportedObjects(json const &epJSON, bool convertHVACTemplate)
124{

Callers 2

processInputMethod · 0.85
processInputFunction · 0.85

Calls 2

displayMessageFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected