39#ifndef INCLUDED_DISTI_DYNAMIC_LIBRARY_H
40#define INCLUDED_DISTI_DYNAMIC_LIBRARY_H
52typedef void* ( *FunctionPointer )( ... );
80 DISTI_EXPORT
DynamicLibrary(
const char* lib_name_arg,
bool quiet =
false,
bool searchLibPath =
false,
bool tryStandardExtensions =
false,
bool matchVersion =
false );
94 static DISTI_EXPORT
bool Exists(
const char* libName,
bool tryStandardExtensions =
true );
98 static DISTI_EXPORT std::string
Find(
const std::string& name );
101 virtual DISTI_EXPORT
bool Loaded()
const;
118 bool _tryStandardExtensions;
124 DISTI_EXPORT
void SetErrorString(
const char* );
132 static bool FoundOnSystem(
const std::string& libname );
135 static LibHandle_t Open(
const std::string& libpath,
ErrorEnum& errorCode ,
bool searchLibPath =
true,
bool matchVersion =
false,
bool quiet =
false );
The DynamicLibrary class. A cross-platform class for loading dynamic link libraries and shared object...
Definition: dynamic_library.h:56
virtual bool Loaded() const
const char * ErrorString() const
static void RemoveExtension(std::string &libpath)
DynamicLibrary(const char *lib_name_arg, bool quiet=false, bool searchLibPath=false, bool tryStandardExtensions=false, bool matchVersion=false)
void * LibHandle_t
Linux, macOS, and others use a pointer to the opened dynamic library.
Definition: dynamic_library.h:69
ErrorEnum
Definition: dynamic_library.h:60
@ ERROR_UNKNOWN
Load failed for unknown reason (see DynamicLibrary::ErrorString())
Definition: dynamic_library.h:63
@ ERROR_VERSION_MISMATCH
Load failed due to incompatible GL Studio or compiler versions.
Definition: dynamic_library.h:62
virtual ~DynamicLibrary()
Destructor for dynamic library object. Closes the library so the OS can cleanup.
static bool Exists(const char *libName, bool tryStandardExtensions=true)
virtual FunctionPointer DynamicFunction(const char *function_name)
ErrorEnum LastError() const
static std::string Find(const std::string &name)
A file for all GL Studio files to include.
Definition: bmpimage.h:46
void *(* FunctionPointer)(...)
Typedef for a function pointer taking variadic arguments.
Definition: dynamic_library.h:52