Update doc for QgsServerParameters and QgsServerParameter

This commit is contained in:
Blottiere Paul 2018-07-20 08:55:29 +01:00
parent 9e4c3f279c
commit 3e00b10cc2
2 changed files with 53 additions and 4 deletions

View File

@ -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"
@ -76,11 +81,30 @@ 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;
}; };
@ -88,8 +112,7 @@ class QgsServerParameter : QgsServerParameterDefinition
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

View File

@ -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,
@ -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