AirTSP Logo  1.01.11
C++ Simulated Airline Travel Solution Provider (TSP) Library
Loading...
Searching...
No Matches
OnDParserHelper.hpp
Go to the documentation of this file.
1#ifndef __AIRTSP_CMD_ONDPARSERHELPER_HPP
2#define __AIRTSP_CMD_ONDPARSERHELPER_HPP
3
4// //////////////////////////////////////////////////////////////////////
5// Import section
6// //////////////////////////////////////////////////////////////////////
7// STL
8#include <string>
9// Boost (Extended STL)
10#include <boost/date_time/posix_time/posix_time.hpp>
11#include <boost/date_time/gregorian/gregorian.hpp>
12// StdAir
13#include <stdair/command/CmdAbstract.hpp>
14// AirTSP
18
19// Forward declarations
20namespace stdair {
21 class BomRoot;
22}
23
24namespace AIRTSP {
25
26 namespace OnDParserHelper {
27
28 // ///////////////////////////////////////////////////////////////////////
29 //
30 // Semantic actions
31 //
32 // ///////////////////////////////////////////////////////////////////////
40
46 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
47 };
48
54 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
55 };
56
64
70 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
71 };
72
80
86 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
87 };
88
94 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
95 };
96
102 void operator() (char iChar) const;
103 };
104
108 doEndOnD (stdair::BomRoot&, OnDPeriodStruct&);
110 void operator() (iterator_t iStr, iterator_t iStrEnd) const;
112 stdair::BomRoot& _bomRoot;
113 };
114
116 //
117 // (Boost Spirit) Grammar Definition
118 //
120
125
127 struct OnDParser :
128 public boost::spirit::classic::grammar<OnDParser> {
129
130 OnDParser (stdair::BomRoot&, OnDPeriodStruct&);
131
132 template <typename ScannerT>
133 struct definition {
134 definition (OnDParser const& self);
135
136 // Instantiation of rules
137 boost::spirit::classic::rule<ScannerT> ond_list, ond, segment,
139
141 boost::spirit::classic::rule<ScannerT> const& start() const;
142 };
143
144 // Parser Context
145 stdair::BomRoot& _bomRoot;
147 };
148 }
149
151 //
152 // Entry class for the file parser
153 //
155
160
161 class OnDPeriodFileParser : public stdair::CmdAbstract {
162 public:
164 OnDPeriodFileParser (const stdair::Filename_T& iFilename,
165 stdair::BomRoot& ioBomRoot);
166
168 bool generateOnDPeriods ();
169
170 private:
172 void init();
173
174 private:
175 // Attributes
177 stdair::Filename_T _filename;
178
180 iterator_t _startIterator;
181
183 iterator_t _endIterator;
184
186 stdair::BomRoot& _bomRoot;
187
189 OnDPeriodStruct _onDPeriod;
190 };
191
192}
193#endif // __AIRTSP_CMD_ONDPARSERHELPER_HPP
OnDPeriodFileParser(const stdair::Filename_T &iFilename, stdair::BomRoot &ioBomRoot)
boost::spirit::classic::file_iterator< char_t > iterator_t
Forward declarations.
boost::spirit::classic::rule< ScannerT > ond_list
boost::spirit::classic::rule< ScannerT > date
boost::spirit::classic::rule< ScannerT > time
boost::spirit::classic::rule< ScannerT > ond_end
boost::spirit::classic::rule< ScannerT > const & start() const
boost::spirit::classic::rule< ScannerT > ond
boost::spirit::classic::rule< ScannerT > ond_key
boost::spirit::classic::rule< ScannerT > segment
OnDParser(stdair::BomRoot &, OnDPeriodStruct &)
doEndOnD(stdair::BomRoot &, OnDPeriodStruct &)
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const
void operator()(iterator_t iStr, iterator_t iStrEnd) const