2017-06-26 09:57:09 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsserverresponse.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-14 12:43:00 +01:00
|
|
|
|
2016-12-07 22:09:57 +01:00
|
|
|
class QgsServerResponse
|
|
|
|
{
|
2017-06-26 09:57:09 +02:00
|
|
|
|
2017-01-06 21:41:09 +01:00
|
|
|
%TypeHeaderCode
|
2016-12-07 22:09:57 +01:00
|
|
|
#include "qgsserverresponse.h"
|
2017-01-06 21:41:09 +01:00
|
|
|
%End
|
2016-12-14 21:46:00 +01:00
|
|
|
public:
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2016-12-14 21:46:00 +01:00
|
|
|
QgsServerResponse();
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
|
|
|
constructor
|
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2016-12-14 21:46:00 +01:00
|
|
|
virtual ~QgsServerResponse();
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual void setHeader( const QString &key, const QString &value ) = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set Header entry
|
|
|
|
Add Header entry to the response
|
|
|
|
Note that it is usually an error to set Header after data have been sent through the wire
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2017-04-30 12:59:20 +02:00
|
|
|
virtual void removeHeader( const QString &key ) = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Clear header
|
|
|
|
Undo a previous 'setHeader' call
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-04 01:13:14 +01:00
|
|
|
|
2017-04-22 10:27:10 +02:00
|
|
|
virtual QString header( const QString &key ) const = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the header value
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-04 01:13:14 +01:00
|
|
|
|
2017-07-19 09:19:37 +02:00
|
|
|
virtual QMap<QString, QString> headers() const = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the header value
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-05 17:40:57 +01:00
|
|
|
|
2017-01-07 21:31:26 +01:00
|
|
|
virtual bool headersSent() const = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return true if the headers have alredy been sent
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-06 21:10:29 +01:00
|
|
|
|
2017-04-22 10:17:08 +02:00
|
|
|
|
|
|
|
virtual void setStatusCode( int code ) = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the http status code
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param code: HTTP status code value
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
2017-07-19 09:19:37 +02:00
|
|
|
virtual int statusCode() const = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the http status code
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual void sendError( int code, const QString &message ) = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
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.
|
2017-12-15 21:36:08 -04:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
:param code: HHTP return code value
|
|
|
|
:param message: An informative error message
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual void write( const QString &data );
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Write string
|
|
|
|
This is a convenient method that will write directly
|
|
|
|
to the underlying I/O device
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-14 21:46:00 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual qint64 write( const QByteArray &byteArray );
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Write chunk of data
|
|
|
|
This is a convenient method that will write directly
|
|
|
|
to the underlying I/O device
|
|
|
|
|
|
|
|
:return: the number of bytes that were actually written
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
|
|
|
|
|
|
|
|
2016-12-14 21:46:00 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual void write( const QgsServerException &ex );
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Write server exception
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-11 22:59:27 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual QIODevice *io() = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Return the underlying QIODevice
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
|
2017-01-04 01:13:14 +01:00
|
|
|
virtual void finish() = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Finish the response, ending the transaction
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-04 01:13:14 +01:00
|
|
|
|
|
|
|
virtual void flush() = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Flushes the current output buffer to the network
|
2017-06-26 09:57:09 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
'flush()' may be called multiple times. For HTTP transactions
|
|
|
|
headers will be written on the first call to 'flush()'.
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-04 01:13:14 +01:00
|
|
|
|
|
|
|
virtual void clear() = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Reset all headers and content for this response
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-01-04 01:13:14 +01:00
|
|
|
|
2017-04-21 13:12:22 +02:00
|
|
|
virtual QByteArray data() const = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Get the data written so far
|
|
|
|
|
|
|
|
This is implementation dependent: some implementations may not
|
|
|
|
give access to the underlying and return an empty array.
|
2017-06-26 09:57:09 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Note that each call to 'flush' may empty the buffer and in case
|
|
|
|
of streaming process you may get partial content
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2017-04-21 13:12:22 +02:00
|
|
|
|
|
|
|
virtual void truncate() = 0;
|
2017-06-26 09:57:09 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Truncate data
|
2017-06-26 09:57:09 +02:00
|
|
|
|
2017-12-15 10:36:55 -04:00
|
|
|
Clear internal buffer
|
2017-06-26 09:57:09 +02:00
|
|
|
%End
|
2016-12-07 22:09:57 +01:00
|
|
|
};
|
|
|
|
|
2017-06-26 09:57:09 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/server/qgsserverresponse.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|