OpenTTD Source 20241224-master-gee860a5c8e
|
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. | |
std::string | GetLastError () |
Get the last error that occurred while loading the library or a function. | |
Function | GetFunction (const std::string &symbol_name) |
Get a function from a loaded library. | |
Private Member Functions | |
void * | OpenLibrary (const std::string &filename) |
Open the library with the given filename. | |
void | CloseLibrary () |
Close the library. | |
void * | GetSymbol (const std::string &symbol_name) |
Get a symbol from the library. | |
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.
|
inlineexplicit |
Load a library with the given filename.
Definition at line 37 of file library_loader.h.
References handle, and OpenLibrary().
|
inline |
Close the library.
Definition at line 45 of file library_loader.h.
References CloseLibrary(), and handle.
|
private |
Close the library.
Definition at line 49 of file library_loader_unix.cpp.
References handle.
Referenced by ~LibraryLoader().
|
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().
|
private |
The last error that occurred, if set.
Definition at line 108 of file library_loader.h.
Referenced by GetFunction(), GetLastError(), GetSymbol(), HasError(), and OpenLibrary().
|
private |
Handle to the library.
Definition at line 109 of file library_loader.h.
Referenced by CloseLibrary(), GetSymbol(), LibraryLoader(), and ~LibraryLoader().