libdap++
Updated for version 3.11.7
|
#include <HTTPResponse.h>
Public Member Functions | |
HTTPResponse (FILE *s, int status, vector< string > *h, const string &temp_file) | |
virtual | ~HTTPResponse () |
Accessors | |
virtual vector< string > * | get_headers () const |
virtual string | get_file () const |
Mutators | |
virtual void | set_headers (vector< string > *h) |
virtual void | set_file (const string &n) |
Accessors | |
virtual int | get_status () const |
virtual FILE * | get_stream () const |
virtual ObjectType | get_type () const |
virtual string | get_version () const |
virtual string | get_protocol () const |
Mutators | |
virtual void | set_status (int s) |
virtual void | set_stream (FILE *s) |
virtual void | set_type (ObjectType o) |
virtual void | set_version (const string &v) |
virtual void | set_protocol (const string &p) |
Protected Member Functions | |
Suppressed default methods | |
HTTPResponse () | |
HTTPResponse (const HTTPResponse &rs) | |
HTTPResponse & | operator= (const HTTPResponse &) |
Encapsulate an http response. Instead of directly returning the FILE pointer from which a response is read and vector of headers, return an instance of this object.
Definition at line 59 of file HTTPResponse.h.
|
inlineprotected |
Definition at line 70 of file HTTPResponse.h.
|
inlineprotected |
Definition at line 72 of file HTTPResponse.h.
|
inline |
Build an HTTPResponse object. An instance of this class is used to return an HTTP response (body and headers). If the response is really from a remote server, the current HTTP code stores the body in a temporary file and the headers in a vector<string> object. This class will delete those resources when its destructor is called. If the response does not have a temporary file that needs to be deleted (say it actually comes from a local cache or was read directly into memory), the temp file should be set to "".
s | FILE * to the response. Read the response body from this stream. |
status | The HTTP response status code. |
h | Response headers. This class will delete the pointer when the instance that contains it is destroyed. |
temp_file | Name a the temporary file that holds the response body; this file is deleted when this instance is deleted. |
Definition at line 97 of file HTTPResponse.h.
|
inlinevirtual |
When an instance is destroyed, free the temporary resources: the temp_file and headers are deleted. If the tmp file name is "", it is not deleted.
Definition at line 109 of file HTTPResponse.h.
References libdap::close_temp(), DBG, DBGN, libdap::dods_keep_temps, libdap::Response::get_stream(), and libdap::Response::set_stream().
|
inlinevirtual |
Definition at line 128 of file HTTPResponse.h.
|
inlinevirtual |
Definition at line 124 of file HTTPResponse.h.
Referenced by libdap::HTTPConnect::fetch_url().
|
inlinevirtualinherited |
Definition at line 127 of file Response.h.
Referenced by libdap::Connect::read_data_no_mime(), libdap::Connect::request_das(), libdap::Connect::request_das_url(), libdap::Connect::request_data(), libdap::Connect::request_data_ddx(), libdap::Connect::request_data_ddx_url(), libdap::Connect::request_data_url(), libdap::Connect::request_dds(), libdap::Connect::request_dds_url(), libdap::Connect::request_ddx(), libdap::Connect::request_ddx_url(), libdap::Connect::request_protocol(), and libdap::Connect::request_version().
|
inlinevirtualinherited |
Definition at line 111 of file Response.h.
Referenced by libdap::HTTPConnect::fetch_url().
|
inlinevirtualinherited |
Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.
Definition at line 115 of file Response.h.
Referenced by libdap::ResponseBuilder::get_cached_data_ddx(), main(), libdap::Connect::request_das(), libdap::Connect::request_das_url(), libdap::Connect::request_dds(), libdap::Connect::request_dds_url(), libdap::Connect::request_ddx(), libdap::Connect::request_ddx_url(), libdap::ResponseBuilder::send_data(), libdap::HTTPCacheResponse::~HTTPCacheResponse(), and ~HTTPResponse().
|
inlinevirtualinherited |
Definition at line 119 of file Response.h.
Referenced by libdap::Connect::read_data_no_mime(), libdap::Connect::request_das(), libdap::Connect::request_das_url(), libdap::Connect::request_dds(), libdap::Connect::request_dds_url(), libdap::Connect::request_ddx(), and libdap::Connect::request_ddx_url().
|
inlinevirtualinherited |
Definition at line 123 of file Response.h.
Referenced by libdap::Connect::read_data_no_mime(), libdap::Connect::request_das(), libdap::Connect::request_das_url(), libdap::Connect::request_data(), libdap::Connect::request_data_ddx(), libdap::Connect::request_data_ddx_url(), libdap::Connect::request_data_url(), libdap::Connect::request_dds(), libdap::Connect::request_dds_url(), libdap::Connect::request_ddx(), libdap::Connect::request_ddx_url(), libdap::Connect::request_protocol(), and libdap::Connect::request_version().
|
inlineprotected |
Definition at line 74 of file HTTPResponse.h.
|
inlinevirtual |
Definition at line 141 of file HTTPResponse.h.
Referenced by libdap::HTTPCacheResponse::~HTTPCacheResponse().
|
inlinevirtual |
Definition at line 136 of file HTTPResponse.h.
|
inlinevirtualinherited |
Definition at line 151 of file Response.h.
Referenced by libdap::HTTPConnect::fetch_url().
|
inlinevirtualinherited |
Definition at line 135 of file Response.h.
|
inlinevirtualinherited |
Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.
Definition at line 139 of file Response.h.
Referenced by ~HTTPResponse().
|
inlinevirtualinherited |
Definition at line 143 of file Response.h.
Referenced by libdap::HTTPConnect::fetch_url().
|
inlinevirtualinherited |
Definition at line 147 of file Response.h.
Referenced by libdap::HTTPConnect::fetch_url().