Procházet zdrojové kódy

Added ctkLogStream operator<< for ctkPlugin.

Sascha Zelzer před 14 roky
rodič
revize
e01f05a5e8

+ 11 - 0
Libs/PluginFramework/ctkPlugin.cpp

@@ -366,3 +366,14 @@ QDebug operator<<(QDebug debug, ctkPlugin const * plugin)
 {
   return operator<<(debug, *plugin);
 }
+
+ctkLogStream& operator<<(ctkLogStream& stream, ctkPlugin const * plugin)
+{
+  stream << plugin->getSymbolicName();
+  return stream;
+}
+
+ctkLogStream& operator<<(ctkLogStream& stream, const QSharedPointer<ctkPlugin>& plugin)
+{
+  return operator<<(stream, plugin.data());
+}

+ 4 - 0
Libs/PluginFramework/ctkPlugin.h

@@ -27,6 +27,7 @@
 #include <QMetaType>
 
 #include "ctkVersion.h"
+#include "service/log/ctkLogStream.h"
 
 class ctkPluginContext;
 class ctkPluginArchive;
@@ -675,4 +676,7 @@ CTK_PLUGINFW_EXPORT QDebug operator<<(QDebug debug, ctkPlugin::State state);
 CTK_PLUGINFW_EXPORT QDebug operator<<(QDebug debug, const ctkPlugin& plugin);
 CTK_PLUGINFW_EXPORT QDebug operator<<(QDebug debug, ctkPlugin const * plugin);
 
+CTK_PLUGINFW_EXPORT ctkLogStream& operator<<(ctkLogStream& stream, ctkPlugin const * plugin);
+CTK_PLUGINFW_EXPORT ctkLogStream& operator<<(ctkLogStream& stream, const QSharedPointer<ctkPlugin>& plugin);
+
 #endif // CTKPLUGIN_H