00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _cgi_util_h
00038 #define _cgi_util_h
00039
00040 #ifndef _dds_h
00041 #include "DDS.h"
00042 #endif
00043
00044 #include "ObjectType.h"
00045 #include "EncodingType.h"
00046
00047 namespace libdap
00048 {
00049
00061
00062 bool do_version(const string &script_ver, const string &dataset_ver);
00063
00064 bool do_data_transfer(bool compression, FILE *data_stream, DDS &dds,
00065 const string &dataset, const string &constraint);
00066
00067 void ErrMsgT(const string &Msgt);
00068
00069 string name_path(const string &path);
00070
00071 string rfc822_date(const time_t t);
00072
00073 time_t last_modified_time(const string &name);
00075
00087 void set_mime_text(FILE *out, ObjectType type = unknown_type,
00088 const string &version = "", EncodingType enc = x_plain,
00089 const time_t last_modified = 0);
00090 void set_mime_text(ostream &out, ObjectType type = unknown_type,
00091 const string &version = "", EncodingType enc = x_plain,
00092 const time_t last_modified = 0);
00093 void set_mime_html(FILE *out, ObjectType type = unknown_type,
00094 const string &version = "", EncodingType enc = x_plain,
00095 const time_t last_modified = 0);
00096 void set_mime_html(ostream &out, ObjectType type = unknown_type,
00097 const string &version = "", EncodingType enc = x_plain,
00098 const time_t last_modified = 0);
00099 void set_mime_binary(FILE *out, ObjectType type = unknown_type,
00100 const string &version = "", EncodingType enc = x_plain,
00101 const time_t last_modified = 0);
00102 void set_mime_binary(ostream &out, ObjectType type = unknown_type,
00103 const string &version = "", EncodingType enc = x_plain,
00104 const time_t last_modified = 0);
00105 void set_mime_error(FILE *out, int code = 404,
00106 const string &reason = "Dataset not found",
00107 const string &version = "");
00108 void set_mime_error(ostream &out, int code = 404,
00109 const string &reason = "Dataset not found",
00110 const string &version = "");
00111 void set_mime_not_modified(FILE *out);
00112 void set_mime_not_modified(ostream &out);
00113
00115
00116 string get_user_supplied_docs(string name, string cgi);
00117
00118 bool remove_mime_header(FILE *in);
00119
00120 bool found_override(string name, string &doc);
00121
00122 }
00123
00124 #endif // _cgi_util_h