xyz2qci.cpp

Go to the documentation of this file.
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 //  Le programme principal
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   // Open XYZ File 
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   //  Sauvegarde au format QCI
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 }

Generated on Sat Jan 28 21:07:30 2006 for QC++ by  doxygen 1.4.4