#include <librarysharingmanager.h>
Public Member Functions | ||||
| dtCore::RefPtr< LibraryHandle > | LoadSharedLibrary (const std::string &libName) | |||
| Loads a library based on a system independent name. | ||||
| void | GetSearchPath (std::vector< std::string > &toFill) const | |||
| This class will search a configured list of paths for a library before letting the OS use its search path. | ||||
| const std::string | FindLibraryInSearchPath (const std::string &libraryFileName) const | |||
| ||||
| void | AddToSearchPath (const std::string &newPath) | |||
| Adds a new path to the search path. | ||||
| void | RemoveFromSearchPath (const std::string &path) | |||
| Removes a path from the search path. | ||||
| void | ClearSearchPath () | |||
| Clears the search path completely. | ||||
Static Public Member Functions | ||||
| static LibrarySharingManager & | GetInstance () | |||
| static std::string | GetPlatformSpecificLibraryName (const std::string &libBase) | |||
| Determines which platform we are running on and returns a platform dependent library name. | ||||
| static std::string | GetPlatformIndependentLibraryName (const std::string &libName) | |||
| Strips off the path and platform specific library prefixs and extensions and returns a system independent file name. | ||||
Classes | ||||
| class | ExceptionEnum | |||
| class | LibraryHandle | |||
| pure virtual class abstracting a checked-out handle to a library. More... | ||||
| static LibrarySharingManager& dtUtil::LibrarySharingManager::GetInstance | ( | void | ) | [inline, static] |
| dtCore::RefPtr<LibraryHandle> dtUtil::LibrarySharingManager::LoadSharedLibrary | ( | const std::string & | libName | ) |
Loads a library based on a system independent name.
The class holds onto already opened libraries, so if the library is being used already, a new handle to it will be returned and no system calls will be made.
| libName | the system-independent name of the library to load. |
| dtUtil::Exception | with key dtUtil::LibrarySharingManager::ExceptionEnum::LibraryLoadingError if the library can't be loaded for some reason. |
| void dtUtil::LibrarySharingManager::GetSearchPath | ( | std::vector< std::string > & | toFill | ) | const |
This class will search a configured list of paths for a library before letting the OS use its search path.
This method returns the list. The default list may vary per OS.
| const std::string dtUtil::LibrarySharingManager::FindLibraryInSearchPath | ( | const std::string & | libraryFileName | ) | const |
| the | file name of the library to find. |
| void dtUtil::LibrarySharingManager::AddToSearchPath | ( | const std::string & | newPath | ) |
Adds a new path to the search path.
It will not convert the path to an absolute path, so be careful when using relative ones. It will also not validate that the path exists so that the app won't blow up of a directory is removed that was being added to the list.
| newPath | the new path to add. |
| void dtUtil::LibrarySharingManager::RemoveFromSearchPath | ( | const std::string & | path | ) |
Removes a path from the search path.
| path | the path to remove. |
| void dtUtil::LibrarySharingManager::ClearSearchPath | ( | ) |
Clears the search path completely.
| static std::string dtUtil::LibrarySharingManager::GetPlatformSpecificLibraryName | ( | const std::string & | libBase | ) | [static] |
Determines which platform we are running on and returns a platform dependent library name.
| libBase | Platform independent library name. |
| static std::string dtUtil::LibrarySharingManager::GetPlatformIndependentLibraryName | ( | const std::string & | libName | ) | [static] |
Strips off the path and platform specific library prefixs and extensions and returns a system independent file name.
| libName | The platform specific library name. |