blob: 097f5b069ae22b39b8bb48e391294116aa3d081d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
// license:GPL-2.0+
// copyright-holders:Couriersud
/*
* pstring.h
*/
#ifndef PDYNLIB_H_
#define PDYNLIB_H_
#include <cstdarg>
#include <cstddef>
#include "pconfig.h"
#include "pstring.h"
namespace plib {
// ----------------------------------------------------------------------------------------
// pdynlib: dynamic loading of libraries ...
// ----------------------------------------------------------------------------------------
class dynlib
{
public:
explicit dynlib(const pstring libname);
dynlib(const pstring path, const pstring libname);
~dynlib();
bool isLoaded() const;
template <typename T>
T getsym(const pstring name)
{
return reinterpret_cast<T>(getsym_p(name));
}
private:
void *getsym_p(const pstring name);
bool m_isLoaded;
void *m_lib;
};
}
#endif /* PSTRING_H_ */
|