AirRAC Logo  1.00.0
C++ Simulated Revenue Accounting (RAC) System Library
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
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 }