#ifndef PRM_INPUT_FILE_READER_HH
#define PRM_INPUT_FILE_READER_HH

#include <string>
#include <vector>
#include <map>
#include <iostream>
#include <sstream>
#include <fstream>

#include "ParticleRotor.hh"
#include "Nilsson.hh"
#include "LevelScheme.hh"

namespace PRM {
  class Log {
  private:
    std::ofstream ofile;
    std::ostream *os;
  public:
    Log(std::ostream& stream = std::cout); 
    Log(std::string filename);
    ~Log();
    void Open(std::string filename);
    void Close();
    std::ostream& GetLog();
  };

  class InputFileReader {
  public:
    std::map<std::string, std::vector<std::string> > fLines;
    Log fLog;
    bool fOpened;

    Nilsson *poscalc;
    Nilsson *negcalc;

    Pairing *paircalc;

    ParticleRotor *partrotorpos;
    ParticleRotor *partrotorneg;

    LevelScheme *levelscheme;    
    
    InputFileReader(std::string filename);

    double GetDoubleValue(std::string key);
    std::vector<double> GetDoubleValues(std::string key);

    int GetIntegerValue(std::string key);
    std::vector<int> GetIntegerValues(std::string key);

    void RunCalculation();
  };
}

#endif
