Skip to content

Commit e314605

Browse files
committedNov 26, 2014
Expose response body and infoFormat
1 parent ca8e0c3 commit e314605

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎src/mapserver/qgshttprequesthandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ class QgsHttpRequestHandler: public QgsRequestHandler
7272
QString readPostBody() const;
7373

7474
private:
75-
QByteArray mBody; // The response payload
7675
static void medianCut( QVector<QRgb>& colorTable, int nColors, const QImage& inputImage );
7776
static void imageColors( QHash<QRgb, int>& colors, const QImage& image );
7877
static void splitColorBox( QgsColorBox& colorBox, QgsColorBoxMap& colorBoxMap,

‎src/mapserver/qgsrequesthandler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class QgsRequestHandler
6262
virtual void appendBody( const QByteArray &body ) = 0;
6363
/**Clears the response body*/
6464
virtual void clearBody( ) = 0;
65+
virtual QByteArray* body( ) { return &mBody; }
6566
virtual void setInfoFormat( const QString &format ) = 0;
6667
/**Send out HTTP headers and flush output buffer*/
6768
virtual void sendResponse( ) = 0;
@@ -76,12 +77,14 @@ class QgsRequestHandler
7677
virtual QString parameter( const QString &key ) const = 0;
7778
QString format() const { return mFormat; }
7879
bool headersSent() { return mHeadersSent; }
80+
QString infoFormat() const { return mInfoFormat; }
7981

8082
protected:
8183

8284
virtual void sendHeaders( ) = 0;
8385
virtual void sendBody( ) const = 0;
8486
/**This is set by the parseInput methods of the subclasses (parameter FORMAT, e.g. 'FORMAT=PNG')*/
87+
QByteArray mBody; // The response payload
8588
QString mFormat;
8689
QString mFormatString; //format string as it is passed in the request (with base)
8790
bool mHeadersSent;
@@ -92,6 +95,7 @@ class QgsRequestHandler
9295
/** Response headers. They can be empty, in this case headers are
9396
automatically generated from the content mFormat */
9497
QMap<QString, QString> mHeaders;
98+
9599
};
96100

97101
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.