QGIS API Documentation 3.38.0-Grenoble (exported)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
QgsServerParameter Class Reference

Parameter common to all services (WMS, WFS, ...) More...

#include <qgsserverparameters.h>

Inheritance diagram for QgsServerParameter:
Inheritance graph
[legend]

Public Types

enum  Name {
  UNKNOWN , SERVICE , VERSION_SERVICE , REQUEST ,
  MAP , FILE_NAME
}
 Parameter's name common to all services. More...
 

Public Member Functions

Q_DECL_DEPRECATED QgsServerParameter (const QgsServerParameter::Name name, const QVariant::Type type, const QVariant defaultValue=QVariant("")) SIP_DEPRECATED
 Constructor for QgsServerParameter.
 
 QgsServerParameter (const QgsServerParameter::Name name=QgsServerParameter::UNKNOWN, const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
 Constructor for QgsServerParameter.
 
void raiseError () const
 Raises an error in case of an invalid conversion.
 
- Public Member Functions inherited from QgsServerParameterDefinition
 QgsServerParameterDefinition (const QMetaType::Type type=QMetaType::Type::QString, const QVariant defaultValue=QVariant(""))
 Constructor for QgsServerParameterDefinition.
 
Q_DECL_DEPRECATED QgsServerParameterDefinition (const QVariant::Type type, const QVariant defaultValue=QVariant("")) SIP_DEPRECATED
 Constructor for QgsServerParameterDefinition.
 
virtual ~QgsServerParameterDefinition ()=default
 Default destructor for QgsServerParameterDefinition.
 
virtual bool isValid () const
 Returns true if the parameter is valid, false otherwise.
 
QString loadUrl (bool &ok) const
 Loads the data associated to the parameter converted into an url.
 
bool toBool () const
 Converts the parameter into a boolean.
 
QColor toColor (bool &ok) const
 Converts the parameter into a color.
 
QList< QColor > toColorList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of colors.
 
double toDouble (bool &ok) const
 Converts the parameter into a double.
 
QList< double > toDoubleList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of doubles.
 
QStringList toExpressionList () const
 Converts the parameter into a list of QGIS expressions.
 
QList< QgsGeometrytoGeomList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of geometries.
 
int toInt (bool &ok) const
 Converts the parameter into an integer.
 
QList< int > toIntList (bool &ok, char delimiter=',') const
 Converts the parameter into a list of integers.
 
QStringList toOgcFilterList () const
 Converts the parameter into a list of OGC filters.
 
QgsRectangle toRectangle (bool &ok) const
 Converts the parameter into a rectangle.
 
QString toString (bool defaultValue=false) const
 Converts the parameter into a string.
 
QStringList toStringList (char delimiter=',', bool skipEmptyParts=true) const
 Converts the parameter into a list of strings.
 
QUrl toUrl (bool &ok) const
 Converts the parameter into an url.
 
QString typeName () const
 Returns the type of the parameter as a string.
 

Static Public Member Functions

static QString name (const QgsServerParameter::Name name)
 Converts a parameter's name into its string representation.
 
static QgsServerParameter::Name name (const QString &name)
 Converts a string into a parameter's name (UNKNOWN in case of an invalid string).
 
- Static Public Member Functions inherited from QgsServerParameterDefinition
static void raiseError (const QString &msg)
 Raises an exception in case of an invalid parameters.
 

Public Attributes

QgsServerParameter::Name mName
 
- Public Attributes inherited from QgsServerParameterDefinition
QVariant mDefaultValue
 
QMetaType::Type mType
 
QVariant mValue
 

Detailed Description

Parameter common to all services (WMS, WFS, ...)

Since
QGIS 3.4

Definition at line 200 of file qgsserverparameters.h.

Member Enumeration Documentation

◆ Name

Parameter's name common to all services.

Enumerator
UNKNOWN 
SERVICE 
VERSION_SERVICE 
REQUEST 
MAP 
FILE_NAME 

Definition at line 206 of file qgsserverparameters.h.

Constructor & Destructor Documentation

◆ QgsServerParameter() [1/2]

QgsServerParameter::QgsServerParameter ( const QgsServerParameter::Name  name = QgsServerParameter::UNKNOWN,
const QMetaType::Type  type = QMetaType::Type::QString,
const QVariant  defaultValue = QVariant( "" ) 
)

Constructor for QgsServerParameter.

Parameters
nameThe name of the parameter
typeThe type of the parameter
defaultValueThe default value to use if not defined

Definition at line 420 of file qgsserverparameters.cpp.

◆ QgsServerParameter() [2/2]

QgsServerParameter::QgsServerParameter ( const QgsServerParameter::Name  name,
const QVariant::Type  type,
const QVariant  defaultValue = QVariant( "" ) 
)

Constructor for QgsServerParameter.

Parameters
nameThe name of the parameter
typeThe type of the parameter
defaultValueThe default value to use if not defined
Deprecated:
since QGIS 3.38, use the method with a QMetaType::Type argument instead

Definition at line 427 of file qgsserverparameters.cpp.

Member Function Documentation

◆ name() [1/2]

QString QgsServerParameter::name ( const QgsServerParameter::Name  name)
static

Converts a parameter's name into its string representation.

Definition at line 434 of file qgsserverparameters.cpp.

◆ name() [2/2]

QgsServerParameter::Name QgsServerParameter::name ( const QString &  name)
static

Converts a string into a parameter's name (UNKNOWN in case of an invalid string).

Definition at line 447 of file qgsserverparameters.cpp.

◆ raiseError()

void QgsServerParameter::raiseError ( ) const

Raises an error in case of an invalid conversion.

Exceptions
QgsBadRequestExceptionInvalid parameter exception

Definition at line 460 of file qgsserverparameters.cpp.

Member Data Documentation

◆ mName

QgsServerParameter::Name QgsServerParameter::mName

Definition at line 255 of file qgsserverparameters.h.


The documentation for this class was generated from the following files: