X-Git-Url: https://vaikene.ee/gitweb/pswgen09.html?a=blobdiff_plain;ds=sidebyside;f=src%2Flibs%2FPlugins%2Fpluginmanager.h;h=e56092225030843e3a7be50e38f1ff8e2b207990;hb=7e6c580d1324e48375638b5f9ccbab4bff90f049;hp=2f320f97b54d0eab2ce57ccae5256976686e8846;hpb=441d1b38e0900f56891f495a94a08dc8d48e0a32;p=evaf
diff --git a/src/libs/Plugins/pluginmanager.h b/src/libs/Plugins/pluginmanager.h
index 2f320f9..e560922 100644
--- a/src/libs/Plugins/pluginmanager.h
+++ b/src/libs/Plugins/pluginmanager.h
@@ -1,5 +1,5 @@
/**
- * @file plugins/pluginmanager.h
+ * @file Plugins/pluginmanager.h
* @brief Manager for loadable modules (plugins)
*
* Copyright (c) 2011 Enar Vaikene
@@ -24,6 +24,9 @@
#include
#include
+#include
+
+namespace eVaf {
/**
* Library for managing loadable modules (plugins).
@@ -44,6 +47,31 @@ namespace Internal {
class PluginManagerPrivate;
}
+/**
+ * Expands plugin names for the selected platform.
+ * @param name Name of the plugin
+ * @return Expanded plugin name
+ *
+ * This function expands the plugin name so that it becomes valid for the selected platform.
+ * For example, on Linux it adds the prefix "lib" to the beginning and extension ".so" to the end.
+ */
+inline QString expandPluginName(QString const & name)
+{
+#ifdef Q_OS_WIN32
+# ifdef Q_CC_MINGW
+ return "lib" + name + ".dll";
+# else
+ return name + ".dll";
+# endif
+#elif defined Q_OS_LINUX
+ return "lib" + name + ".so";
+#elif defined Q_OS_CYGWIN
+ return "cyg" + name + ".dll";
+#else
+ return name;
+#endif
+}
+
/**
* Plugin manager for eVaf applications.
*/
@@ -101,11 +129,11 @@ signals:
private:
- Internal::PluginManagerPrivate * dl;
+ Internal::PluginManagerPrivate * d;
};
-} // namespace Plugins
-
+} // namespace eVaf::Plugins
+} // namespace eVaf
#endif // pluginmanager.h