mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
Fix coding style and update comments
This commit is contained in:
parent
689f3b1ab2
commit
fcacb2899f
@ -39,7 +39,7 @@ typedef QMultiMap<int, QgsServerFilter*> QgsServerFiltersMap;
|
|||||||
class QgsServerInterface
|
class QgsServerInterface
|
||||||
{
|
{
|
||||||
%TypeHeaderCode
|
%TypeHeaderCode
|
||||||
#include "qgsserverinterface.h"
|
#include "qgsserverinterface.h"
|
||||||
%End
|
%End
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -61,26 +61,26 @@ class QgsServerInterface
|
|||||||
* Get pointer to the capabiblities cache
|
* Get pointer to the capabiblities cache
|
||||||
* @return QgsCapabilitiesCache
|
* @return QgsCapabilitiesCache
|
||||||
*/
|
*/
|
||||||
virtual QgsCapabilitiesCache* capabilitiesCache() = 0 /KeepReference/;
|
virtual QgsCapabilitiesCache* capabilitiesCache() = 0 / KeepReference /;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get pointer to the request handler
|
* Get pointer to the request handler
|
||||||
* @return QgsRequestHandler
|
* @return QgsRequestHandler
|
||||||
*/
|
*/
|
||||||
virtual QgsRequestHandler* requestHandler() = 0 /KeepReference/;
|
virtual QgsRequestHandler* requestHandler() = 0 / KeepReference /;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a QgsServerFilter
|
* Register a QgsServerFilter
|
||||||
* @param filter the QgsServerFilter to add
|
* @param filter the QgsServerFilter to add
|
||||||
* @param priority an optional priority for the filter order
|
* @param priority an optional priority for the filter order
|
||||||
*/
|
*/
|
||||||
virtual void registerFilter( QgsServerFilter* filter /Transfer/, int priority = 0 ) = 0;
|
virtual void registerFilter( QgsServerFilter* filter / Transfer / , int priority = 0 ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the filters map
|
* Set the filters map
|
||||||
* @param filters the QgsServerFiltersMap
|
* @param filters the QgsServerFiltersMap
|
||||||
*/
|
*/
|
||||||
virtual void setFilters( QgsServerFiltersMap* filters /Transfer/) = 0;
|
virtual void setFilters( QgsServerFiltersMap* filters / Transfer / ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the list of current QgsServerFilter
|
* Return the list of current QgsServerFilter
|
||||||
@ -92,13 +92,13 @@ class QgsServerInterface
|
|||||||
* @param accessControl the access control to register
|
* @param accessControl the access control to register
|
||||||
* @param priority the priority used to order them
|
* @param priority the priority used to order them
|
||||||
*/
|
*/
|
||||||
virtual void registerAccessControl( QgsAccessControlFilter* accessControl /Transfer/, int priority = 0 ) = 0;
|
virtual void registerAccessControl( QgsAccessControlFilter* accessControl / Transfer / , int priority = 0 ) = 0;
|
||||||
|
|
||||||
/** Gets the registred access control filters */
|
/** Gets the registred access control filters */
|
||||||
virtual const QgsAccessControl* accessControls() const = 0;
|
virtual const QgsAccessControl* accessControls() const = 0;
|
||||||
|
|
||||||
//! Return an enrironment variable, used to pass environment variables to python
|
//! Return an enrironment variable, used to pass environment variables to python
|
||||||
virtual QString getEnv(const QString& name ) const = 0;
|
virtual QString getEnv( const QString& name ) const = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the configuration file path
|
* Return the configuration file path
|
||||||
@ -110,7 +110,7 @@ class QgsServerInterface
|
|||||||
* Set the configuration file path
|
* Set the configuration file path
|
||||||
* @param configFilePath QString with the configuration file path
|
* @param configFilePath QString with the configuration file path
|
||||||
*/
|
*/
|
||||||
virtual void setConfigFilePath( const QString& configFilePath) = 0;
|
virtual void setConfigFilePath( const QString& configFilePath ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove entry from config cache
|
* Remove entry from config cache
|
||||||
@ -125,10 +125,10 @@ class QgsServerInterface
|
|||||||
virtual void removeProjectLayers( const QString& path ) = 0;
|
virtual void removeProjectLayers( const QString& path ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the service registry
|
* Return the service registry
|
||||||
* @return QgsServiceResgistry
|
* @return QgsServiceResgistry
|
||||||
*/
|
*/
|
||||||
virtual QgsServiceRegistry* serviceRegistry() = 0 /KeepReference/;
|
virtual QgsServiceRegistry* serviceRegistry() = 0 / KeepReference /;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Constructor */
|
/** Constructor */
|
||||||
|
@ -70,8 +70,8 @@ class QgsServerRequest
|
|||||||
Method method() const;
|
Method method() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* * @return query params
|
* @return query params
|
||||||
* */
|
*/
|
||||||
QMap<QString, QString> parameters() const;
|
QMap<QString, QString> parameters() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,7 +51,7 @@ class QgsServerResponse
|
|||||||
* Send error
|
* Send error
|
||||||
* This method delegates error handling at the server level. This is different
|
* This method delegates error handling at the server level. This is different
|
||||||
* from calling setReturnCode() along with and a specific response body.
|
* from calling setReturnCode() along with and a specific response body.
|
||||||
* @param code HHTP return code value
|
* @param code HTTP return code value
|
||||||
* @param message An informative error message
|
* @param message An informative error message
|
||||||
*/
|
*/
|
||||||
virtual void sendError( int code, const QString& message ) = 0;
|
virtual void sendError( int code, const QString& message ) = 0;
|
||||||
@ -61,7 +61,7 @@ class QgsServerResponse
|
|||||||
* This is a convenient method that will write directly
|
* This is a convenient method that will write directly
|
||||||
* to the underlying I/O device
|
* to the underlying I/O device
|
||||||
*/
|
*/
|
||||||
virtual void write(const QString& data );
|
virtual void write( const QString& data );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write chunk of data
|
* Write chunk of data
|
||||||
@ -69,7 +69,7 @@ class QgsServerResponse
|
|||||||
* underlying I/O device
|
* underlying I/O device
|
||||||
* @return the number of bytes that were actually written
|
* @return the number of bytes that were actually written
|
||||||
*/
|
*/
|
||||||
virtual qint64 write(const QByteArray& byteArray );
|
virtual qint64 write( const QByteArray& byteArray );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the underlying QIODevice
|
* Return the underlying QIODevice
|
||||||
|
@ -60,7 +60,7 @@ class SERVER_EXPORT QgsServer
|
|||||||
* @param var environment variable name
|
* @param var environment variable name
|
||||||
* @param val value
|
* @param val value
|
||||||
* @note added in 2.14
|
* @note added in 2.14
|
||||||
/ */
|
*/
|
||||||
void putenv( const QString &var, const QString &val );
|
void putenv( const QString &var, const QString &val );
|
||||||
|
|
||||||
/** Handles the request. The output is normally printed trough FCGI printf
|
/** Handles the request. The output is normally printed trough FCGI printf
|
||||||
@ -129,7 +129,7 @@ class SERVER_EXPORT QgsServer
|
|||||||
|
|
||||||
//! service registry
|
//! service registry
|
||||||
static QgsServiceRegistry sServiceRegistry;
|
static QgsServiceRegistry sServiceRegistry;
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // QGSSERVER_H
|
#endif // QGSSERVER_H
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ class SERVER_EXPORT QgsServerInterface
|
|||||||
virtual void removeProjectLayers( const QString& path ) = 0;
|
virtual void removeProjectLayers( const QString& path ) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the service registry
|
* Return the service registry
|
||||||
* @return QgsServiceResgistry
|
* @return QgsServiceResgistry
|
||||||
*/
|
*/
|
||||||
virtual QgsServiceRegistry* serviceRegistry() = 0;
|
virtual QgsServiceRegistry* serviceRegistry() = 0;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
//! Constructor
|
//! Constructor
|
||||||
QgsServerInterfaceImpl::QgsServerInterfaceImpl( QgsCapabilitiesCache* capCache, QgsServiceRegistry* srvRegistry )
|
QgsServerInterfaceImpl::QgsServerInterfaceImpl( QgsCapabilitiesCache* capCache, QgsServiceRegistry* srvRegistry )
|
||||||
: mCapabilitiesCache( capCache )
|
: mCapabilitiesCache( capCache )
|
||||||
, mServiceRegistry(srvRegistry)
|
, mServiceRegistry( srvRegistry )
|
||||||
{
|
{
|
||||||
mRequestHandler = nullptr;
|
mRequestHandler = nullptr;
|
||||||
mAccessControls = new QgsAccessControl();
|
mAccessControls = new QgsAccessControl();
|
||||||
@ -92,6 +92,6 @@ void QgsServerInterfaceImpl::removeProjectLayers( const QString& path )
|
|||||||
|
|
||||||
QgsServiceRegistry* QgsServerInterfaceImpl::serviceRegistry()
|
QgsServiceRegistry* QgsServerInterfaceImpl::serviceRegistry()
|
||||||
{
|
{
|
||||||
return mServiceRegistry;
|
return mServiceRegistry;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,9 @@ class SERVER_EXPORT QgsServerResponse
|
|||||||
/**
|
/**
|
||||||
* Send error
|
* Send error
|
||||||
* This method delegates error handling at the server level. This is different
|
* This method delegates error handling at the server level. This is different
|
||||||
* from calling setReturnCode() along with and a specific response body.
|
* from calling setReturnCode() wich let you return a specific response body.
|
||||||
|
* Calling sendError() will end the transaction and any attempt to write data
|
||||||
|
* or set headers will be an error.
|
||||||
* @param code HHTP return code value
|
* @param code HHTP return code value
|
||||||
* @param message An informative error message
|
* @param message An informative error message
|
||||||
*/
|
*/
|
||||||
|
@ -55,7 +55,7 @@ QgsServiceNativeLoader::~QgsServiceNativeLoader()
|
|||||||
}
|
}
|
||||||
|
|
||||||
void QgsServiceNativeLoader::loadModules( const QString& modulePath, QgsServiceRegistry& registrar,
|
void QgsServiceNativeLoader::loadModules( const QString& modulePath, QgsServiceRegistry& registrar,
|
||||||
QgsServerInterface* serverIface )
|
QgsServerInterface* serverIface )
|
||||||
{
|
{
|
||||||
QDir moduleDir( modulePath );
|
QDir moduleDir( modulePath );
|
||||||
moduleDir.setSorting( QDir::Name | QDir::IgnoreCase );
|
moduleDir.setSorting( QDir::Name | QDir::IgnoreCase );
|
||||||
|
@ -49,10 +49,10 @@ class SERVER_EXPORT QgsServiceNativeLoader
|
|||||||
* Lead all medules from path
|
* Lead all medules from path
|
||||||
* @param modulePath the path to look for module
|
* @param modulePath the path to look for module
|
||||||
* @param registrar QgsServiceRegistry instance for registering services
|
* @param registrar QgsServiceRegistry instance for registering services
|
||||||
* @param serverIface QgsServerInterface instarce
|
* @param serverIface QgsServerInterface instarce
|
||||||
*/
|
*/
|
||||||
void loadModules( const QString& modulePath, QgsServiceRegistry& registrar,
|
void loadModules( const QString& modulePath, QgsServiceRegistry& registrar,
|
||||||
QgsServerInterface* serverIface = nullptr );
|
QgsServerInterface* serverIface = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unload all modules
|
* Unload all modules
|
||||||
|
@ -89,10 +89,10 @@ class SERVER_EXPORT QgsServiceRegistry
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize registry, load modules and auto register services
|
* Initialize registry, load modules and auto register services
|
||||||
* @param serverIface the server interface
|
* @param serverIface the server interface
|
||||||
* @param nativeModulepath the native module path
|
* @param nativeModulepath the native module path
|
||||||
*/
|
*/
|
||||||
void init( const QString& nativeModulepath, QgsServerInterface* serverIface =nullptr );
|
void init( const QString& nativeModulepath, QgsServerInterface* serverIface = nullptr );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clean up registered service and unregister modules
|
* Clean up registered service and unregister modules
|
||||||
|
Loading…
x
Reference in New Issue
Block a user