OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PORParserHelper.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_CMD_PORPARSERHELPER_HPP
2 #define __OPENTREP_CMD_PORPARSERHELPER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <string>
9 // Boost
10 #include <boost/spirit/include/qi.hpp>
11 // Opentrep
13 #include <opentrep/Location.hpp>
14 
15 namespace OPENTREP {
16 
17  namespace PorParserHelper {
18 
20  //typedef char uchar_t;
21  typedef boost::uint32_t uchar_t;
22 
23 
24  // ///////////////////////////////////////////////////////////////////
25  // Semantic actions
26  // ////////////////////////////////////////////////////
28 
34  };
35 
41  void operator() (std::vector<uchar_t>,
42  boost::spirit::qi::unused_type,
43  boost::spirit::qi::unused_type) const;
44  };
45 
51  void operator() (std::vector<uchar_t>,
52  boost::spirit::qi::unused_type,
53  boost::spirit::qi::unused_type) const;
54  };
55 
61  void operator() (std::vector<uchar_t>,
62  boost::spirit::qi::unused_type,
63  boost::spirit::qi::unused_type) const;
64  };
65 
71  void operator() (unsigned int,
72  boost::spirit::qi::unused_type,
73  boost::spirit::qi::unused_type) const;
74  };
75 
81  void operator() (unsigned int,
82  boost::spirit::qi::unused_type,
83  boost::spirit::qi::unused_type) const;
84  };
85 
91  void operator() (std::vector<uchar_t>,
92  boost::spirit::qi::unused_type,
93  boost::spirit::qi::unused_type) const;
94  };
95 
101  void operator() (std::vector<uchar_t>,
102  boost::spirit::qi::unused_type,
103  boost::spirit::qi::unused_type) const;
104  };
105 
111  void operator() (std::vector<uchar_t>,
112  boost::spirit::qi::unused_type,
113  boost::spirit::qi::unused_type) const;
114  };
115 
121  void operator() (boost::spirit::qi::unused_type,
122  boost::spirit::qi::unused_type,
123  boost::spirit::qi::unused_type) const;
124  };
125 
131  void operator() (std::vector<uchar_t>,
132  boost::spirit::qi::unused_type,
133  boost::spirit::qi::unused_type) const;
134  };
135 
141  void operator() (boost::spirit::qi::unused_type,
142  boost::spirit::qi::unused_type,
143  boost::spirit::qi::unused_type) const;
144  };
145 
151  void operator() (double,
152  boost::spirit::qi::unused_type,
153  boost::spirit::qi::unused_type) const;
154  };
155 
161  void operator() (double,
162  boost::spirit::qi::unused_type,
163  boost::spirit::qi::unused_type) const;
164  };
165 
171  void operator() (std::vector<uchar_t>,
172  boost::spirit::qi::unused_type,
173  boost::spirit::qi::unused_type) const;
174  };
175 
181  void operator() (std::vector<uchar_t>,
182  boost::spirit::qi::unused_type,
183  boost::spirit::qi::unused_type) const;
184  };
185 
191  void operator() (double,
192  boost::spirit::qi::unused_type,
193  boost::spirit::qi::unused_type) const;
194  };
195 
201  void operator() (boost::spirit::qi::unused_type,
202  boost::spirit::qi::unused_type,
203  boost::spirit::qi::unused_type) const;
204  };
205 
211  void operator() (boost::spirit::qi::unused_type,
212  boost::spirit::qi::unused_type,
213  boost::spirit::qi::unused_type) const;
214  };
215 
221  void operator() (std::vector<uchar_t>,
222  boost::spirit::qi::unused_type,
223  boost::spirit::qi::unused_type) const;
224  };
225 
231  void operator() (std::vector<uchar_t>,
232  boost::spirit::qi::unused_type,
233  boost::spirit::qi::unused_type) const;
234  };
235 
241  void operator() (std::vector<uchar_t>,
242  boost::spirit::qi::unused_type,
243  boost::spirit::qi::unused_type) const;
244  };
245 
251  void operator() (std::vector<uchar_t>,
252  boost::spirit::qi::unused_type,
253  boost::spirit::qi::unused_type) const;
254  };
255 
261  void operator() (std::vector<uchar_t>,
262  boost::spirit::qi::unused_type,
263  boost::spirit::qi::unused_type) const;
264  };
265 
271  void operator() (std::vector<uchar_t>,
272  boost::spirit::qi::unused_type,
273  boost::spirit::qi::unused_type) const;
274  };
275 
281  void operator() (std::vector<uchar_t>,
282  boost::spirit::qi::unused_type,
283  boost::spirit::qi::unused_type) const;
284  };
285 
291  void operator() (std::vector<uchar_t>,
292  boost::spirit::qi::unused_type,
293  boost::spirit::qi::unused_type) const;
294  };
295 
301  void operator() (std::vector<uchar_t>,
302  boost::spirit::qi::unused_type,
303  boost::spirit::qi::unused_type) const;
304  };
305 
311  void operator() (std::vector<uchar_t>,
312  boost::spirit::qi::unused_type,
313  boost::spirit::qi::unused_type) const;
314  };
315 
321  void operator() (std::vector<uchar_t>,
322  boost::spirit::qi::unused_type,
323  boost::spirit::qi::unused_type) const;
324  };
325 
331  void operator() (std::vector<uchar_t>,
332  boost::spirit::qi::unused_type,
333  boost::spirit::qi::unused_type) const;
334  };
335 
341  void operator() (std::vector<uchar_t>,
342  boost::spirit::qi::unused_type,
343  boost::spirit::qi::unused_type) const;
344  };
345 
351  void operator() (unsigned int,
352  boost::spirit::qi::unused_type,
353  boost::spirit::qi::unused_type) const;
354  };
355 
361  void operator() (int,
362  boost::spirit::qi::unused_type,
363  boost::spirit::qi::unused_type) const;
364  };
365 
371  void operator() (int,
372  boost::spirit::qi::unused_type,
373  boost::spirit::qi::unused_type) const;
374  };
375 
381  void operator() (std::vector<uchar_t>,
382  boost::spirit::qi::unused_type,
383  boost::spirit::qi::unused_type) const;
384  };
385 
391  void operator() (float,
392  boost::spirit::qi::unused_type,
393  boost::spirit::qi::unused_type) const;
394  };
395 
401  void operator() (float,
402  boost::spirit::qi::unused_type,
403  boost::spirit::qi::unused_type) const;
404  };
405 
411  void operator() (float,
412  boost::spirit::qi::unused_type,
413  boost::spirit::qi::unused_type) const;
414  };
415 
421  void operator() (boost::spirit::qi::unused_type,
422  boost::spirit::qi::unused_type,
423  boost::spirit::qi::unused_type) const;
424  };
425 
431  void operator() (std::vector<uchar_t>,
432  boost::spirit::qi::unused_type,
433  boost::spirit::qi::unused_type) const;
434  };
435 
441  void operator() (std::vector<uchar_t>,
442  boost::spirit::qi::unused_type,
443  boost::spirit::qi::unused_type) const;
444  };
445 
451  void operator() (std::vector<uchar_t>,
452  boost::spirit::qi::unused_type,
453  boost::spirit::qi::unused_type) const;
454  };
455 
461  void operator() (unsigned int,
462  boost::spirit::qi::unused_type,
463  boost::spirit::qi::unused_type) const;
464  };
465 
471  void operator() (std::vector<uchar_t>,
472  boost::spirit::qi::unused_type,
473  boost::spirit::qi::unused_type) const;
474  };
475 
481  void operator() (std::vector<uchar_t>,
482  boost::spirit::qi::unused_type,
483  boost::spirit::qi::unused_type) const;
484  };
485 
486 
492  void operator() (std::vector<uchar_t>,
493  boost::spirit::qi::unused_type,
494  boost::spirit::qi::unused_type) const;
495  };
496 
502  void operator() (std::vector<boost::uint32_t>,
503  boost::spirit::qi::unused_type,
504  boost::spirit::qi::unused_type) const;
505  };
506 
512  void operator() (std::vector<boost::uint32_t>,
513  boost::spirit::qi::unused_type,
514  boost::spirit::qi::unused_type) const;
515  };
516 
522  void operator() (std::vector<boost::uint32_t>,
523  boost::spirit::qi::unused_type,
524  boost::spirit::qi::unused_type) const;
525  };
526 
532  void operator() (std::vector<boost::uint32_t>,
533  boost::spirit::qi::unused_type,
534  boost::spirit::qi::unused_type) const;
535  };
536 
542  void operator() (std::vector<boost::uint32_t>,
543  boost::spirit::qi::unused_type,
544  boost::spirit::qi::unused_type) const;
545  };
546 
548  struct doEndPor : public ParserSemanticAction {
550  doEndPor (Location&);
552  void operator() (boost::spirit::qi::unused_type,
553  boost::spirit::qi::unused_type,
554  boost::spirit::qi::unused_type) const;
555  };
556 
557  }
558 
559 
561  //
562  // Entry class for the string parser
563  //
565 
573  public:
577  PORStringParser (const std::string& iString);
578 
583 
587  const Location& generateLocation();
588 
589  private:
593  void init();
594 
595  private:
596  // Attributes
600  std::string _string;
601 
605  Location _location;
606  };
607 
608 
610  //
611  // Entry class for the file parser
612  //
614 
622  public:
626  PORFileParser (const PORFilePath_T& iFilename);
627 
631  void generateLocations();
632 
633  private:
637  void init();
638 
639  private:
640  // Attributes
644  PORFilePath_T _filename;
645 
649  Location _location;
650  };
651 
652 }
653 #endif // __OPENTREP_CMD_PORPARSERHELPER_HPP
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
Structure modelling a (geographical) location.
Definition: Location.hpp:24
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
PORStringParser(const std::string &iString)
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(float, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(float, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
PORFileParser(const PORFilePath_T &iFilename)
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
const Location & generateLocation()
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(float, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const