Selaa lähdekoodia

Added ctkLogStream operator<< for ctkPlugin.

Sascha Zelzer 14 vuotta sitten
vanhempi
commit
e01f05a5e8
2 muutettua tiedostoa jossa 15 lisäystä ja 0 poistoa
  1. 11 0
      Libs/PluginFramework/ctkPlugin.cpp
  2. 4 0
      Libs/PluginFramework/ctkPlugin.h

+ 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