$treeview $search $mathjax
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/FFDisutilityParserHelper.hpp> 00013 #include <airinv/command/FFDisutilityParser.hpp> 00014 #include <airinv/command/InventoryManager.hpp> 00015 00016 namespace AIRINV { 00017 00018 // ////////////////////////////////////////////////////////////////////// 00019 void FFDisutilityParser:: 00020 parse (const stdair::FFDisutilityFilePath& iFFDisutilityFilename, 00021 stdair::BomRoot& ioBomRoot) { 00022 00023 const stdair::Filename_T lFilename = iFFDisutilityFilename.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 FF disutility input file, '" << lFilename 00031 << "', can not be retrieved on the file-system"; 00032 STDAIR_LOG_ERROR (oMessage.str()); 00033 throw FFDisutilityInputFileNotFoundException (oMessage.str()); 00034 } 00035 00036 // Initialise the FFDisutility file parser. 00037 FFDisutilityFileParser lFFDisutilityParser (ioBomRoot, lFilename); 00038 00039 // Parse the CSV-formatted FFDisutility input file, and generate the 00040 // corresponding FFDisutility curves. 00041 lFFDisutilityParser.generateFFDisutilityCurves (); 00042 } 00043 }