QGIS API Documentation
3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
src
server
qgsserverstatichandler.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsserverstatichandler.h - QgsServerStaticHandler
3
4
---------------------
5
begin : 30.7.2020
6
copyright : (C) 2020 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 QGSSERVERSTATICHANDLER_H
17
#define QGSSERVERSTATICHANDLER_H
18
19
#include "qgis_server.h"
20
#include "
qgsserverogcapihandler.h
"
21
22
#include <QString>
23
24
using namespace
Qt::StringLiterals;
25
32
class
SERVER_EXPORT
QgsServerStaticHandler
:
public
QgsServerOgcApiHandler
33
{
34
public
:
42
QgsServerStaticHandler
(
const
QString &pathRegExp = u
"/static/(?<staticFilePath>.*)$"
_s,
const
QString &staticPathSuffix = QString() );
43
44
void
handleRequest
(
const
QgsServerApiContext
&context )
const override
;
45
46
// QgsServerOgcApiHandler interface
47
QRegularExpression
path
()
const override
{
return
mPathRegExp; }
48
std::string
operationId
()
const override
{
return
"static"
; }
49
std::string
summary
()
const override
{
return
"Serves static files"
; }
50
std::string
description
()
const override
{
return
"Serves static files"
; }
51
std::string
linkTitle
()
const override
{
return
"Serves static files"
; }
52
QgsServerOgcApi::Rel
linkType
()
const override
{
return
QgsServerOgcApi::Rel::data
; }
53
54
private
:
55
QRegularExpression mPathRegExp;
56
QString mStaticPathSuffix;
57
};
58
59
60
#endif
// QGSSERVERSTATICHANDLER_H
QgsServerApiContext
Encapsulates the resources for a particular client request.
Definition
qgsserverapicontext.h:41
QgsServerOgcApiHandler
An abstract class which represents an OGC API handler to be registered in QgsServerOgcApi class.
Definition
qgsserverogcapihandler.h:99
QgsServerOgcApiHandler::handleRequest
virtual void handleRequest(const QgsServerApiContext &context) const
Handles the request within its context.
Definition
qgsserverogcapihandler.cpp:82
QgsServerOgcApi::Rel
Rel
Rel link types.
Definition
qgsserverogcapi.h:55
QgsServerOgcApi::data
@ data
The target IRI points to resource data.
Definition
qgsserverogcapi.h:70
QgsServerStaticHandler::summary
std::string summary() const override
Summary.
Definition
qgsserverstatichandler.h:49
QgsServerStaticHandler::path
QRegularExpression path() const override
URL pattern for this handler, named capture group are automatically extracted and returned by values(...
Definition
qgsserverstatichandler.h:47
QgsServerStaticHandler::description
std::string description() const override
Description.
Definition
qgsserverstatichandler.h:50
QgsServerStaticHandler::operationId
std::string operationId() const override
Returns the operation id for template file names and other internal references.
Definition
qgsserverstatichandler.h:48
QgsServerStaticHandler::QgsServerStaticHandler
QgsServerStaticHandler(const QString &pathRegExp=u"/static/(?<staticFilePath>.*)$"_s, const QString &staticPathSuffix=QString())
Creates QgsServerStaticHandler.
Definition
qgsserverstatichandler.cpp:27
QgsServerStaticHandler::linkTitle
std::string linkTitle() const override
Title for the handler link.
Definition
qgsserverstatichandler.h:51
QgsServerStaticHandler::linkType
QgsServerOgcApi::Rel linkType() const override
Main role for the resource link.
Definition
qgsserverstatichandler.h:52
qgsserverogcapihandler.h
Generated on
for QGIS API Documentation by
1.15.0