DtLgrDynamicLibrary provides an operating independent way to manipulate dynamically loaded libraries. More...
Collaboration diagram for MAKLogger::DtLgrDynamicLibrary:Public Member Functions | |
| DtLgrDynamicLibrary (const DtString &libName, bool addPlatExt=true, bool useLazyEval=true) | |
| Constructs an instance of DtLgrDynamicLibrary for libname. | |
| bool | isValid () const |
| returns true if this library is valid and open. | |
| DtString | libraryName () const |
| returns the final library name which was opened (or attempted to open). | |
| const char * | error () const |
| returns the last error reported. | |
| virtual void * | procAddress (const DtString &symName) |
| Returns a pointer to the requested function found in the dynamic library libHandle. | |
Static Public Member Functions | |
| static DtString | standardExtension () |
| Returns the standard dynamic extension for this platform. | |
| static DtString | standardPrefix () |
| Returns a standard prefix for libraries on this platform. | |
Protected Attributes | |
| void * | myHandle |
| DtString | myLibraryName |
| char * | myLastError |
DtLgrDynamicLibrary provides an operating independent way to manipulate dynamically loaded libraries.
| MAKLogger::DtLgrDynamicLibrary::DtLgrDynamicLibrary | ( | const DtString & | libName, |
| bool | addPlatExt = true, |
||
| bool | useLazyEval = true |
||
| ) |
Constructs an instance of DtLgrDynamicLibrary for libname.
The library will be opened using lazyEvaluation if possible when the useLazyEval flag is set to true.
| const char* MAKLogger::DtLgrDynamicLibrary::error | ( | ) | const |
returns the last error reported.
This is reset each time procAddress is called. A return value of NULL indicates that the operation succeeded.
| bool MAKLogger::DtLgrDynamicLibrary::isValid | ( | ) | const |
returns true if this library is valid and open.
returns false if an error has occurred. Not virtual because it is called from the CTOR. To get a human readable error message call error(). Once a library is invalid, it will always be invalid.
| DtString MAKLogger::DtLgrDynamicLibrary::libraryName | ( | ) | const |
returns the final library name which was opened (or attempted to open).
The string will include the platform extension which may have been added when this object was constructed.
| virtual void* MAKLogger::DtLgrDynamicLibrary::procAddress | ( | const DtString & | symName | ) | [virtual] |
Returns a pointer to the requested function found in the dynamic library libHandle.
If no matching symbol is found null is returned, it is possible for NULL to be a valid matching symbol on some platforms. The correct way to check for an error is to look at the return value from error(). If an error has occurred the result of error() will be non NULL.
| static DtString MAKLogger::DtLgrDynamicLibrary::standardPrefix | ( | ) | [static] |
Returns a standard prefix for libraries on this platform.
For example, linux prefixes "lib" to library names.