00001 #include <stdlib.h>
00002 #include <fstream>
00003 #include <iostream>
00004
00005 #include "Atoms.h"
00006
00007 void usage()
00008 {
00009 std::cout << "Wrong number of arguments " << std::endl
00010 << "xyz2qci xyzFileName qciFileName"<< std::endl
00011 <<std::endl;
00012 exit(1) ;
00013 }
00014
00015
00016
00017 int main(int argc, char* argv[] ){
00018
00019 if(argc != 3){ usage() ; }
00020 std::ofstream qciFile ;
00021 std::ifstream xyzFile ;
00022 std::string qciFileName(argv[2]), xyzFileName(argv[1]) ;
00023
00024 setOfAtoms atoms ;
00025
00026
00027
00028 xyzFile.open(xyzFileName.c_str());
00029 if( ! xyzFile ) {
00030 std::cerr <<" Le fichier "<<xyzFileName << " n'existe pas. " <<std::endl;
00031 exit(1) ;}
00032 atoms.readXYZFile(xyzFile) ;
00033 xyzFile.close();
00034
00035
00036
00037 qciFile.open(qciFileName.c_str()) ;
00038 atoms.writeQCIFile(qciFile) ;
00039 qciFile.close();
00040
00041
00042 std::cout << "end of program xyz2qci "<<std::endl ;
00043 return 0;
00044 }