1.00.13
C++ Simulated Fare Quote System Library
Toggle main menu visibility
Loading...
Searching...
No Matches
FareParser.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/service/Logger.hpp>
10
// AirSched
11
#include <
simfqt/command/FareParserHelper.hpp
>
12
#include <
simfqt/command/FareParser.hpp
>
13
14
namespace
SIMFQT
{
15
16
// //////////////////////////////////////////////////////////////////////
17
void
FareParser::fareRuleGeneration
(
const
FareFilePath
& iFareFilename,
18
stdair::BomRoot& ioBomRoot) {
19
20
const
stdair::Filename_T lFilename = iFareFilename.name();
21
22
// Check that the file path given as input corresponds to an actual file
23
const
bool
doesExistAndIsReadable =
24
stdair::BasFileMgr::doesExistAndIsReadable (lFilename);
25
if
(doesExistAndIsReadable ==
false
) {
26
STDAIR_LOG_ERROR (
"The fare input file, '"
<< lFilename
27
<<
"', can not be retrieved on the file-system"
);
28
throw
FareInputFileNotFoundException
(
"The fare input file '"
+ lFilename
29
+
"' does not exist or can not "
30
"be read"
);
31
}
32
33
// Initialise the fare file parser.
34
FareRuleFileParser
lFareRuleFileParser (ioBomRoot, lFilename);
35
36
// Parse the CSV-formatted fare input file and generate the
37
// corresponding fare rules.
38
lFareRuleFileParser.
generateFareRules
();
39
40
}
41
42
}
FareParserHelper.hpp
FareParser.hpp
SIMFQT::FareFilePath
Definition
SIMFQT_Types.hpp:130
SIMFQT::FareInputFileNotFoundException
Definition
SIMFQT_Types.hpp:111
SIMFQT::FareParser::fareRuleGeneration
static void fareRuleGeneration(const FareFilePath &, stdair::BomRoot &)
Definition
FareParser.cpp:17
SIMFQT::FareRuleFileParser
Definition
FareParserHelper.hpp:254
SIMFQT::FareRuleFileParser::generateFareRules
void generateFareRules()
Definition
FareParserHelper.cpp:667
SIMFQT
Definition
BasConst.cpp:7
Generated on
for SimFQT by
1.17.0