$treeview $search $mathjax
SimFQT Logo  1.00.0
$projectbrief
$projectbrief
$searchbox

FareParser.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <string>
00007 // StdAir
00008 #include <stdair/basic/BasFileMgr.hpp>
00009 #include <stdair/service/Logger.hpp>
00010 // AirSched
00011 #include <simfqt/command/FareParserHelper.hpp>
00012 #include <simfqt/command/FareParser.hpp>
00013 
00014 namespace SIMFQT {
00015 
00016   // //////////////////////////////////////////////////////////////////////
00017   void FareParser::fareRuleGeneration (const FareFilePath& iFareFilename,
00018                                        stdair::BomRoot& ioBomRoot) {
00019 
00020     const stdair::Filename_T lFilename = iFareFilename.name();
00021 
00022     // Check that the file path given as input corresponds to an actual file
00023     const bool doesExistAndIsReadable =
00024       stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
00025     if (doesExistAndIsReadable == false) {
00026       STDAIR_LOG_ERROR ("The fare input file, '" << lFilename
00027                         << "', can not be retrieved on the file-system");
00028       throw FareInputFileNotFoundException ("The fare input file '" + lFilename
00029                                             + "' does not exist or can not "
00030                                             "be read");
00031     }
00032 
00033     // Initialise the fare file parser.
00034     FareRuleFileParser lFareRuleFileParser (ioBomRoot, lFilename);
00035 
00036     // Parse the CSV-formatted fare input file and generate the
00037     // corresponding fare rules.
00038     lFareRuleFileParser.generateFareRules ();
00039 
00040   }
00041 
00042 }