|
| 1 | +/*************************************************************************** |
| 2 | + qgsbufferserverrequest.h |
| 3 | +
|
| 4 | + Define response wrapper for storing responsea in buffer |
| 5 | + ------------------- |
| 6 | + begin : 2017-01-03 |
| 7 | + copyright : (C) 2017 by David Marteau |
| 8 | + email : david dot marteau at 3liz dot com |
| 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 | +#ifndef QGSBUFFERSERVERREQUEST_H |
| 20 | +#define QGSBUFFERSERVERREQUEST_H |
| 21 | + |
| 22 | +#include "qgsserverrequest.h" |
| 23 | + |
| 24 | +#include <QBuffer> |
| 25 | +#include <QByteArray> |
| 26 | +#include <QMap> |
| 27 | + |
| 28 | +/** |
| 29 | + * \ingroup server |
| 30 | + * QgsBufferServerRequest |
| 31 | + * Class defining request with data |
| 32 | + */ |
| 33 | +class QgsBufferServerRequest : public QgsServerRequest |
| 34 | +{ |
| 35 | + public: |
| 36 | + |
| 37 | + /** |
| 38 | + * Constructor |
| 39 | + * |
| 40 | + * \param url the url string |
| 41 | + * \param method the request method |
| 42 | + */ |
| 43 | + QgsBufferServerRequest( const QString &url, Method method = GetMethod, QByteArray *data = nullptr ); |
| 44 | + |
| 45 | + /** |
| 46 | + * Constructor |
| 47 | + * |
| 48 | + * \param url QUrl |
| 49 | + * \param method the request method |
| 50 | + */ |
| 51 | + QgsBufferServerRequest( const QUrl &url, Method method = GetMethod, QByteArray *data = nullptr ); |
| 52 | + |
| 53 | + ~QgsBufferServerRequest(); |
| 54 | + |
| 55 | + virtual QByteArray data() const { return mData; } |
| 56 | + |
| 57 | + private: |
| 58 | + QByteArray mData; |
| 59 | +}; |
| 60 | + |
| 61 | +#endif |
0 commit comments