Skip to content

Commit

Permalink
Update doc for QgsServerParameters and QgsServerParameter
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed Jul 23, 2018
1 parent 9e4c3f2 commit 3e00b10
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 4 deletions.
27 changes: 25 additions & 2 deletions python/server/auto_generated/qgsserverparameters.sip.in
Expand Up @@ -55,6 +55,11 @@ the Free Software Foundation; either version 2 of the License, or *


class QgsServerParameter : QgsServerParameterDefinition class QgsServerParameter : QgsServerParameterDefinition
{ {
%Docstring
Parameter common to all services (WMS, WFS, ...)

.. versionadded:: 3.4
%End


%TypeHeaderCode %TypeHeaderCode
#include "qgsserverparameters.h" #include "qgsserverparameters.h"
Expand All @@ -76,20 +81,38 @@ class QgsServerParameter : QgsServerParameterDefinition
QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN, QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN,
const QVariant::Type type = QVariant::String, const QVariant::Type type = QVariant::String,
const QVariant defaultValue = QVariant( "" ) ); const QVariant defaultValue = QVariant( "" ) );
%Docstring
Constructor for QgsServerParameter.

:param name: The name of the parameter
:param type: The type of the parameter
:param defaultValue: The default value to use if not defined
%End


void raiseError() const; void raiseError() const;
%Docstring
Raises an error in case of an invalid conversion.
\throws QgsBadRequestException Invalid parameter exception
%End


static QString name( const QgsServerParameter::Name name ); static QString name( const QgsServerParameter::Name name );
%Docstring
Converts a parameter's name into its string representation.
%End

static QgsServerParameter::Name name( const QString &name ); static QgsServerParameter::Name name( const QString &name );
%Docstring
Converts a string into a parameter's name (UNKNOWN in case of an
invalid string).
%End


QgsServerParameter::Name mName; QgsServerParameter::Name mName;
}; };


class QgsServerParameters class QgsServerParameters
{ {
%Docstring %Docstring
QgsServerParameters provides an interface to retrieve and manipulate QgsServerParameters provides an interface to retrieve and manipulate global parameters received from the client.
global parameters received from the client.


.. versionadded:: 3.4 .. versionadded:: 3.4
%End %End
Expand Down
30 changes: 28 additions & 2 deletions src/server/qgsserverparameters.h
Expand Up @@ -56,11 +56,18 @@ class SERVER_EXPORT QgsServerParameterDefinition
QVariant mDefaultValue; QVariant mDefaultValue;
}; };


/**
* \ingroup server
* \class QgsServerParameter
* \brief Parameter common to all services (WMS, WFS, ...)
* \since QGIS 3.4
*/
class SERVER_EXPORT QgsServerParameter : public QgsServerParameterDefinition class SERVER_EXPORT QgsServerParameter : public QgsServerParameterDefinition
{ {
Q_GADGET Q_GADGET


public: public:
//! Parameter's name common to all services
enum Name enum Name
{ {
UNKNOWN, UNKNOWN,
Expand All @@ -72,21 +79,40 @@ class SERVER_EXPORT QgsServerParameter : public QgsServerParameterDefinition
}; };
Q_ENUM( Name ) Q_ENUM( Name )


/**
* Constructor for QgsServerParameter.
* \param name The name of the parameter
* \param type The type of the parameter
* \param defaultValue The default value to use if not defined
*/
QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN, QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN,
const QVariant::Type type = QVariant::String, const QVariant::Type type = QVariant::String,
const QVariant defaultValue = QVariant( "" ) ); const QVariant defaultValue = QVariant( "" ) );


/**
* Raises an error in case of an invalid conversion.
* \throws QgsBadRequestException Invalid parameter exception
*/
void raiseError() const; void raiseError() const;


/**
* Converts a parameter's name into its string representation.
*/
static QString name( const QgsServerParameter::Name name ); static QString name( const QgsServerParameter::Name name );

/**
* Converts a string into a parameter's name (UNKNOWN in case of an
* invalid string).
*/
static QgsServerParameter::Name name( const QString &name ); static QgsServerParameter::Name name( const QString &name );


QgsServerParameter::Name mName; QgsServerParameter::Name mName;
}; };


/** /**
* QgsServerParameters provides an interface to retrieve and manipulate * \ingroup server
* global parameters received from the client. * \class QgsServerParameters
* \brief QgsServerParameters provides an interface to retrieve and manipulate global parameters received from the client.
* \since QGIS 3.4 * \since QGIS 3.4
*/ */
class SERVER_EXPORT QgsServerParameters class SERVER_EXPORT QgsServerParameters
Expand Down

0 comments on commit 3e00b10

Please sign in to comment.