|
QGIS API Documentation 4.1.0-Master (31622b25bb0)
|
A decorator for calling filter's hooks. More...
#include <qgsfilterresponsedecorator.h>

Public Member Functions | |
| QgsFilterResponseDecorator (QgsServerFiltersMap filters, QgsServerResponse &response) | |
| Constructor for QgsFilterResponseDecorator. | |
| void | addHeader (const QString &key, const QString &value) override |
| Add a header value for the given key, without replacing any existing value for the same key Add Header entry to the response. | |
| void | clear () override |
| Reset all headers and content for this response. | |
| QByteArray | data () const override |
| Gets the data written so far. | |
| QgsFeedback * | feedback () const override |
| Returns the socket feedback if any. | |
| void | finish () override |
| Finish the response, ending the transaction. | |
| void | flush () override |
| Flushes the current output buffer to the network. | |
| virtual QList< QString > | fullHeader (const QString &key) const override |
| Returns a (possibly empty) list of all the header values for the given key. | |
| virtual QMap< QString, QList< QString > > | fullHeaders () const override |
| Returns all the header values. | |
| Q_DECL_DEPRECATED QString | header (const QString &key) const override |
| Returns a single header value for a given key. | |
| Q_DECL_DEPRECATED QMap< QString, QString > | headers () const override |
| Returns the header values as a map: only the last value is returned if multiple values are set for the same header. | |
| bool | headersSent () const override |
Returns true if the headers have already been sent. | |
| QIODevice * | io () override |
| Returns the underlying QIODevice. | |
| void | ready () |
| Call filters projectReady() method. | |
| void | removeHeader (const QString &key) override |
| Clear all header values for the given key Undo a previous 'setHeader' call. | |
| void | sendError (int code, const QString &message) override |
| Send error This method delegates error handling at the server level. | |
| void | setHeader (const QString &key, const QString &value) override |
| Set a single header value replacing any existing value(s) for the same key. | |
| void | setStatusCode (int code) override |
| Set the http status code. | |
| void | start () |
| Call filters requestReady() method. | |
| int | statusCode () const override |
| Returns the http status code. | |
| void | truncate () override |
| Truncate data. | |
| Public Member Functions inherited from QgsServerResponse | |
| QgsServerResponse ()=default | |
| virtual | ~QgsServerResponse ()=default |
| virtual qint64 | write (const char *data) |
| Writes at most maxSize bytes of data. | |
| virtual qint64 | write (const char *data, qint64 maxsize) |
| Writes at most maxSize bytes of data. | |
| virtual qint64 | write (const QByteArray &byteArray) |
| Write chunk of data This is a convenient method that will write directly to the underlying I/O device. | |
| virtual void | write (const QgsServerException &ex) |
| Write server exception. | |
| virtual void | write (const QString &data) |
| Write string This is a convenient method that will write directly to the underlying I/O device. | |
| virtual qint64 | write (std::string data) |
| Writes at most maxSize bytes of data. | |
A decorator for calling filter's hooks.
Definition at line 34 of file qgsfilterresponsedecorator.h.
| QgsFilterResponseDecorator::QgsFilterResponseDecorator | ( | QgsServerFiltersMap | filters, |
| QgsServerResponse & | response ) |
Constructor for QgsFilterResponseDecorator.
| filters | Map of filters to apply before terminating the response |
| response | Server response |
Definition at line 23 of file qgsfilterresponsedecorator.cpp.
|
inlineoverridevirtual |
Add a header value for the given key, without replacing any existing value for the same key Add Header entry to the response.
Implements QgsServerResponse.
Definition at line 59 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Reset all headers and content for this response.
Implements QgsServerResponse.
Definition at line 95 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Gets the data written so far.
This is implementation dependent: some implementations may not give access to the underlying and return an empty array.
Note that each call to 'flush' may empty the buffer and in case of streaming process you may get partial content
Implements QgsServerResponse.
Definition at line 97 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns the socket feedback if any.
Reimplemented from QgsServerResponse.
Definition at line 101 of file qgsfilterresponsedecorator.h.
|
overridevirtual |
Finish the response, ending the transaction.
The default implementation does nothing.
Reimplemented from QgsServerResponse.
Definition at line 54 of file qgsfilterresponsedecorator.cpp.
|
overridevirtual |
Flushes the current output buffer to the network.
'flush()' may be called multiple times. For HTTP transactions headers will be written on the first call to 'flush()'. The default implementation does nothing.
Reimplemented from QgsServerResponse.
Definition at line 71 of file qgsfilterresponsedecorator.cpp.
|
inlineoverridevirtual |
Returns a (possibly empty) list of all the header values for the given key.
Implements QgsServerResponse.
Definition at line 77 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns all the header values.
Implements QgsServerResponse.
Definition at line 79 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns a single header value for a given key.
Implements QgsServerResponse.
Definition at line 63 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns the header values as a map: only the last value is returned if multiple values are set for the same header.
Implements QgsServerResponse.
Definition at line 70 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns true if the headers have already been sent.
Implements QgsServerResponse.
Definition at line 81 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Returns the underlying QIODevice.
Implements QgsServerResponse.
Definition at line 89 of file qgsfilterresponsedecorator.h.
| void QgsFilterResponseDecorator::ready | ( | ) |
Call filters projectReady() method.
Definition at line 41 of file qgsfilterresponsedecorator.cpp.
|
inlineoverridevirtual |
Clear all header values for the given key Undo a previous 'setHeader' call.
Implements QgsServerResponse.
Definition at line 61 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Send error This method delegates error handling at the server level.
This is different from calling setReturnCode() which 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.
| code | HHTP return code value |
| message | An informative error message |
Implements QgsServerResponse.
Definition at line 87 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Set a single header value replacing any existing value(s) for the same key.
Implements QgsServerResponse.
Definition at line 57 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Set the http status code.
| code | HTTP status code value |
Implements QgsServerResponse.
Definition at line 83 of file qgsfilterresponsedecorator.h.
| void QgsFilterResponseDecorator::start | ( | ) |
Call filters requestReady() method.
Definition at line 28 of file qgsfilterresponsedecorator.cpp.
|
inlineoverridevirtual |
Returns the http status code.
Implements QgsServerResponse.
Definition at line 85 of file qgsfilterresponsedecorator.h.
|
inlineoverridevirtual |
Truncate data.
Clear internal buffer
Implements QgsServerResponse.
Definition at line 99 of file qgsfilterresponsedecorator.h.