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 #ifndef _util_h
00037 #define _util_h 1
00038
00039 #include <cstdio>
00040 #include <vector>
00041
00042 #ifndef _basetype_h
00043 #include "BaseType.h"
00044 #endif
00045
00046 #ifndef _byte_h
00047 #include "Byte.h"
00048 #endif
00049
00050 #ifndef _int16_h
00051 #include "Int16.h"
00052 #endif
00053
00054 #ifndef _uint16_h
00055 #include "UInt16.h"
00056 #endif
00057
00058 #ifndef _int32_h
00059 #include "Int32.h"
00060 #endif
00061
00062 #ifndef _uint32_h
00063 #include "UInt32.h"
00064 #endif
00065
00066 #ifndef _float32_h
00067 #include "Float32.h"
00068 #endif
00069
00070 #ifndef _float64_h
00071 #include "Float64.h"
00072 #endif
00073
00074 #ifndef _str_h
00075 #include "Str.h"
00076 #endif
00077
00078 #ifndef _url_h
00079 #include "Url.h"
00080 #endif
00081
00082 #ifndef _array_h
00083 #include "Array.h"
00084 #endif
00085
00086 #ifndef _structure_h
00087 #include "Structure.h"
00088 #endif
00089
00090 #ifndef _sequence_h
00091 #include "Sequence.h"
00092 #endif
00093
00094 #ifndef _grid_h
00095 #include "Grid.h"
00096 #endif
00097
00098 #ifdef _MSC_VER
00099 #define uint unsigned int
00100 #endif
00101
00102 using std::iostream;
00103
00104 namespace libdap
00105 {
00106
00107 string prune_spaces(const string &);
00108 bool unique_names(vector<BaseType *> l, const string &var, const string &type,
00109 string &msg);
00110 FILE *text_to_temp(string text);
00111 string systime();
00112 FILE *compressor(FILE *output, int &childpid);
00113 bool deflate_exists();
00114 const char *libdap_root();
00119 extern "C" const char *libdap_version();
00120 extern "C" const char *libdap_name();
00121 const char *dods_progress();
00122 #ifdef WIN32
00123 void flush_stream(iostream ios, FILE *out);
00124 #endif
00125
00126 void downcase(string &s);
00127 bool is_quoted(const string &s);
00128 string remove_quotes(const string &s);
00129
00130
00161 void append_long_to_string(long val, int base, string &str_val);
00162 string long_to_string(long val, int base = 10);
00164
00165
00179 void append_double_to_string(const double &num, string &str);
00180 string double_to_string(const double &num);
00182
00184 string dap_version();
00185
00194 string path_to_filename(string path);
00195
00196 #if 0
00197
00212 char *get_tempfile_template(char *file_template);
00213 FILE *get_temp_file(char *temp);
00214 #endif
00215 string file_to_string(FILE *fp);
00216
00217 time_t parse_time(const char * str, bool expand);
00218
00219 bool size_ok(uint sz, uint nelem);
00220 bool pathname_ok(const string &path, bool strict = true);
00221
00222 }
00223
00224 #endif