| 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()) { |