0.6.0
C++ Open Travel Request Parsing Library
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
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
}
PORParser.hpp
OPENTREP_LOG_ERROR
#define OPENTREP_LOG_ERROR(iToBeLogged)
Definition:
Logger.hpp:23
OPENTREP::PORParser::PORGeneration
static void PORGeneration(const PORFilePath_T &)
Definition:
PORParser.cpp:16
OPENTREP::PORFileParser
Definition:
PORParserHelper.hpp:621
Logger.hpp
OPENTREP::FileNotFoundException
Definition:
OPENTREP_exceptions.hpp:145
OPENTREP::BasFileMgr::doesExistAndIsReadable
static bool doesExistAndIsReadable(const std::string &iFilepath)
Definition:
BasFileMgr.cpp:23
PORParserHelper.hpp
BasFileMgr.hpp
OPENTREP::PORFileParser::generateLocations
void generateLocations()
Definition:
PORParserHelper.cpp:1573
OPENTREP::PORFilePath_T
Definition:
OPENTREP_Types.hpp:37
Generated on Mon Feb 3 2014 14:17:07 for OpenTREP by
1.8.6