QGIS API Documentation
3.10.0-A Coruña (6c816b4204)
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
w
z
+
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
z
Variables
Typedefs
Enumerations
Enumerator
+
Classes
Class List
Class Index
Class Hierarchy
+
Class Members
+
All
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
2
3
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Typedefs
a
c
e
f
g
h
k
l
m
o
p
r
s
t
u
v
w
+
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
+
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Properties
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
y
z
+
Related Functions
a
c
d
e
f
g
i
l
m
n
o
p
q
r
s
t
v
+
Files
File List
+
File Members
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
u
v
w
z
+
Variables
a
b
c
d
e
g
h
i
l
n
o
p
q
r
s
t
u
w
+
Typedefs
a
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
Enumerations
Enumerator
+
Macros
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
w
y
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
src
server
qgsserverquerystringparameter.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsserverquerystringparameter.h - QgsServerQueryStringParameter
3
4
---------------------
5
begin : 10.7.2019
6
copyright : (C) 2019 by Alessandro Pasotti
7
email : elpaso at itopen dot it
8
***************************************************************************
9
* *
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
14
* *
15
***************************************************************************/
16
#ifndef QGSSERVERQUERYSTRINGPARAMETER_H
17
#define QGSSERVERQUERYSTRINGPARAMETER_H
18
19
#include "
qgsserverapicontext.h
"
20
#include "qgis_server.h"
21
#include "
qgis_sip.h
"
22
#include <QString>
23
#include <QVariant>
24
#include <QObject>
25
26
27
#include "nlohmann/json_fwd.hpp"
28
29
#ifndef SIP_RUN
30
using namespace
nlohmann
;
31
#endif
32
33
34
class
QgsServerApiBadRequestException
;
35
36
47
class
SERVER_EXPORT
QgsServerQueryStringParameter
48
{
49
50
Q_GADGET
51
52
#ifndef SIP_RUN
53
typedef
std::function< bool ( const QgsServerApiContext &, QVariant & ) > customValidator;
54
#endif
55
public
:
56
60
enum class
Type
61
{
62
String = QVariant::String,
63
Integer = QVariant::LongLong,
64
Double = QVariant::Double,
65
Boolean = QVariant::Bool,
66
List = QVariant::StringList,
67
};
68
Q_ENUM(
Type
)
69
70
71
80
QgsServerQueryStringParameter
(
const
QString name,
81
bool
required =
false
,
82
Type
type =
QgsServerQueryStringParameter::Type::String
,
83
const
QString &description = QString(),
84
const
QVariant &defaultValue = QVariant() );
85
86
virtual
~
QgsServerQueryStringParameter
();
87
102
virtual
QVariant value(
const
QgsServerApiContext
&context )
const
;
103
104
#ifndef SIP_RUN
105
113
void
setCustomValidator(
const
customValidator &customValidator );
114
118
json data( )
const
;
119
120
#endif
121
125
QString description()
const
;
126
130
static
QString
typeName
(
const
Type
type );
131
135
QString name()
const
;
136
140
void
setDescription(
const
QString &description );
141
142
private
:
143
144
QString mName;
145
bool
mRequired =
false
;
146
Type
mType = Type::String;
147
customValidator mCustomValidator =
nullptr
;
148
QString mDescription;
149
QVariant mDefaultValue;
150
151
friend
class
TestQgsServerQueryStringParameter;
152
153
};
154
155
#endif // QGSSERVERQUERYSTRINGPARAMETER_H
QgsServerQueryStringParameter::Type::String
QgsServerQueryStringParameter
The QgsServerQueryStringParameter class holds the information regarding a query string input paramete...
Definition:
qgsserverquerystringparameter.h:47
typeName
const QString & typeName
Definition:
qgswfsgetfeature.cpp:54
qgis_sip.h
nlohmann
qgsserverapicontext.h
QgsServerApiContext
The QgsServerApiContext class encapsulates the resources for a particular client request: the request...
Definition:
qgsserverapicontext.h:38
QgsServerApiBadRequestException
Bad request error API exception.
Definition:
qgsserverexception.h:244
QgsServerQueryStringParameter::Type
Type
The Type enum represents the parameter type.
Definition:
qgsserverquerystringparameter.h:60
Generated on Sun Oct 27 2019 00:43:28 for QGIS API Documentation by
1.8.13