From 077ee51b636cb8d9a8de34f035c489f1478f1ad0 Mon Sep 17 00:00:00 2001 From: tradke Date: Tue, 17 Jun 2003 08:51:22 +0000 Subject: Also support HDF5 as input/output file format. git-svn-id: http://svn.cactuscode.org/arrangements/CactusExternal/FlexIO/trunk@34 21a6bef8-4479-4f54-8f8d-0db94a2919ef --- src/ioconvert.cc | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/ioconvert.cc b/src/ioconvert.cc index c816df0..6ba466c 100644 --- a/src/ioconvert.cc +++ b/src/ioconvert.cc @@ -3,7 +3,12 @@ #include #include "IO.hh" #include "IEEEIO.hh" +#ifdef WITH_HDF4 #include "HDFIO.hh" +#endif +#ifdef WITH_HDF5 +#include "H5IO.hh" +#endif char *programname; void usage(){ @@ -19,8 +24,10 @@ int main(int argc,char *argv[]){ int i,swap; int sindex=0,dindex=0,findex=0; IObase *infile,*outfile; - HDFIO *hdffile; +#ifdef WITH_HDF4 + HDFIO *hdffile = NULL; int hdfin=0; +#endif for(i=1;iisValid()){ @@ -49,7 +63,15 @@ int main(int argc,char *argv[]){ // for the outfile, if(d_ext && !strcmp(d_ext,".hdf")) + { outfile=new HDFIO(argv[dindex],IObase::Create); + } +#ifdef WITH_HDF5 + else if(d_ext && !strcmp(d_ext,".h5")) + { + outfile=new H5IO(argv[dindex],IObase::Create); + } +#endif else // assume its raw outfile=new IEEEIO(argv[dindex],IObase::Create,swap); // swap only affects IEEEIO output if(!outfile->isValid()){ @@ -64,7 +86,9 @@ int main(int argc,char *argv[]){ IObase::DataType type; char *data; infile->seek(i); +#ifdef WITH_HDF4 if(hdfin && hdffile->isCoord()) continue; // skip coord vars +#endif fprintf(stderr,".%u",i); infile->readInfo(type,rank,dims); { -- cgit v1.2.3