OpenTREP Logo  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
12
13namespace 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 =
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}
#define OPENTREP_LOG_ERROR(iToBeLogged)
Definition Logger.hpp:24
static void PORGeneration(const PORFilePath_T &)
Definition PORParser.cpp:16
static bool doesExistAndIsReadable(const std::string &iFilepath)