| 1 |
/** @file |
/** @file |
| 2 |
* $Source: /home/cvspamela/yoda/techmodel/TechmodelPamelaRun.cpp,v $ |
* $Source: /home/cvsmanager/yoda/techmodel/TechmodelPamelaRun.cpp,v $ |
| 3 |
* $Id: TechmodelPamelaRun.cpp,v 1.7 2004/04/28 09:01:27 nagni Exp $ |
* $Id: TechmodelPamelaRun.cpp,v 1.1.1.1 2004/07/06 12:20:23 kusanagi Exp $ |
| 4 |
* $Author: nagni $ |
* $Author: kusanagi $ |
| 5 |
* |
* |
| 6 |
* Implementation of the TechmodelPamelaRun class. |
* Implementation of the TechmodelPamelaRun class. |
| 7 |
*/ |
*/ |
| 8 |
#include <string> |
#include <string> |
| 9 |
#include <exception> |
#include <exception> |
| 10 |
#include <iostream> |
#include <iostream> |
| 11 |
#include <fstream.h> |
#include <fstream> |
| 12 |
#include <log4cpp/Category.hh> |
#include <log4cxx/logger.h> |
| 13 |
|
|
| 14 |
#include "TechmodelPamelaRun.h" |
#include "TechmodelPamelaRun.h" |
| 15 |
|
|
| 17 |
using namespace pamela::techmodel; |
using namespace pamela::techmodel; |
| 18 |
|
|
| 19 |
|
|
| 20 |
|
static log4cxx::LoggerPtr logger = log4cxx::Logger::getLogger(_T("pamela.techmodel.TechmodelPamelaRun")); |
|
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.TechmodelPamelaRun"); |
|
| 21 |
|
|
| 22 |
/** |
/** |
| 23 |
* Create a new Pamela run structure to write the data from the |
* Create a new Pamela run structure to write the data from the |
| 28 |
PamelaRun(fileName, path) { |
PamelaRun(fileName, path) { |
| 29 |
InputFile = new ifstream(fileName.c_str(), std::ios::binary); //inserito ios::binary maurizio 01/03/2004 |
InputFile = new ifstream(fileName.c_str(), std::ios::binary); //inserito ios::binary maurizio 01/03/2004 |
| 30 |
if (!*InputFile){ |
if (!*InputFile){ |
| 31 |
cat << log4cpp::Priority::ERROR |
std::stringstream oss; |
| 32 |
<< "Cannot open file " + fileName |
oss.flush(); |
| 33 |
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
oss << "Cannot open file " << fileName; |
| 34 |
|
logger->error(oss.str().c_str()); |
| 35 |
throw std::exception(); |
throw std::exception(); |
| 36 |
} |
} |
| 37 |
else |
else |