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

Method findPluginClassNameInFile

src/model/PythonPluginInstance.cpp:108–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106 }
107
108 bool PythonPluginInstance_Impl::findPluginClassNameInFile(const std::string& pluginClassName) const {
109 auto validClassNames = validPluginClassNamesInFile();
110 auto it = std::find(validClassNames.cbegin(), validClassNames.cend(), pluginClassName);
111 if (it == validClassNames.cend()) {
112 std::stringstream ss;
113 ss << "[";
114 bool firstTime = true;
115 for (const auto& className : validClassNames) {
116 if (firstTime) {
117 ss << "\"" << className << "\"";
118 firstTime = false;
119 } else {
120 ss << ", \"" << className << "\"";
121 }
122 }
123 ss << "]";
124 LOG(Warn, pluginClassName << " not found. validClassNames=" << ss.str());
125 return false;
126 }
127
128 return true;
129 }
130
131 std::vector<std::string> PythonPluginInstance_Impl::validPluginClassNamesInFile() const {
132 std::vector<std::string> result;

Callers 1

Calls 3

cbeginMethod · 0.80
cendMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected