OpenTTD Source
20241108-master-g80f628063a
|
Data Structures | |
class | Function |
A function loaded from a library. More... | |
Public Member Functions | |
LibraryLoader (const std::string &filename) | |
Load a library with the given filename. | |
~LibraryLoader () | |
Close the library. | |
bool | HasError () |
Check whether an error occurred while loading the library or a function. More... | |
std::string | GetLastError () |
Get the last error that occurred while loading the library or a function. More... | |
Function | GetFunction (const std::string &symbol_name) |
Get a function from a loaded library. More... | |
Private Member Functions | |
void * | OpenLibrary (const std::string &filename) |
Open the library with the given filename. More... | |
void | CloseLibrary () |
Close the library. | |
void * | GetSymbol (const std::string &symbol_name) |
Get a symbol from the library. More... | |
Private Attributes | |
std::optional< std::string > | error = {} |
The last error that occurred, if set. | |
void * | handle = nullptr |
Handle to the library. | |
Definition at line 13 of file library_loader.h.
|
inline |
Get a function from a loaded library.
symbol_name | The name of the function to get. |
Definition at line 78 of file library_loader.h.
References error, and GetSymbol().
Referenced by VideoDriver_Win32Base::GetDPIScale(), and Win32StringContains().
|
inline |
Get the last error that occurred while loading the library or a function.
Definition at line 67 of file library_loader.h.
References error.
|
private |
Get a symbol from the library.
Should set error if any error occurred.
symbol_name | The name of the symbol to get. |
Definition at line 54 of file library_loader_unix.cpp.
Referenced by GetFunction().
|
inline |
Check whether an error occurred while loading the library or a function.
Definition at line 57 of file library_loader.h.
References error.
|
private |
Open the library with the given filename.
Should set error if any error occurred.
filename | The filename of the library to open. |
Definition at line 39 of file library_loader_unix.cpp.
References error.
Referenced by LibraryLoader().