carb::extras::getLibraryDirectory

Defined in carb/extras/Library.h

inline std::string carb::extras::getLibraryDirectory(void *symbolAddress)

Retrieves the parent directory of the library containing a given address or symbol.

Parameters

symbolAddress[in] The address of the symbol to find the library file name for. This may be a symbol returned from a previous call to getLibrarySymbol() or another known symbol in the library. This does not strictly need to be an exported symbol from the library, just an address within that library’s memory space.

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.