carb::extras::getLibraryDirectoryByHandle

Defined in carb/extras/Library.h

inline std::string carb::extras::getLibraryDirectoryByHandle(LibraryHandle handle)

Retrieves the parent directory of a library.

Parameters

handle[in] The handle to the loaded library to retrieve the directory for. This must be a handle that was previously returned from loadLibrary() and has not yet been unloaded. This may be nullptr to retrieve the directory of the process’s main executable.

Returns

A string containing the name and path of the directory that contains the library that the symbol belongs to if found. This path components in this string will always be delimited by ‘/’ and the string will always be UTF-8 encoded. The trailing path separator will always be removed.

Returns

An empty string if the requested address is not a part of a loaded library.