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

Method filePath

src/model/ExternalFile.cpp:112–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110 }
111
112 path ExternalFile_Impl::filePath() const {
113 path result;
114 path fname = toPath(fileName());
115 if (openstudio::filesystem::is_regular_file(fname)) {
116 return fname;
117 }
118 std::vector<path> absoluteFilePaths = this->model().workflowJSON().absoluteFilePaths();
119 if (absoluteFilePaths.empty()) {
120 result = this->model().workflowJSON().absoluteRootDir() / fname;
121 } else {
122 // Loop to find the file in all possible directories in order of preference
123 // (eg goes to hardcoded paths, then potentially generated_files, then files, etc.)
124 for (const openstudio::path& dirpath : absoluteFilePaths) {
125 path p = dirpath / fname;
126 if (openstudio::filesystem::is_regular_file(p)) {
127 result = p;
128 break;
129 }
130 }
131 }
132 return result;
133 }
134
135 //boost::optional<std::string> ExternalFile_Impl::columnSeparator() const {
136 // return getString(OS_External_FileFields::ColumnSeparator,true);

Callers 15

cloneMethod · 0.95
PythonPluginInstanceMethod · 0.80
csvFileMethod · 0.80
translatedFilePathMethod · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 6

absoluteFilePathsMethod · 0.80
workflowJSONMethod · 0.80
absoluteRootDirMethod · 0.80
toPathFunction · 0.50
modelMethod · 0.45
emptyMethod · 0.45

Tested by 7

TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64
TEST_FFunction · 0.64