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

Method findMeasure

src/utilities/filetypes/WorkflowJSON.cpp:539–557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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));

Callers 2

TESTFunction · 0.80
applyMeasuresMethod · 0.80

Calls 2

canonicalOrAbsoluteFunction · 0.85
toPathFunction · 0.50

Tested by 1

TESTFunction · 0.64