AirSched Logo  0.1.4
C++ Simulated Airline Schedule Manager Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ScheduleParser.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 #include <stdair/bom/BomRoot.hpp>
10 // AirSched
14 
15 namespace AIRSCHED {
16 
17  // //////////////////////////////////////////////////////////////////////
18  void ScheduleParser::generateInventories (const stdair::Filename_T& iFilename,
19  stdair::BomRoot& ioBomRoot) {
20 
21  // Check that the file path given as input corresponds to an actual file
22  const bool doesExistAndIsReadable =
23  stdair::BasFileMgr::doesExistAndIsReadable (iFilename);
24 
25  if (doesExistAndIsReadable == false) {
26  throw ScheduleInputFileNotFoundException ("The schedule file " + iFilename
27  + " does not exist or can not "
28  "be read");
29  }
30 
31  // Initialise the Flight-Period file parser.
32  FlightPeriodFileParser lFlightPeriodParser (ioBomRoot, iFilename);
33 
34  // Parse the CSV-formatted schedule input file, and generate the
35  // corresponding Inventories for the airlines.
36  lFlightPeriodParser.generateInventories();
37 
38  // Build the network from the schedule.
40  }
41 
42 }