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 using std::iostream;
00047
00048 namespace libdap
00049 {
00050
00051 string prune_spaces(const string &);
00052 bool unique_names(vector<BaseType *> l, const string &var, const string &type,
00053 string &msg);
00054 FILE *text_to_temp(string text);
00055 string systime();
00056 FILE *compressor(FILE *output, int &childpid);
00057 bool deflate_exists();
00058 const char *libdap_root();
00063 extern "C" const char *libdap_version();
00064 extern "C" const char *libdap_name();
00065 const char *dods_progress();
00066 #ifdef WIN32
00067 void flush_stream(iostream ios, FILE *out);
00068 #endif
00069
00070 void downcase(string &s);
00071 bool is_quoted(const string &s);
00072 string remove_quotes(const string &s);
00073
00074
00105 void append_long_to_string(long val, int base, string &str_val);
00106 string long_to_string(long val, int base = 10);
00108
00109
00123 void append_double_to_string(const double &num, string &str);
00124 string double_to_string(const double &num);
00126
00128 string dap_version();
00129
00138 string path_to_filename(string path);
00139
00140 string file_to_string(FILE *fp);
00141
00142 time_t parse_time(const char * str, bool expand);
00143
00144 bool size_ok(unsigned int sz, unsigned int nelem);
00145 bool pathname_ok(const string &path, bool strict = true);
00146
00147 }
00148
00149 #endif