/***************************************************************************
 *   Copyright (C) 2004 by Armando Navarro-Vazquez                         *
 *   qoajnv@usc.es                                                         *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef QUANTUMFILE_H
#define QUANTUMFILE_H

/**
@author Armando Navarro-Vazquez
*/
#include <fstream>
#include <istream>

#include "kryoparsers_export.h"

/**This class try to guess the ouput file type */
class KRYOPARSERS_EXPORT QuantumFile {
public:
    QuantumFile(const char* file) { m_file = new std::ifstream(file); m_bstreamcreated=true; }
    QuantumFile(std::istream* stream) : m_file(stream) { m_bstreamcreated= false; }

    ~QuantumFile() { if(m_bstreamcreated) delete m_file; };
    
    enum qfiletype { None, Gaussian, GaussianArchive, Aces, Gamess, NwChem, MacroModel, Mol, Psi3, PDB, XYZ, Tinker, CPMD, MacroModelDyn, MacroModelMaestro };
    
    qfiletype GetFileType();
    
private:
  std::istream* m_file;
  bool m_bstreamcreated;

};

#endif
