MCPcopy Create free account
hub / github.com/MrNeRF/LichtFeld-Studio / containsLichtfeldModule

Function containsLichtfeldModule

tests/test_python_integration.cpp:226–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

224 }
225
226 bool containsLichtfeldModule(const std::filesystem::path& dir) {
227 std::error_code ec;
228 if (!std::filesystem::exists(dir, ec)) {
229 return false;
230 }
231
232 for (std::filesystem::directory_iterator it(dir, ec), end; !ec && it != end; it.increment(ec)) {
233 std::error_code file_ec;
234 if (!it->is_regular_file(file_ec) || file_ec) {
235 continue;
236 }
237
238 const auto filename = it->path().filename().string();
239 const auto ext = it->path().extension().string();
240 if ((ext == ".so" || ext == ".pyd") && filename.rfind("lichtfeld", 0) == 0) {
241 return true;
242 }
243 }
244
245 return false;
246 }
247
248 std::filesystem::path findPythonModuleDir() {
249 std::error_code ec;

Callers 1

findPythonModuleDirFunction · 0.85

Calls 2

stringMethod · 0.80
incrementMethod · 0.45

Tested by

no test coverage detected