1.00.15
C++ Simulated Airline Inventory Management System 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 <sstream>
7
// StdAir
8
#include <stdair/basic/BasFileMgr.hpp>
9
#include <stdair/bom/BomRoot.hpp>
10
#include <stdair/service/Logger.hpp>
11
// Airinv
12
#include <
airinv/command/ScheduleParserHelper.hpp
>
13
#include <
airinv/command/ScheduleParser.hpp
>
14
#include <
airinv/command/InventoryManager.hpp
>
15
16
namespace
AIRINV
{
17
18
// //////////////////////////////////////////////////////////////////////
19
void
ScheduleParser::
20
generateInventories
(
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
bool
doesExistAndIsReadable =
27
stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
28
if
(doesExistAndIsReadable ==
false
) {
29
std::ostringstream oMessage;
30
oMessage <<
"The schedule input file, '"
<< lFilename
31
<<
"', can not be retrieved on the file-system"
;
32
STDAIR_LOG_ERROR (oMessage.str());
33
throw
ScheduleInputFileNotFoundException
(oMessage.str());
34
}
35
36
// Initialise the Flight-Period file parser.
37
FlightPeriodFileParser
lFlightPeriodParser (ioBomRoot, lFilename);
38
39
// Parse the CSV-formatted schedule input file, and generate the
40
// corresponding Inventories for the airlines.
41
lFlightPeriodParser.
generateInventories
();
42
43
}
44
45
}
InventoryManager.hpp
ScheduleParserHelper.hpp
ScheduleParser.hpp
AIRINV::FlightPeriodFileParser
Definition
ScheduleParserHelper.hpp:325
AIRINV::FlightPeriodFileParser::generateInventories
bool generateInventories()
Definition
ScheduleParserHelper.cpp:730
AIRINV::ScheduleInputFileNotFoundException
Definition
AIRINV_Types.hpp:118
AIRINV::ScheduleParser::generateInventories
static void generateInventories(const stdair::ScheduleFilePath &iScheduleFilename, stdair::BomRoot &)
Definition
ScheduleParser.cpp:20
AIRINV
Definition
AIRINV_Master_Service.hpp:38
Generated on
for AirInv by
1.17.0