MCPcopy Create free account
hub / github.com/PDAL/PDAL / dllDir

Function dllDir

pdal/PDALUtils.cpp:480–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478}
479
480std::string dllDir()
481{
482 std::string s;
483
484#ifdef _WIN32
485 HMODULE hm = NULL;
486
487 if (GetModuleHandleEx(
488 GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
489 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
490 (LPCSTR)&dllDir, &hm))
491 {
492#ifdef PDAL_WIN32_STL
493 wchar_t path[MAX_PATH];
494 DWORD cnt = GetModuleFileNameW(hm, path, sizeof(path));
495#else
496 char path[MAX_PATH];
497 DWORD cnt = GetModuleFileNameA(hm, path, sizeof(path));
498#endif
499 if (cnt > 0 && cnt < MAX_PATH)
500 s = FileUtils::fromNative(path);
501 }
502#else
503 Dl_info info;
504 if (dladdr((const void *)dllDir, &info))
505 s = info.dli_fname;
506#endif
507 return FileUtils::getDirectory(s);
508}
509
510
511double computeChamfer(PointViewPtr srcView, PointViewPtr candView)

Callers 1

pluginSearchPathsFunction · 0.85

Calls 2

fromNativeFunction · 0.85
getDirectoryFunction · 0.85

Tested by

no test coverage detected