//-----------------------------------------------------------------------------
//
// FileIO.h
//
// Sean Ho
// Mar2000
//
// Miscellaneous functions using IRISReader and its subclasses.
//-----------------------------------------------------------------------------

#ifndef IRIS_FILEIO_H
#define IRIS_FILEIO_H

#include <stdlib.h>
#include <string.h>

#include "IrisTypes.h"
#include "IRISReader.h"
#include "GiplReader.h"

#define GzipCommand	"|gzip -cf > %s"
#define GunzipCommand	"|gzip -cdfq %s"
#define CompressCommand	"|compress -c > %s"
#define UncompressCommand "|uncompress -c %s"

class FileIO {
public:

  // Look at file extension and subclass IRISReader
  static IRISReader* GetFileReader(char *filename);

  // Figure out how long the header is (in bytes)
  static int GetHeaderSize(char *filename);

  // Extract header info in the given file
  static int ParseHeader(char *filename, 
	int &headersize, int &elen, int &emin, int &emax, 
	Coord3i &dims, Coord3f &scale, Coord3i &origin) ;
};

#endif /* IRIS_FILEIO_H */
