|
libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
#include <HTTPResponse.h>


Public Member Functions | |
| HTTPResponse ()=default | |
| HTTPResponse (const HTTPResponse &rs)=delete | |
| HTTPResponse (FILE *s, int status, const std::vector< std::string > &h, const std::string &temp_file) | |
| HTTPResponse (std::fstream *s, int status, const std::vector< std::string > &h, const std::string &temp_file) | |
| Build a HTTPResponse using a cpp fstream When working with DAP4 responses, use C++ streams for I/0. | |
| HTTPResponse & | operator= (const HTTPResponse &)=delete |
| void | transform_to_cpp () |
| ~HTTPResponse () override | |
Accessors | |
| virtual std::vector< std::string > & | get_headers () |
| virtual std::string | get_file () const |
Mutators | |
| virtual void | set_headers (std::vector< std::string > &h) |
| virtual void | set_file (const std::string &n) |
getters | |
| virtual int | get_status () const |
| virtual FILE * | get_stream () const |
| virtual std::istream * | get_cpp_stream () const |
| virtual ObjectType | get_type () const |
| virtual std::string | get_version () const |
| virtual std::string | get_protocol () const |
setters | |
| virtual void | set_status (int s) |
| virtual void | set_stream (FILE *s) |
| virtual void | set_cpp_stream (std::istream *s) |
| virtual void | set_type (ObjectType o) |
| virtual void | set_version (const std::string &v) |
| virtual void | set_protocol (const std::string &p) |
Protected Attributes | |
| bool | d_delete_cpp_stream_ptr = false |
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 50 of file HTTPResponse.h.
|
default |
|
delete |
|
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 76 of file HTTPResponse.h.
|
inline |
Build a HTTPResponse using a cpp fstream When working with DAP4 responses, use C++ streams for I/0.
| s | |
| status | |
| h | |
| temp_file |
Definition at line 87 of file HTTPResponse.h.
|
inlineoverride |
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 93 of file HTTPResponse.h.
|
inlinevirtualinherited |
Reimplemented in libdap::StdinResponse.
Definition at line 104 of file Response.h.
|
inlinevirtual |
Definition at line 120 of file HTTPResponse.h.
|
inlinevirtual |
Definition at line 119 of file HTTPResponse.h.
|
inlinevirtualinherited |
Definition at line 108 of file Response.h.
|
inlinevirtualinherited |
Definition at line 102 of file Response.h.
|
inlinevirtualinherited |
Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.
Definition at line 103 of file Response.h.
|
inlinevirtualinherited |
Definition at line 106 of file Response.h.
|
inlinevirtualinherited |
Definition at line 107 of file Response.h.
|
delete |
|
inlinevirtualinherited |
Reimplemented in libdap::StdinResponse.
Definition at line 116 of file Response.h.
|
inlinevirtual |
Definition at line 126 of file HTTPResponse.h.
|
inlinevirtual |
Definition at line 125 of file HTTPResponse.h.
|
inlinevirtualinherited |
Definition at line 120 of file Response.h.
|
inlinevirtualinherited |
Definition at line 113 of file Response.h.
|
inlinevirtualinherited |
Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.
Definition at line 115 of file Response.h.
|
inlinevirtualinherited |
Definition at line 118 of file Response.h.
|
inlinevirtualinherited |
Definition at line 119 of file Response.h.
|
inline |
Build a new HTTPResponse object that works with C++ streams. Assume that the FILE* references a disk file.
Definition at line 104 of file HTTPResponse.h.
|
protectedinherited |
Definition at line 67 of file Response.h.