AirTSP Logo  1.01.0
C++ Simulated Airline Travel Solution Provider 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 #include <stdair/service/Logger.hpp>
11 // AirTSP
15 
16 namespace AIRTSP {
17 
18  // //////////////////////////////////////////////////////////////////////
20  (const stdair::ScheduleFilePath& iScheduleFilename,
21  stdair::BomRoot& ioBomRoot) {
22 
23  const stdair::Filename_T lFilename = iScheduleFilename.name();
24 
25  // Check that the file path given as input corresponds to an actual file
26  const bool doesExistAndIsReadable =
27  stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
28 
29  if (doesExistAndIsReadable == false) {
30  STDAIR_LOG_ERROR ("The schedule input file, '" << lFilename
31  << "', can not be retrieved on the file-system");
32  throw ScheduleInputFileNotFoundException ("The schedule file " + lFilename
33  + " does not exist or can not "
34  "be read");
35  }
36 
37  // Initialise the Flight-Period file parser.
38  FlightPeriodFileParser lFlightPeriodParser (ioBomRoot, lFilename);
39 
40  // Parse the CSV-formatted schedule input file, and generate the
41  // corresponding Inventories for the airlines.
42  lFlightPeriodParser.generateInventories();
43  }
44 
45 }