OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimHttpResponse.cpp
Go to the documentation of this file.
2 
3 RTTI_DEF1(ossimHttpResponse, "ossimHttpResponse", ossimWebResponse);
4 
6 {
9 
10  std::istream in(&buf);
11  in.seekg(0); // make sure we are at the begining
12  // skip method type
13  //
14  std::string statusLine;
17 
19  std::vector<ossimString> statusLineArray;
20  m_statusLine.split(statusLineArray, " ");
21  if(statusLineArray.size() > 1)
22  {
23  m_statusCode = statusLineArray[1].toUInt32();
24  }
25  else
26  {
27  m_statusCode = 0;
28  }
29 }
30 
32 {
33  ossimString result = m_headerKwl.find(headerName);
34 
35  return result;
36 }
37 
39 {
40  ossim_float64 result = -1;
41  ossimString contentLength = m_headerKwl.find("Content-Length");
42 
43  if(!contentLength.empty())
44  {
45  result = contentLength.toInt64();
46  }
47 
48  return result;
49 }
const char * find(const char *key) const
ossim_uint32 m_statusCode
ossim_int64 getContentLength() const
void split(std::vector< ossimString > &result, const ossimString &separatorList, bool skipBlankFields=false) const
Splits this string into a vector of strings (fields) using the delimiter list specified.
std::istream & getline(std::istream &is, ossimString &str, char delim)
Definition: ossimString.h:916
ossimKeywordlist m_headerKwl
double ossim_float64
ossimByteStreamBuffer m_headerBuffer
RTTI_DEF1(ossimHttpResponse, "ossimHttpResponse", ossimWebResponse)
const ossimString & statusLine() const
std::basic_istream< char > istream
Base class for char input streams.
Definition: ossimIosFwd.h:20
ossimString m_statusLine
virtual bool parseStream(ossim::istream &is, bool ignoreBinaryChars)
deprecated method
long long ossim_int64
bool empty() const
Definition: ossimString.h:411
ossim_int64 toInt64() const
void convertHeaderStreamToKeywordlist()
This will parse out the response code from the status line and initialize the header variables into a...
ossimString getHeaderValue(const ossimString &headerName) const