MyGUI 3.4.3
MyGUI_DynLib.h
Go to the documentation of this file.
1/*
2 * This source file is part of MyGUI. For the latest info, see http://mygui.info/
3 * Distributed under the MIT License
4 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5 */
6
7#ifndef MYGUI_DYNLIB_H_
8#define MYGUI_DYNLIB_H_
9
10#include "MyGUI_Prerequest.h"
11#include <string>
12
13
14#if MYGUI_PLATFORM == MYGUI_PLATFORM_WIN32
15 #define MYGUI_DYNLIB_HANDLE hInstance
16struct HINSTANCE__;
17typedef struct HINSTANCE__* hInstance;
18#elif MYGUI_PLATFORM == MYGUI_PLATFORM_LINUX
19 #define MYGUI_DYNLIB_HANDLE void*
20#elif MYGUI_PLATFORM == MYGUI_PLATFORM_APPLE
21 #include <CoreFoundation/CFBundle.h>
22 #define MYGUI_DYNLIB_HANDLE CFBundleRef
23#endif
24
25namespace MyGUI
26{
27
35 {
36 friend class DynLibManager;
37
38 protected:
39 DynLib(std::string_view name);
40
41 public:
44 bool load();
45
48 void unload();
49
51 const std::string& getName() const;
52
61 void* getSymbol(const char* strName) const noexcept;
62
63 protected:
65 std::string dynlibError() const;
66
67 protected:
69 std::string mName;
70
73 };
74
75} // namespace MyGUI
76
77#endif // MYGUI_DYNLIB_H_
#define MYGUI_DYNLIB_HANDLE
#define MYGUI_EXPORT
void * getSymbol(const char *strName) const noexcept
DynLib(std::string_view name)
friend class DynLibManager
const std::string & getName() const
Get the name of the library.
std::string mName
Name of library.
std::string dynlibError() const
Gets the last loading error.
void * mInstance
Handle to the loaded library.