$treeview $search $mathjax
AirInv Logo  1.00.1
$projectbrief
$projectbrief
$searchbox

FRAT5Parser.cpp

Go to the documentation of this file.
00001 // //////////////////////////////////////////////////////////////////////
00002 // Import section
00003 // //////////////////////////////////////////////////////////////////////
00004 // STL
00005 #include <cassert>
00006 #include <sstream>
00007 // StdAir
00008 #include <stdair/basic/BasFileMgr.hpp>
00009 #include <stdair/bom/BomRoot.hpp>
00010 #include <stdair/service/Logger.hpp>
00011 // Airinv
00012 #include <airinv/command/FRAT5ParserHelper.hpp>
00013 #include <airinv/command/FRAT5Parser.hpp>
00014 #include <airinv/command/InventoryManager.hpp>
00015 
00016 namespace AIRINV {
00017 
00018   // //////////////////////////////////////////////////////////////////////
00019   void FRAT5Parser::
00020   parse (const stdair::FRAT5FilePath& iFRAT5Filename,
00021          stdair::BomRoot& ioBomRoot) {
00022 
00023     const stdair::Filename_T lFilename = iFRAT5Filename.name();
00024 
00025     // Check that the file path given as input corresponds to an actual file
00026     bool doesExistAndIsReadable =
00027       stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
00028     if (doesExistAndIsReadable == false) {
00029       std::ostringstream oMessage;
00030       oMessage << "The FRAT5 input file, '" << lFilename
00031                << "', can not be retrieved on the file-system";
00032       STDAIR_LOG_ERROR (oMessage.str());
00033       throw FRAT5InputFileNotFoundException (oMessage.str());
00034     }
00035 
00036     // Initialise the FRAT5 file parser.
00037     FRAT5FileParser lFRAT5Parser (ioBomRoot, lFilename);
00038 
00039     // Parse the CSV-formatted FRAT5 input file, and generate the
00040     // corresponding FRAT5 curves.
00041     lFRAT5Parser.generateFRAT5Curves ();
00042   }
00043 }