18#ifndef QGSSERVERPARAMETERS_H
19#define QGSSERVERPARAMETERS_H
21#include "qgis_server.h"
71 QString
toString(
bool defaultValue =
false )
const;
79 QStringList
toStringList(
char delimiter =
',',
bool skipEmptyParts =
true )
const;
88 QList<int>
toIntList(
bool &ok,
char delimiter =
',',
bool skipEmptyParts =
true )
const;
97 QList<double>
toDoubleList(
bool &ok,
char delimiter =
',',
bool skipEmptyParts =
true )
const;
106 QList<QColor>
toColorList(
bool &ok,
char delimiter =
',',
bool skipEmptyParts =
true )
const;
115 QList<QgsGeometry>
toGeomList(
bool &ok,
char delimiter =
',',
bool skipEmptyParts =
true )
const;
143 int toInt(
bool &ok )
const;
163 QColor
toColor(
bool &ok )
const;
171 QUrl
toUrl(
bool &ok )
const;
179 QString
loadUrl(
bool &ok )
const;
237 void raiseError() const;
281 void load(
const QUrlQuery &query );
293 void add(
const QString &key,
const QString &
value );
299 void remove(
const QString &key );
312 QString
value(
const QString &key )
const;
322 QMap<QString, QString>
toMap()
const;
336 virtual QString
request()
const;
357 virtual QString
version()
const;
373 QMap<QgsServerParameter::Name, QgsServerParameter> mParameters;
A rectangle specified with double values.
QList< QColor > toColorList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of colors.
QString loadUrl(bool &ok) const
Loads the data associated to the parameter converted into an url.
QUrl toUrl(bool &ok) const
Converts the parameter into an url.
virtual ~QgsServerParameterDefinition()=default
QList< int > toIntList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of integers.
QString toString(bool defaultValue=false) const
Converts the parameter into a string.
bool toBool() const
Converts the parameter into a boolean.
QgsServerParameterDefinition(const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
Constructor for QgsServerParameterDefinition.
QStringList toStringList(char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of strings.
virtual bool isValid() const
Returns true if the parameter is valid, false otherwise.
QString typeName() const
Returns the type of the parameter as a string.
static void raiseError(const QString &msg)
Raises an exception in case of an invalid parameters.
QStringList toExpressionList() const
Converts the parameter into a list of QGIS expressions.
int toInt(bool &ok) const
Converts the parameter into an integer.
QList< QgsGeometry > toGeomList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of geometries.
QColor toColor(bool &ok) const
Converts the parameter into a color.
double toDouble(bool &ok) const
Converts the parameter into a double.
QList< double > toDoubleList(bool &ok, char delimiter=',', bool skipEmptyParts=true) const
Converts the parameter into a list of doubles.
QgsRectangle toRectangle(bool &ok) const
Converts the parameter into a rectangle.
QStringList toOgcFilterList() const
Converts the parameter into a list of OGC filters.
Parameter common to all services (WMS, WFS, ...).
QgsServerParameter::Name mName
QgsServerParameter(const QgsServerParameter::Name name=QgsServerParameter::UNKNOWN, const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
Constructor for QgsServerParameter.
Name
Parameter's name common to all services.
QMap< QString, QString > toMap() const
Returns all parameters in a map.
virtual ~QgsServerParameters()=default
QString map() const
Returns MAP parameter as a string or an empty string if not defined.
QgsServerParameters()
Constructor.
void add(const QString &key, const QString &value)
Adds a parameter.
QString service() const
Returns SERVICE parameter as a string or an empty string if not defined.
virtual QString request() const
Returns REQUEST parameter as a string or an empty string if not defined.
void clear()
Removes all parameters.
QString fileName() const
Returns FILE_NAME parameter as a string or an empty string if not defined.
virtual bool loadParameter(const QString &name, const QString &value)
Loads a parameter with a specific value.
QUrlQuery urlQuery() const
Returns a url query with underlying parameters.
QMap< QString, QString > mUnmanagedParameters
void load(const QUrlQuery &query)
Loads new parameters.
void remove(const QString &key)
Removes a parameter.
virtual QString version() const
Returns VERSION parameter as a string or an empty string if not defined.
QString value(const QString &key) const
Returns the value of a parameter.