util.h

Go to the documentation of this file.
00001 
00002 // -*- mode: c++; c-basic-offset:4 -*-
00003 
00004 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
00005 // Access Protocol.
00006 
00007 // Copyright (c) 2002,2003 OPeNDAP, Inc.
00008 // Author: James Gallagher <jgallagher@opendap.org>
00009 //
00010 // This library is free software; you can redistribute it and/or
00011 // modify it under the terms of the GNU Lesser General Public
00012 // License as published by the Free Software Foundation; either
00013 // version 2.1 of the License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful,
00016 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00023 //
00024 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
00025 
00026 // (c) COPYRIGHT URI/MIT 1994-1999
00027 // Please read the full copyright statement in the file COPYRIGHT.
00028 //
00029 // Authors:
00030 //      jhrg,jimg       James Gallagher (jgallagher@gso.uri.edu)
00031 
00032 // declarations for utility functions
00033 //
00034 // jhrg 9/21/94
00035 
00036 #ifndef _util_h
00037 #define _util_h 1
00038 
00039 #include <stdio.h>
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 using std::iostream;
00099 
00100 string prune_spaces(const string &);
00101 bool unique_names(vector<BaseType *> l, const string &var, const string &type,
00102                   string &msg);
00103 //  These func's moved to xdrutil_ppc.* under the PPC as explained there
00104 #ifdef __POWERPC__
00105 extern "C" XDR *new_xdrstdio(FILE *stream, enum xdr_op xop);
00106 extern "C" XDR *set_xdrstdio(XDR *xdr, FILE *stream, enum xdr_op xop);
00107 extern "C" void delete_xdrstdio(XDR *xdr);
00108 #else
00109 XDR *new_xdrstdio(FILE *stream, enum xdr_op xop);
00110 XDR *set_xdrstdio(XDR *xdr, FILE *stream, enum xdr_op xop);
00111 void delete_xdrstdio(XDR *xdr);
00112 #endif
00113 FILE *text_to_temp(string text);
00114 string systime();
00115 FILE *compressor(FILE *output, int &childpid);
00116 bool deflate_exists();
00117 const char *libdap_root();
00122 extern "C" const char *libdap_version();
00123 extern "C" const char *libdap_name();
00124 const char *dods_progress();
00125 #ifdef WIN32
00126 void flush_stream(iostream ios, FILE *out);
00127 #endif
00128 
00129 extern "C" bool_t xdr_str(XDR *xdrs, string &buf);
00130 
00131 void downcase(string &s);
00132 // Jose Garcia
00163 void append_long_to_string(long val, int base, string &str_val);
00164 string long_to_string(long val, int base = 10);
00166 
00167 // Jose Garcia
00181 void append_double_to_string(const double &num, string &str);
00182 string double_to_string(const double &num);
00184 
00186 string dap_version();
00187 
00196 string path_to_filename(string path);
00197 
00212 char *get_tempfile_template(char *file_template);
00213 
00214 FILE *get_temp_file(char *temp);
00215 string file_to_string(FILE *fp);
00216 
00217 time_t parse_time(const char * str, bool expand);
00218 
00219 #endif

Generated on Wed Jun 27 12:56:39 2007 for libdap++ by  doxygen 1.4.7