Navigation Menu

Skip to content

Commit

Permalink
Expose response body and infoFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso committed Nov 26, 2014
1 parent ca8e0c3 commit e314605
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/mapserver/qgshttprequesthandler.h
Expand Up @@ -72,7 +72,6 @@ class QgsHttpRequestHandler: public QgsRequestHandler
QString readPostBody() const;

private:
QByteArray mBody; // The response payload
static void medianCut( QVector<QRgb>& colorTable, int nColors, const QImage& inputImage );
static void imageColors( QHash<QRgb, int>& colors, const QImage& image );
static void splitColorBox( QgsColorBox& colorBox, QgsColorBoxMap& colorBoxMap,
Expand Down
4 changes: 4 additions & 0 deletions src/mapserver/qgsrequesthandler.h
Expand Up @@ -62,6 +62,7 @@ class QgsRequestHandler
virtual void appendBody( const QByteArray &body ) = 0;
/**Clears the response body*/
virtual void clearBody( ) = 0;
virtual QByteArray* body( ) { return &mBody; }
virtual void setInfoFormat( const QString &format ) = 0;
/**Send out HTTP headers and flush output buffer*/
virtual void sendResponse( ) = 0;
Expand All @@ -76,12 +77,14 @@ class QgsRequestHandler
virtual QString parameter( const QString &key ) const = 0;
QString format() const { return mFormat; }
bool headersSent() { return mHeadersSent; }
QString infoFormat() const { return mInfoFormat; }

protected:

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

};

#endif

0 comments on commit e314605

Please sign in to comment.