QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsserverapi.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsserverapi.cpp
3 
4  Class defining the service interface for QGIS server APIs.
5  -------------------
6  begin : 2019-04-16
7  copyright : (C) 2019 by Alessandro Pasotti
8  email : elpaso at itopen dot it
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  ***************************************************************************/
19 
20 
21 
22 #include "qgsserverapi.h"
23 
25  : mServerIface( serverIface )
26 {
27 }
28 
29 bool QgsServerApi::accept( const QUrl &url ) const
30 {
31  return url.path().contains( rootPath() );
32 }
33 
35 {
36  return mServerIface;
37 }
QgsServerApi::serverIface
QgsServerInterface * serverIface() const
Returns the server interface.
Definition: qgsserverapi.cpp:34
QgsServerApi::rootPath
virtual const QString rootPath() const =0
Returns the root path for the API.
qgsserverapi.h
QgsServerApi::accept
virtual bool accept(const QUrl &url) const
Returns true if the given url is handled by the API, default implementation checks for the presence o...
Definition: qgsserverapi.cpp:29
QgsServerInterface
QgsServerInterface Class defining interfaces exposed by QGIS Server and made available to plugins.
Definition: qgsserverinterface.h:61
QgsServerApi::QgsServerApi
QgsServerApi(QgsServerInterface *serverIface)
Creates a QgsServerApi object.
Definition: qgsserverapi.cpp:24