qci2xyz.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             << "qciToxyz qciFileName xyzFileName"<< 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::ifstream qciFile ;
00021   std::ofstream xyzFile , infoFile;
00022   std::string qciFileName(argv[1]), xyzFileName(argv[2]) ;
00023   //
00024   setOfAtoms atoms ;
00025   //
00026   // Ouverture des fichiers
00027   //
00028   qciFile.open(qciFileName.c_str()) ;
00029   if(  ! qciFile  ) {
00030     std::cerr <<" Le fichier "<<qciFileName << " n'existe pas. " <<std::endl;
00031     exit(1) ;}
00032   //
00033   atoms.readQCIFile(qciFile) ; 
00034   qciFile.close();
00035   //
00036   //
00037   //  Sauvegarde au format XYZ
00038   //
00039   xyzFile.open(xyzFileName.c_str());
00040   atoms.writeXYZFile(xyzFile) ;
00041   xyzFile.close();
00042   //
00043   std::cout << "end of program qci2xyz"<<std::endl ;
00044   return 0; 
00045 }

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