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
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ the Free Software Foundation; either version 2 of the License, or *

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

.. versionadded:: 3.4
%End

%TypeHeaderCode
#include "qgsserverparameters.h"
Expand All @@ -76,20 +81,38 @@ class QgsServerParameter : QgsServerParameterDefinition
QgsServerParameter( const QgsServerParameter::Name name = QgsServerParameter::UNKNOWN,
const QVariant::Type type = QVariant::String,
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;
%Docstring
Raises an error in case of an invalid conversion.
\throws QgsBadRequestException Invalid parameter exception
%End

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 );
%Docstring
Converts a string into a parameter's name (UNKNOWN in case of an
invalid string).
%End

QgsServerParameter::Name mName;
};

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

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

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

public:
//! Parameter's name common to all services
enum Name
{
UNKNOWN,
Expand All @@ -72,21 +79,40 @@ class SERVER_EXPORT QgsServerParameter : public QgsServerParameterDefinition
};
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,
const QVariant::Type type = QVariant::String,
const QVariant defaultValue = QVariant( "" ) );

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

/**
* Converts a parameter's name into its string representation.
*/
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 );

QgsServerParameter::Name mName;
};

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

0 comments on commit 3e00b10

Please sign in to comment.