libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
|
#include "config.h"
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <time.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
#include "media_types.h"
#include "mime_util.h"
#include "Ancillary.h"
#include "debug.h"
#include "util.h"
Go to the source code of this file.
Namespaces | |
namespace | libdap |
top level DAP object to house generic methods | |
Macros | |
#define | CRLF "\r\n" |
#define | FILE_DELIMITER '/' |
Functions | |
MIME Utilities | |
A collection of useful functions for writing MIME headers for OPeNDAP servers. The CGI utilities include a variety of functions useful to programmers developing OPeNDAP CGI filter programs. However, before jumping in and using these, look at the class ResponseBuilder. Always choose to use that class over these functions if you can. Many of these functions were used by the CGI programs that made up the first DAP server; all of those are deprecated and the ResponseBuilder class should be used instead. Some of the other functions are used by ResponseBuilder and the client-side parsing code that needs to identify MIME headers, boundaries, etc.
| |
string | libdap::cid_to_header_value (const string &cid) |
bool | libdap::do_version (const string &script_ver, const string &dataset_ver) |
Send a version number. | |
void | libdap::ErrMsgT (const string &Msgt) |
Logs an error message. | |
ObjectType | libdap::get_description_type (const string &value) |
string | libdap::get_next_mime_header (FILE *in) |
string | libdap::get_next_mime_header (istream &in) |
ObjectType | libdap::get_type (const string &value) |
bool | libdap::is_boundary (const char *line, const string &boundary) |
time_t | libdap::last_modified_time (const string &name) |
string | libdap::name_path (const string &path) |
Returns the filename portion of a pathname. | |
void | libdap::parse_mime_header (const string &header, string &name, string &value) |
string | libdap::read_multipart_boundary (FILE *in, const string &boundary) |
string | libdap::read_multipart_boundary (istream &in, const string &boundary) |
void | libdap::read_multipart_headers (FILE *in, const string &content_type, const ObjectType object_type, const string &cid) |
void | libdap::read_multipart_headers (istream &in, const string &content_type, const ObjectType object_type, const string &cid) |
bool | libdap::remove_mime_header (FILE *in) |
Read and discard the MIME header of the stream in . | |
void | libdap::remove_mime_header (istream &in) |
string | libdap::rfc822_date (const time_t t) |
MIME utility functions | |
These functions are used to create the MIME headers for a message from a server to a client. They are public but should not be called directly unless absolutely necessary. Use DODSFilter instead. NB: These functions actually write both the response status line and the header.
| |
void | libdap::set_mime_binary (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_binary (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_binary (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) |
void | libdap::set_mime_data_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc) |
void | libdap::set_mime_ddx_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc) |
void | libdap::set_mime_error (FILE *out, int code, const string &reason, const string &version) |
void | libdap::set_mime_error (ostream &strm, int code, const string &reason, const string &version) |
void | libdap::set_mime_html (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_html (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_html (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) |
void | libdap::set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, const string &version, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol, const string &url) |
void | libdap::set_mime_not_modified (FILE *out) |
Send a ‘Not Modified’ response. | |
void | libdap::set_mime_not_modified (ostream &strm) |
Send a ‘Not Modified’ response. | |
void | libdap::set_mime_text (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_text (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified) |
void | libdap::set_mime_text (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol) |
Variables | |
const size_t | libdap::line_length = 1024 |
#define CRLF "\r\n" |
Definition at line 83 of file mime_util.cc.
#define FILE_DELIMITER '/' |
Definition at line 79 of file mime_util.cc.