MCPcopy Create free account
hub / github.com/Rat431/ColdAPI_Steam / DynamicLibrary

Class DynamicLibrary

src/ColdAPI_Steam/public SDK/POSIXLibrary.h:20–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18#include <dlfcn.h>
19
20class DynamicLibrary
21{
22public:
23 DynamicLibrary(const char* cszPath)
24 {
25 m_handle = dlopen(cszPath, RTLD_LAZY);
26 }
27
28 ~DynamicLibrary()
29 {
30 if(m_handle)
31 dlclose(m_handle);
32 }
33
34 void * GetSymbol(const char* cszSymbol) const
35 {
36 if(!m_handle)
37 return NULL;
38
39 return dlsym(m_handle, cszSymbol);
40 }
41
42 bool IsLoaded() const
43 {
44 return m_handle != NULL;
45 }
46
47private:
48 void *m_handle;
49
50 DynamicLibrary(const DynamicLibrary&);
51 void operator=(const DynamicLibrary&);
52};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected