summaryrefslogtreecommitdiffstats
path: root/xbmc/cores/DllLoader/LibraryLoader.h
diff options
context:
space:
mode:
Diffstat (limited to 'xbmc/cores/DllLoader/LibraryLoader.h')
-rw-r--r--xbmc/cores/DllLoader/LibraryLoader.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/xbmc/cores/DllLoader/LibraryLoader.h b/xbmc/cores/DllLoader/LibraryLoader.h
new file mode 100644
index 0000000..a8db986
--- /dev/null
+++ b/xbmc/cores/DllLoader/LibraryLoader.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2005-2018 Team Kodi
+ * This file is part of Kodi - https://kodi.tv
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ * See LICENSES/README.md for more information.
+ */
+
+#pragma once
+
+#include <string>
+
+#ifdef TARGET_POSIX
+#include "PlatformDefs.h"
+#endif
+
+class LibraryLoader
+{
+public:
+ explicit LibraryLoader(const std::string& libraryFile);
+ virtual ~LibraryLoader();
+
+ virtual bool Load() = 0;
+ virtual void Unload() = 0;
+
+ virtual int ResolveExport(const char* symbol, void** ptr, bool logging = true) = 0;
+ virtual int ResolveOrdinal(unsigned long ordinal, void** ptr);
+ virtual bool IsSystemDll() = 0;
+ virtual HMODULE GetHModule() = 0;
+ virtual bool HasSymbols() = 0;
+
+ const char *GetName() const; // eg "mplayer.dll"
+ const char *GetFileName() const; // "special://xbmcbin/system/mplayer/players/mplayer.dll"
+ const char *GetPath() const; // "special://xbmcbin/system/mplayer/players/"
+
+ int IncrRef();
+ int DecrRef();
+ int GetRef();
+
+private:
+ LibraryLoader(const LibraryLoader&);
+ LibraryLoader& operator=(const LibraryLoader&);
+ std::string m_fileName;
+ std::string m_path;
+ int m_iRefCount;
+};