/***************************************************************************
 *   Copyright (C) 2004 by Armando Navarro                                 *
 *   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 GAUSSIANPARSER_H
#define GAUSSIANPARSER_H

/**
@author Armando Navarro-Vázquez
*/
#include <fstream>
#include <vector>

#include "quantumparser.h"

class CMolecule;
class KRYOPARSERS_EXPORT GaussianParser : public QuantumParser
{
public:
  GaussianParser(const char* file);
  GaussianParser(std::istream* stream);

  ~GaussianParser();

  /** Do the parsering and get all data*/
  bool ParseFile(std::streampos pos=0);
  virtual bool ParseFrequencies( std::streampos pos=0);
  bool ParseUV(std::streampos pos=0);
  bool ParseAIM(std::streampos pos=0);
  bool ParseNMR(std::streampos pos=0);
  /** Get the different jobs */
  virtual std::vector<Quantum::jobheader>& GetJobs();
private:
  bool HasKeyword(std::string& line);
  bool ParseArquive(std::streampos pos=0);
  void GetCouplingConstants();

  bool GetVectors();
  bool GetFrequencies();
  bool GetGeometry();
  void GetForces(CMolecule& molecule);
  bool GetDipole(const std::streampos& begin,const std::streampos& end);
  bool GetESPCharges(const std::streampos& begin, const std::streampos& end);
  Quantum::level GetLevel();
  int scounter;

};

#endif
