AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OnDParser.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 // StdAir
7 #include <stdair/basic/BasFileMgr.hpp>
8 #include <stdair/bom/BomRoot.hpp>
9 // AirSched
12 
13 namespace AIRSCHED {
14 
15  // //////////////////////////////////////////////////////////////////////
16  void OnDParser::generateOnDPeriods (const stdair::Filename_T& iFilename,
17  stdair::BomRoot& ioBomRoot) {
18 
19  // Check that the file path given as input corresponds to an actual file
20  const bool doesExistAndIsReadable =
21  stdair::BasFileMgr::doesExistAndIsReadable (iFilename);
22 
23  if (doesExistAndIsReadable == false) {
24  throw OnDInputFileNotFoundException ("The O&D file " + iFilename
25  + " does not exist or can not be "
26  "read");
27  }
28 
29  // Initialise the O&D-Period file parser.
30  OnDPeriodFileParser lOnDPeriodParser (iFilename, ioBomRoot);
31 
32  // Parse the CSV-formatted O&D input file, and generate the
33  // corresponding O&D-Period for the airlines.
34  lOnDPeriodParser.generateOnDPeriods();
35  }
36 
37 }