MCPcopy Create free account
hub / github.com/city-super/Octree-GS / string getInstallDirectory

Method string getInstallDirectory

SIBR_viewers/src/core/system/Utils.cpp:324–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

322 }
323
324 SIBR_SYSTEM_EXPORT std::string getInstallDirectory()
325 {
326 char exePath[4095];
327
328#ifdef SIBR_OS_WINDOWS
329 unsigned int len = GetModuleFileNameA(GetModuleHandleA(0x0), exePath, MAX_PATH);
330
331 std::string installDirectory = parentDirectory(parentDirectory(exePath));
332#else
333 unsigned int len=0;
334
335 char result[PATH_MAX];
336 ssize_t c = readlink("/proc/self/exe", result, PATH_MAX);
337 len = c;
338 const char* path;
339 if( c != -1 )
340 path = dirname(result);
341 else
342 SIBR_ERR << "Cant find executable path "<< std::endl;
343
344
345 std::string installDirectory(parentDirectory(path));
346#endif
347
348 if (len == 0 &&
349 !directoryExists(installDirectory + "/bin")) // memory not sufficient or general error occured
350 {
351 SIBR_ERR << "Can't find install folder! Please specify as command-line option using --appPath option!" << std::endl;
352 }
353 return installDirectory;
354 }
355
356 SIBR_SYSTEM_EXPORT std::string getBinDirectory()
357 {

Callers

nothing calls this directly

Calls 2

parentDirectoryFunction · 0.85
directoryExistsFunction · 0.85

Tested by

no test coverage detected