MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / modelicaPackages

Method modelicaPackages

src/utilities/filetypes/WorkflowJSON.cpp:615–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613 }
614
615 std::vector<openstudio::path> WorkflowJSON_Impl::modelicaPackages() const {
616 std::vector<openstudio::path> result;
617 const Json::Value& packages = m_value.get("modelica_packages", Json::Value());
618
619 auto appendIfValid = [&result](const Json::Value& value) {
620 if (value.isString()) {
621 const std::string str = value.asString();
622 if (!str.empty()) {
623 result.push_back(toPath(str));
624 }
625 }
626 };
627
628 if (packages.isArray()) {
629 for (const auto& entry : packages) {
630 appendIfValid(entry);
631 }
632 } else {
633 appendIfValid(packages);
634 }
635
636 return result;
637 }
638
639 bool WorkflowJSON_Impl::setModelicaPackages(const std::vector<openstudio::path>& packages) {
640 if (packages.empty()) {

Callers 1

getModelicaSetupFunction · 0.80

Calls 5

ValueClass · 0.70
toPathFunction · 0.50
getMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected