| 537 | } |
| 538 | |
| 539 | boost::optional<openstudio::path> WorkflowJSON_Impl::findMeasure(const openstudio::path& measureDir) const { |
| 540 | // if absolute check if exists |
| 541 | if (measureDir.is_absolute()) { |
| 542 | if (boost::filesystem::exists(measureDir)) { |
| 543 | return measureDir; |
| 544 | } |
| 545 | |
| 546 | // absolute path does not exist |
| 547 | return boost::none; |
| 548 | } |
| 549 | |
| 550 | for (const auto& path : absoluteMeasurePaths()) { |
| 551 | openstudio::path p = path / measureDir; |
| 552 | if (boost::filesystem::exists(p) && boost::filesystem::is_directory(p)) { |
| 553 | return canonicalOrAbsolute(p); |
| 554 | } |
| 555 | } |
| 556 | return boost::none; |
| 557 | } |
| 558 | |
| 559 | boost::optional<openstudio::path> WorkflowJSON_Impl::findMeasure(const std::string& measureDirName) const { |
| 560 | return findMeasure(toPath(measureDirName)); |