AirRAC Logo  1.00.3
C++ Simulated Revenue Accounting (RAC) System Library
YieldParser.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <string>
7 // StdAir
8 #include <stdair/basic/BasFileMgr.hpp>
9 // AirRAC
12 
13 namespace AIRRAC {
14 
15  // //////////////////////////////////////////////////////////////////////
16  void YieldParser::generateYieldStore (const YieldFilePath& iYieldFilename,
17  stdair::BomRoot& ioBomRoot) {
18 
19  const stdair::Filename_T lFilename = iYieldFilename.name();
20 
21  // Check that the file path given as input corresponds to an actual file
22  const bool doesExistAndIsReadable =
23  stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
24  if (doesExistAndIsReadable == false) {
25  STDAIR_LOG_ERROR ("The yield input file, '" << lFilename
26  << "', can not be retrieved on the file-system");
27  throw YieldInputFileNotFoundException ("The yield file '" + lFilename
28  + "' does not exist or can not "
29  "be read");
30  }
31 
32  // Initialise the yield file parser.
33  YieldFileParser lYieldParser (ioBomRoot, lFilename);
34 
35  // Parse the CSV-formatted yield store input file, and generate the
36  // corresponding Yield-related objects.
37  lYieldParser.generateYieldStore();
38  }
39 }
AIRRAC::YieldInputFileNotFoundException
Definition: AIRRAC_Types.hpp:61
AIRRAC::YieldFileParser
Definition: YieldParserHelper.hpp:202
AIRRAC::YieldFilePath
Definition: AIRRAC_Types.hpp:82
AIRRAC::YieldParser::generateYieldStore
static void generateYieldStore(const YieldFilePath &, stdair::BomRoot &)
Definition: YieldParser.cpp:16
YieldParserHelper.hpp
YieldParser.hpp
AIRRAC
Definition: AIRRAC_Service.hpp:22
AIRRAC::YieldFileParser::generateYieldStore
void generateYieldStore()
Definition: YieldParserHelper.cpp:529