Skip to content
Permalink
Browse files

Add string output type

  • Loading branch information
nyalldawson committed Jun 13, 2017
1 parent b45e572 commit 020537ac7e5192097592aa75c258782673fd79a8
@@ -36,6 +36,8 @@ class QgsProcessingOutputDefinition
sipType = sipType_QgsProcessingOutputHtml;
else if ( sipCpp->type() == "outputNumber" )
sipType = sipType_QgsProcessingOutputNumber;
else if ( sipCpp->type() == "outputString" )
sipType = sipType_QgsProcessingOutputString;
%End
public:

@@ -184,6 +186,27 @@ class QgsProcessingOutputNumber : QgsProcessingOutputDefinition
virtual QString type() const;
};

class QgsProcessingOutputString : QgsProcessingOutputDefinition
{
%Docstring
A string output for processing algorithms.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsprocessingoutputs.h"
%End
public:

QgsProcessingOutputString( const QString &name, const QString &description = QString() );
%Docstring
Constructor for QgsProcessingOutputString.
%End

virtual QString type() const;
};




/************************************************************************
@@ -50,3 +50,7 @@ QgsProcessingOutputHtml::QgsProcessingOutputHtml( const QString &name, const QSt
QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description )
: QgsProcessingOutputDefinition( name, description )
{}

QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QString &description )
: QgsProcessingOutputDefinition( name, description )
{}
@@ -51,6 +51,8 @@ class CORE_EXPORT QgsProcessingOutputDefinition
sipType = sipType_QgsProcessingOutputHtml;
else if ( sipCpp->type() == "outputNumber" )
sipType = sipType_QgsProcessingOutputNumber;
else if ( sipCpp->type() == "outputString" )
sipType = sipType_QgsProcessingOutputString;
SIP_END
#endif

@@ -197,6 +199,25 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti
QString type() const override { return QStringLiteral( "outputNumber" ); }
};

/**
* \class QgsProcessingOutputString
* \ingroup core
* A string output for processing algorithms.
* \since QGIS 3.0
*/
class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefinition
{
public:

/**
* Constructor for QgsProcessingOutputString.
*/
QgsProcessingOutputString( const QString &name, const QString &description = QString() );

QString type() const override { return QStringLiteral( "outputString" ); }
};


#endif // QGSPROCESSINGOUTPUTS_H


0 comments on commit 020537a

Please sign in to comment.
You can’t perform that action at this time.