0.07.18
C++ Open Travel Request Parsing Library
Loading...
Searching...
No Matches
PORParser.cpp
Go to the documentation of this file.
1
// //////////////////////////////////////////////////////////////////////
2
// Import section
3
// //////////////////////////////////////////////////////////////////////
4
// STL
5
#include <cassert>
6
#include <string>
7
// OpenTREP
8
#include <
opentrep/basic/BasFileMgr.hpp
>
9
#include <
opentrep/bom/PORParserHelper.hpp
>
10
#include <
opentrep/command/PORParser.hpp
>
11
#include <
opentrep/service/Logger.hpp
>
12
13
namespace
OPENTREP
{
14
15
// //////////////////////////////////////////////////////////////////////
16
void
PORParser::PORGeneration
(
const
PORFilePath_T
& iPORFilename) {
17
18
// Check that the file path given as input corresponds to an actual file
19
const
bool
doesExistAndIsReadable =
20
BasFileMgr::doesExistAndIsReadable
(iPORFilename);
21
if
(doesExistAndIsReadable ==
false
) {
22
OPENTREP_LOG_ERROR
(
"The POR input file, '"
<< iPORFilename
23
<<
"', can not be retrieved on the file-system"
);
24
throw
FileNotFoundException
(
"The POR input file '"
+ iPORFilename
25
+
"' does not exist or can not be read"
);
26
}
27
28
// Initialise the POR file parser.
29
PORFileParser
lPorFileParser (iPORFilename);
30
31
// Parse the CSV-formatted POR input file and generate the corresponding
32
// POR structures.
33
lPorFileParser.
generateLocations
();
34
}
35
36
}
BasFileMgr.hpp
Logger.hpp
OPENTREP_LOG_ERROR
#define OPENTREP_LOG_ERROR(iToBeLogged)
Definition
Logger.hpp:24
PORParserHelper.hpp
PORParser.hpp
OPENTREP::FileNotFoundException
Definition
OPENTREP_exceptions.hpp:145
OPENTREP::PORFileParser
Definition
PORParserHelper.hpp:727
OPENTREP::PORFileParser::generateLocations
void generateLocations()
Definition
PORParserHelper.cpp:1816
OPENTREP::PORParser::PORGeneration
static void PORGeneration(const PORFilePath_T &)
Definition
PORParser.cpp:16
OPENTREP
Definition
BasChronometer.cpp:10
OPENTREP::BasFileMgr::doesExistAndIsReadable
static bool doesExistAndIsReadable(const std::string &iFilepath)
Definition
BasFileMgr.cpp:23
OPENTREP::PORFilePath_T
Definition
OPENTREP_Types.hpp:37
Generated on Mon May 5 2025 00:00:00 for OpenTREP by
1.13.2