1.01.17
C++ Simulated Airline Travel Solution Provider (TSP) Library
Toggle main menu visibility
Loading...
Searching...
No Matches
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
12
#include <
airtsp/command/SegmentPathGenerator.hpp
>
13
#include <
airtsp/command/ScheduleParserHelper.hpp
>
14
#include <
airtsp/command/ScheduleParser.hpp
>
15
16
namespace
AIRTSP
{
17
18
// //////////////////////////////////////////////////////////////////////
19
void
ScheduleParser::generateInventories
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
}
ScheduleParserHelper.hpp
ScheduleParser.hpp
SegmentPathGenerator.hpp
AIRTSP::FlightPeriodFileParser
Definition
ScheduleParserHelper.hpp:323
AIRTSP::FlightPeriodFileParser::generateInventories
bool generateInventories()
Definition
ScheduleParserHelper.cpp:753
AIRTSP::ScheduleInputFileNotFoundException
Definition
AIRTSP_Types.hpp:48
AIRTSP::ScheduleParser::generateInventories
static void generateInventories(const stdair::ScheduleFilePath &, stdair::BomRoot &)
Definition
ScheduleParser.cpp:20
AIRTSP
Definition
AIRTSP_Service.hpp:23
Generated on
for AirTSP by
1.17.0