40#ifndef _DYNAMIC_LIBRARY_H
41#define _DYNAMIC_LIBRARY_H
52typedef void* ( *FunctionPointer )( ... );
86 const char* lib_name_arg,
88 bool searchLibPath =
false,
89 bool tryStandardExtensions =
false,
90 bool matchVersion =
false );
106 static DISTI_EXPORT
bool Exists(
const char* libName,
bool tryStandardExtensions =
true );
110 static DISTI_EXPORT std::string
Find(
const std::string& name );
113 virtual DISTI_EXPORT
bool Loaded()
const;
130 bool _tryStandardExtensions;
136 DISTI_EXPORT
void SetErrorString(
const char* );
147 static bool FoundOnSystem(
const std::string& libname );
152 static LibHandle_t Open(
const std::string& libpath,
ErrorEnum& errorCode ,
bool searchLibPath =
true,
bool matchVersion =
false,
bool quiet =
false );
Definition: dynamic_library.h:58
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:71
ErrorEnum
Definition: dynamic_library.h:62
@ ERROR_UNKNOWN
Load failed for unknown reason (see DynamicLibrary::ErrorString())
Definition: dynamic_library.h:65
@ ERROR_VERSION_MISMATCH
Load failed due to incompatible GL Studio or compiler versions.
Definition: dynamic_library.h:64
virtual ~DynamicLibrary()
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.
Force inclusion of the DirectShow library.
Definition: bmpimage.h:47
void *(* FunctionPointer)(...)
Typedef for a function pointer taking variadic arguments.
Definition: dynamic_library.h:52