/usr/include/ossim/base/ossimHttpResponse.h is in libossim-dev 2.2.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | //----------------------------------------------------------------------------
//
// License: See top level LICENSE.txt file
//
// Author: Garrett Potts
//
// Description: This is an initial cut at an http response object. The HttpResponse is
// returned from the HttpRequest base object.
//----------------------------------------------------------------------------
// $Id$
#ifndef ossimHttpResponse_HEADER
#define ossimHttpResponse_HEADER
#include <iostream>
#include <ossim/base/ossimReferenced.h>
#include <ossim/base/ossimByteStreamBuffer.h>
#include <ossim/base/ossimKeywordlist.h>
#include <ossim/base/ossimString.h>
#include <ossim/base/ossimWebResponse.h>
class OSSIM_DLL ossimHttpResponse : public ossimWebResponse
{
public:
ossimHttpResponse()
:m_headerStream(&m_headerBuffer),
m_bodyStream(&m_bodyBuffer)
{
clear();
}
ossimByteStreamBuffer& headerBuffer(){return m_headerBuffer;}
const ossimByteStreamBuffer& headerBuffer()const{return m_headerBuffer;}
ossimByteStreamBuffer& bodyBuffer(){return m_bodyBuffer;}
const ossimByteStreamBuffer& bodyBuffer()const{return m_bodyBuffer;}
std::iostream& headerStream(){return m_headerStream;}
std::iostream& bodyStream(){return m_bodyStream;}
virtual std::istream* getInputStream()
{return static_cast<std::istream*>(&m_bodyStream);}
/**
* Clears out the Response and prepares for a new response.
*/
virtual void clear()
{
m_headerBuffer.clear();
m_bodyBuffer.clear();
m_headerKwl.clear();
m_statusLine = "";
m_statusCode = 200;
}
/**
* This will parse out the response code from the status line and initialize
* the header variables into a keywordlist.
*/
void convertHeaderStreamToKeywordlist();
virtual void clearLastError(){m_statusCode = 200;m_statusLine="";}
virtual ossimString getLastError()const{return ((m_statusCode == 200)?ossimString(""):m_statusLine);}
ossimKeywordlist& headerKwl(){return m_headerKwl;}
const ossimKeywordlist& headerKwl()const{return m_headerKwl;}
ossim_int64 getContentLength()const;
ossimString getHeaderValue(const ossimString& headerName)const;
const ossimString& statusLine()const{return m_statusLine;}
ossim_uint32 getStatusCode()const{return m_statusCode;}
protected:
ossimKeywordlist m_headerKwl;
ossimByteStreamBuffer m_headerBuffer;
ossimByteStreamBuffer m_bodyBuffer;
std::iostream m_headerStream;
std::iostream m_bodyStream;
ossimString m_statusLine;
ossim_uint32 m_statusCode;
TYPE_DATA;
};
#endif
|