OpenTREP Logo  0.07.4
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PORParserHelper.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <cassert>
6 #include <vector>
7 #include <fstream>
8 // Boost
9 #include <boost/lexical_cast.hpp>
10 //#define BOOST_SPIRIT_DEBUG
11 #define BOOST_SPIRIT_UNICODE
12 // OpenTREP
16 
17 namespace OPENTREP {
18 
20  namespace bsq = boost::spirit::qi;
21  //namespace bsa = boost::spirit::ascii;
22  namespace bsu = boost::spirit::unicode;
23  namespace bsc = boost::spirit::classic;
24 
25  namespace PorParserHelper {
26 
27  // //////////////////////////////////////////////////////////////////
28  // Semantic actions
29  // //////////////////////////////////////////////////////////////////
30 
32  : _location (ioLocation) {
33  }
34 
35  // //////////////////////////////////////////////////////////////////
37  : ParserSemanticAction (ioLocation) {
38  }
39 
40  // //////////////////////////////////////////////////////////////////
41  void storeIataCode::operator() (std::vector<uchar_t> iChar,
42  bsq::unused_type, bsq::unused_type) const {
43 
44  const std::string lIataCodeStr (iChar.begin(), iChar.end());
45  const OPENTREP::IATACode_T lIataCode (lIataCodeStr);
46  _location.setIataCode (lIataCode);
47 
48  // Reset the values
49  //_location.resetMatrix();
50  //_location._itAltNameShortList.clear();
51 
52  // DEBUG
53  //OPENTREP_LOG_DEBUG ("IATA code: " << _location.getIataCode());
54  }
55 
56  // //////////////////////////////////////////////////////////////////
58  : ParserSemanticAction (ioLocation) {
59  }
60 
61  // //////////////////////////////////////////////////////////////////
62  void storeIcaoCode::operator() (std::vector<uchar_t> iChar,
63  bsq::unused_type, bsq::unused_type) const {
64 
65  const std::string lIcaoCodeStr (iChar.begin(), iChar.end());
66  const OPENTREP::ICAOCode_T lIcaoCode (lIcaoCodeStr);
67  _location.setIcaoCode (lIcaoCode);
68 
69  // DEBUG
70  //OPENTREP_LOG_DEBUG ("ICAO code: " << _location.getIcaoCode());
71  }
72 
73  // //////////////////////////////////////////////////////////////////
75  : ParserSemanticAction (ioLocation) {
76  }
77 
78  // //////////////////////////////////////////////////////////////////
79  void storeFaaCode::operator() (std::vector<uchar_t> iChar,
80  bsq::unused_type, bsq::unused_type) const {
81 
82  const std::string lFaaCodeStr (iChar.begin(), iChar.end());
83  const OPENTREP::FAACode_T lFaaCode (lFaaCodeStr);
84  _location.setFaaCode (lFaaCode);
85 
86  // DEBUG
87  //OPENTREP_LOG_DEBUG ("FAA code: " << _location.getFaaCode());
88  }
89 
90  // //////////////////////////////////////////////////////////////////
92  : ParserSemanticAction (ioLocation) {
93  }
94 
95  // //////////////////////////////////////////////////////////////////
96  void storeUNLOCode::operator() (std::vector<uchar_t> iChar,
97  bsq::unused_type, bsq::unused_type) const {
98 
99  const std::string lUNLOCodeStr (iChar.begin(), iChar.end());
100  _location.addUNLOCode (lUNLOCodeStr);
101 
102  // DEBUG
103  //OPENTREP_LOG_DEBUG ("UN/LOCODE codes: " << _location.describeUNLOCodeList());
104  }
105 
106  // //////////////////////////////////////////////////////////////////
108  : ParserSemanticAction (ioLocation) {
109  }
110 
111  // //////////////////////////////////////////////////////////////////
112  void storeUICCode::operator() (unsigned int iUICCode,
113  bsq::unused_type, bsq::unused_type) const {
114 
115  _location.addUICCode (iUICCode);
116 
117  // DEBUG
118  //OPENTREP_LOG_DEBUG ("UIC codes: " << _location.describeUICCodeList());
119  }
120 
121  // //////////////////////////////////////////////////////////////////
123  : ParserSemanticAction (ioLocation) {
124  }
125 
126  // //////////////////////////////////////////////////////////////////
127  void storeGeonamesID::operator() (unsigned int iPorId,
128  bsq::unused_type, bsq::unused_type) const {
129  _location.setGeonamesID (iPorId);
130 
131  // DEBUG
132  //OPENTREP_LOG_DEBUG ("POR ID: " << _location.getPorID());
133  }
134 
135  // //////////////////////////////////////////////////////////////////
137  : ParserSemanticAction (ioLocation) {
138  }
139 
140  // //////////////////////////////////////////////////////////////////
141  void storeEnvelopeID::operator() (unsigned int iEnvelopeID,
142  bsq::unused_type, bsq::unused_type) const {
143  _location.setEnvelopeID (iEnvelopeID);
144 
145  // DEBUG
146  //OPENTREP_LOG_DEBUG ("Envelope ID: " << _location.getEnvelopeID());
147  }
148 
149  // //////////////////////////////////////////////////////////////////
151  : ParserSemanticAction (ioLocation) {
152  }
153 
154  // //////////////////////////////////////////////////////////////////
155  void storeCommonName::operator() (std::vector<uchar_t> iChar,
156  bsq::unused_type, bsq::unused_type) const {
157 
158  const std::string lCommonNameStr (iChar.begin(), iChar.end());
159  const OPENTREP::CommonName_T lCommonName (lCommonNameStr);
160  _location.setCommonName (lCommonName);
161  // DEBUG
162  //OPENTREP_LOG_DEBUG ("Common name: " << _location.getCommonName());
163  }
164 
165  // //////////////////////////////////////////////////////////////////
167  : ParserSemanticAction (ioLocation) {
168  }
169 
170  // //////////////////////////////////////////////////////////////////
171  void storeAsciiName::operator() (std::vector<uchar_t> iChar,
172  bsq::unused_type, bsq::unused_type) const {
173 
174  const std::string lAsciiNameStr (iChar.begin(), iChar.end());
175  const OPENTREP::ASCIIName_T lAsciiName (lAsciiNameStr);
176  _location.setAsciiName (lAsciiName);
177  // DEBUG
178  //OPENTREP_LOG_DEBUG ("ASCII name: " << _location.getAsciiName());
179  }
180 
181  // //////////////////////////////////////////////////////////////////
183  : ParserSemanticAction (ioLocation) {
184  }
185 
186  // //////////////////////////////////////////////////////////////////
188  operator() (bsq::unused_type, bsq::unused_type, bsq::unused_type) const {
190  // DEBUG
191  //OPENTREP_LOG_DEBUG ("List of served cities: " << _location.describeCityDetailsList());
192  }
193 
194  // //////////////////////////////////////////////////////////////////
196  : ParserSemanticAction (ioLocation) {
197  }
198 
199  // //////////////////////////////////////////////////////////////////
200  void storeAltNameShort::operator() (std::vector<uchar_t> iChar,
201  bsq::unused_type,
202  bsq::unused_type)const {
203 
204  const std::string lAltNameShortStr (iChar.begin(), iChar.end());
205  const OPENTREP::AltNameShortListString_T lAltNameShort (lAltNameShortStr);
206  _location._itAltNameShortList.push_back (lAltNameShort);
207  // DEBUG
208  //OPENTREP_LOG_DEBUG ("Alt name short: " << lAltNameShortStr);
209  }
210 
211  // //////////////////////////////////////////////////////////////////
214  : ParserSemanticAction (ioLocation) {
215  }
216 
217  // //////////////////////////////////////////////////////////////////
219  operator() (bsq::unused_type, bsq::unused_type, bsq::unused_type) const {
221  // DEBUG
222  //OPENTREP_LOG_DEBUG ("Alternative name short list: " << _location.getAltNameShortListString());
223  }
224 
225  // //////////////////////////////////////////////////////////////////
227  : ParserSemanticAction (ioLocation) {
228  }
229 
230  // //////////////////////////////////////////////////////////////////
231  void storeTvlPORCode::operator() (std::vector<uchar_t> iChar,
232  bsq::unused_type,
233  bsq::unused_type)const {
234 
235  const std::string lTvlPORCodeStr (iChar.begin(), iChar.end());
236  const OPENTREP::IATACode_T lTvlPORCode (lTvlPORCodeStr);
237  _location._itTvlPORList.push_back (lTvlPORCode);
238  // DEBUG
239  //OPENTREP_LOG_DEBUG ("Travel-related IATA code: " << lTvlPORCodeStr);
240  }
241 
242  // //////////////////////////////////////////////////////////////////
244  : ParserSemanticAction (ioLocation) {
245  }
246 
247  // //////////////////////////////////////////////////////////////////
248  void storeTvlPORListString::operator() (bsq::unused_type, bsq::unused_type,
249  bsq::unused_type)const {
251  // DEBUG
252  //OPENTREP_LOG_DEBUG ("Travel-related POR list: " << _location.getTvlPORListString());
253  }
254 
255  // //////////////////////////////////////////////////////////////////
257  : ParserSemanticAction (ioLocation) {
258  }
259 
260  // //////////////////////////////////////////////////////////////////
261  void storeLatitude::operator() (double iLatitude,
262  bsq::unused_type, bsq::unused_type) const {
263  _location.setLatitude (iLatitude);
264  // DEBUG
265  //OPENTREP_LOG_DEBUG ("Latitude: " << _location.getLatitude());
266  }
267 
268  // //////////////////////////////////////////////////////////////////
270  : ParserSemanticAction (ioLocation) {
271  }
272 
273  // //////////////////////////////////////////////////////////////////
274  void storeLongitude::operator() (double iLongitude,
275  bsq::unused_type, bsq::unused_type) const {
276  _location.setLongitude (iLongitude);
277 
278  // DEBUG
279  //OPENTREP_LOG_DEBUG ("Longitude: " << _location.getLongitude());
280  }
281 
282  // //////////////////////////////////////////////////////////////////
284  : ParserSemanticAction (ioLocation) {
285  }
286 
287  // //////////////////////////////////////////////////////////////////
288  void storeFeatureClass::operator() (std::vector<uchar_t> iChar,
289  bsq::unused_type,
290  bsq::unused_type) const {
291  const std::string lFeatClassStr (iChar.begin(), iChar.end());
292  const FeatureClass_T lFeatClass (lFeatClassStr);
293  _location.setFeatureClass (lFeatClass);
294 
295  // DEBUG
296  //OPENTREP_LOG_DEBUG ("Feature class: " << _location.getFeatureClass());
297  }
298 
299  // //////////////////////////////////////////////////////////////////
301  : ParserSemanticAction (ioLocation) {
302  }
303 
304  // //////////////////////////////////////////////////////////////////
305  void storeFeatureCode::operator() (std::vector<uchar_t> iChar,
306  bsq::unused_type,
307  bsq::unused_type) const {
308  const std::string lFeatCodeStr (iChar.begin(), iChar.end());
309  const FeatureClass_T lFeatCode (lFeatCodeStr);
310  _location.setFeatureCode (lFeatCode);
311 
312  // DEBUG
313  //OPENTREP_LOG_DEBUG ("Feature code: " << _location.getFeatureCode());
314  }
315 
316  // //////////////////////////////////////////////////////////////////
318  : ParserSemanticAction (ioLocation) {
319  }
320 
321  // //////////////////////////////////////////////////////////////////
322  void storePageRank::operator() (double iPageRank,
323  bsq::unused_type, bsq::unused_type) const {
324  _location.setPageRank (100.0 * iPageRank);
325 
326  // DEBUG
327  //OPENTREP_LOG_DEBUG ("PageRank: " << _location.getPageRank());
328  }
329 
330  // //////////////////////////////////////////////////////////////////
332  : ParserSemanticAction (ioLocation) {
333  }
334 
335  // //////////////////////////////////////////////////////////////////
336  void storeDateFrom::operator() (bsq::unused_type,
337  bsq::unused_type, bsq::unused_type) const {
338  const OPENTREP::Date_T& lDateFrom = _location.calculateDate();
339  _location.setDateFrom (lDateFrom);
340 
341  // DEBUG
342  //OPENTREP_LOG_DEBUG ("Date from: " << _location.getDateFrom());
343  }
344 
345  // //////////////////////////////////////////////////////////////////
347  : ParserSemanticAction (ioLocation) {
348  }
349 
350  // //////////////////////////////////////////////////////////////////
351  void storeDateEnd::operator() (bsq::unused_type,
352  bsq::unused_type, bsq::unused_type) const {
353  const OPENTREP::Date_T& lDateEnd = _location.calculateDate();
354  _location.setDateEnd (lDateEnd);
355 
356  // DEBUG
357  //OPENTREP_LOG_DEBUG ("Date end: " << _location.getDateEnd());
358  }
359 
360  // //////////////////////////////////////////////////////////////////
362  : ParserSemanticAction (ioLocation) {
363  }
364 
365  // //////////////////////////////////////////////////////////////////
366  void storeComments::operator() (std::vector<uchar_t> iChar,
367  bsq::unused_type, bsq::unused_type) const {
368  /*
369  const std::string lCommentsStr (iChar.begin(), iChar.end());
370  const CountryCode_T lComments (lCommentsStr);
371  _location.setComments (lComments);
372  */
373 
374  // DEBUG
375  //OPENTREP_LOG_DEBUG ("Comments: " << _location.getComments());
376  }
377 
378  // //////////////////////////////////////////////////////////////////
380  : ParserSemanticAction (ioLocation) {
381  }
382 
383  // //////////////////////////////////////////////////////////////////
384  void storeCountryCode::operator() (std::vector<uchar_t> iChar,
385  bsq::unused_type,
386  bsq::unused_type) const {
387  const std::string lCountryCodeStr (iChar.begin(), iChar.end());
388  const CountryCode_T lCountryCode (lCountryCodeStr);
389  _location.setCountryCode (lCountryCode);
390  // DEBUG
391  //OPENTREP_LOG_DEBUG ("Country code: " << _location.getCountryCode());
392  }
393 
394  // //////////////////////////////////////////////////////////////////
396  : ParserSemanticAction (ioLocation) {
397  }
398 
399  // //////////////////////////////////////////////////////////////////
400  void storeAltCountryCode::operator() (std::vector<uchar_t> iChar,
401  bsq::unused_type,
402  bsq::unused_type) const {
403  const std::string lCountryCodeStr (iChar.begin(), iChar.end());
404  const CountryCode_T lCountryCode (lCountryCodeStr);
405  _location.setAltCountryCode (lCountryCode);
406  // DEBUG
407  //OPENTREP_LOG_DEBUG ("Alt country code: " << _location.getAltCountryCode());
408  }
409 
410  // //////////////////////////////////////////////////////////////////
412  : ParserSemanticAction (ioLocation) {
413  }
414 
415  // //////////////////////////////////////////////////////////////////
416  void storeCountryName::operator() (std::vector<uchar_t> iChar,
417  bsq::unused_type,
418  bsq::unused_type) const {
419  const std::string lCountryNameStr (iChar.begin(), iChar.end());
420  const CountryName_T lCountryName (lCountryNameStr);
421  _location.setCountryName (lCountryName);
422  // DEBUG
423  //OPENTREP_LOG_DEBUG ("Country name: " << _location.getCountryName());
424  }
425 
426  // //////////////////////////////////////////////////////////////////
428  : ParserSemanticAction (ioLocation) {
429  }
430 
431  // //////////////////////////////////////////////////////////////////
432  void storeContinentName::operator() (std::vector<uchar_t> iChar,
433  bsq::unused_type,
434  bsq::unused_type) const {
435  const std::string lContinentNameStr (iChar.begin(), iChar.end());
436  const ContinentName_T lContinentName (lContinentNameStr);
437  _location.setContinentName (lContinentName);
438  // DEBUG
439  //OPENTREP_LOG_DEBUG ("Continent name: " << _location.getContinentName());
440  }
441 
442  // //////////////////////////////////////////////////////////////////
444  : ParserSemanticAction (ioLocation) {
445  }
446 
447  // //////////////////////////////////////////////////////////////////
448  void storeAdm1Code::operator() (std::vector<uchar_t> iChar,
449  bsq::unused_type,
450  bsq::unused_type) const {
451  const std::string lAdmCodeStr (iChar.begin(), iChar.end());
452  const Admin1Code_T lAdmCode (lAdmCodeStr);
453  _location.setAdmin1Code (lAdmCode);
454  // DEBUG
455  //OPENTREP_LOG_DEBUG ("Adm1 code: " << _location.getAdmin1Code());
456  }
457 
458  // //////////////////////////////////////////////////////////////////
460  : ParserSemanticAction (ioLocation) {
461  }
462 
463  // //////////////////////////////////////////////////////////////////
464  void storeAdm1UtfName::operator() (std::vector<uchar_t> iChar,
465  bsq::unused_type,
466  bsq::unused_type) const {
467  const std::string lAdmNameStr (iChar.begin(), iChar.end());
468  const Admin1UTFName_T lAdmName (lAdmNameStr);
469  _location.setAdmin1UtfName (lAdmName);
470  // DEBUG
471  //OPENTREP_LOG_DEBUG ("Adm1 UTF8 name: " << _location.getAdmin1UtfName());
472  }
473 
474  // //////////////////////////////////////////////////////////////////
476  : ParserSemanticAction (ioLocation) {
477  }
478 
479  // //////////////////////////////////////////////////////////////////
480  void storeAdm1AsciiName::operator() (std::vector<uchar_t> iChar,
481  bsq::unused_type,
482  bsq::unused_type) const {
483  const std::string lAdmNameStr (iChar.begin(), iChar.end());
484  const Admin1ASCIIName_T lAdmName (lAdmNameStr);
485  _location.setAdmin1AsciiName (lAdmName);
486  // DEBUG
487  //OPENTREP_LOG_DEBUG("Adm1 ASCII name: "<< _location.getAdmin1AsciiName());
488  }
489 
490  // //////////////////////////////////////////////////////////////////
492  : ParserSemanticAction (ioLocation) {
493  }
494 
495  // //////////////////////////////////////////////////////////////////
496  void storeAdm2Code::operator() (std::vector<uchar_t> iChar,
497  bsq::unused_type,
498  bsq::unused_type) const {
499  const std::string lAdmCodeStr (iChar.begin(), iChar.end());
500  const Admin2Code_T lAdmCode (lAdmCodeStr);
501  _location.setAdmin2Code (lAdmCode);
502  // DEBUG
503  //OPENTREP_LOG_DEBUG ("Adm2 code: " << _location.getAdmin2Code());
504  }
505 
506  // //////////////////////////////////////////////////////////////////
508  : ParserSemanticAction (ioLocation) {
509  }
510 
511  // //////////////////////////////////////////////////////////////////
512  void storeAdm2UtfName::operator() (std::vector<uchar_t> iChar,
513  bsq::unused_type,
514  bsq::unused_type) const {
515  const std::string lAdmNameStr (iChar.begin(), iChar.end());
516  const Admin2UTFName_T lAdmName (lAdmNameStr);
517  _location.setAdmin2UtfName (lAdmName);
518  // DEBUG
519  //OPENTREP_LOG_DEBUG ("Adm2 UTF8 name: " << _location.getAdmin2UtfName());
520  }
521 
522  // //////////////////////////////////////////////////////////////////
524  : ParserSemanticAction (ioLocation) {
525  }
526 
527  // //////////////////////////////////////////////////////////////////
528  void storeAdm2AsciiName::operator() (std::vector<uchar_t> iChar,
529  bsq::unused_type,
530  bsq::unused_type) const {
531  const std::string lAdmNameStr (iChar.begin(), iChar.end());
532  const Admin2ASCIIName_T lAdmName (lAdmNameStr);
533  _location.setAdmin2AsciiName (lAdmName);
534  // DEBUG
535  //OPENTREP_LOG_DEBUG("Adm2 ASCII name: "<< _location.getAdmin2AsciiName());
536  }
537 
538  // //////////////////////////////////////////////////////////////////
540  : ParserSemanticAction (ioLocation) {
541  }
542 
543  // //////////////////////////////////////////////////////////////////
544  void storeAdm3Code::operator() (std::vector<uchar_t> iChar,
545  bsq::unused_type,
546  bsq::unused_type) const {
547  const std::string lAdmCodeStr (iChar.begin(), iChar.end());
548  const Admin3Code_T lAdmCode (lAdmCodeStr);
549  _location.setAdmin3Code (lAdmCode);
550  // DEBUG
551  //OPENTREP_LOG_DEBUG ("Adm3 code: " << _location.getAdmin3Code());
552  }
553 
554  // //////////////////////////////////////////////////////////////////
556  : ParserSemanticAction (ioLocation) {
557  }
558 
559  // //////////////////////////////////////////////////////////////////
560  void storeAdm4Code::operator() (std::vector<uchar_t> iChar,
561  bsq::unused_type,
562  bsq::unused_type) const {
563  const std::string lAdmCodeStr (iChar.begin(), iChar.end());
564  const Admin4Code_T lAdmCode (lAdmCodeStr);
565  _location.setAdmin4Code (lAdmCode);
566  // DEBUG
567  //OPENTREP_LOG_DEBUG ("Adm4 code: " << _location.getAdmin4Code());
568  }
569 
570  // //////////////////////////////////////////////////////////////////
572  : ParserSemanticAction (ioLocation) {
573  }
574 
575  // //////////////////////////////////////////////////////////////////
576  void storePopulation::operator() (unsigned int iPopulation,
577  bsq::unused_type, bsq::unused_type) const {
578  _location.setPopulation (iPopulation);
579  // DEBUG
580  //OPENTREP_LOG_DEBUG ("Population: " << _location.getPopulation());
581  }
582 
583  // //////////////////////////////////////////////////////////////////
585  : ParserSemanticAction (ioLocation) {
586  }
587 
588  // //////////////////////////////////////////////////////////////////
589  void storeElevation::operator() (int iElevation,
590  bsq::unused_type, bsq::unused_type) const {
591  _location.setElevation (iElevation);
592  // DEBUG
593  //OPENTREP_LOG_DEBUG ("Elevation: " << _location.getElevation());
594  }
595 
596  // //////////////////////////////////////////////////////////////////
598  : ParserSemanticAction (ioLocation) {
599  }
600 
601  // //////////////////////////////////////////////////////////////////
602  void storeGTopo30::operator() (int iGTopo30,
603  bsq::unused_type, bsq::unused_type) const {
604  _location.setGTopo30 (iGTopo30);
605  // DEBUG
606  //OPENTREP_LOG_DEBUG ("GTopo30: " << _location.getGTopo30());
607  }
608 
609  // //////////////////////////////////////////////////////////////////
611  : ParserSemanticAction (ioLocation) {
612  }
613 
614  // //////////////////////////////////////////////////////////////////
615  void storeTimeZone::operator() (std::vector<uchar_t> iChar,
616  bsq::unused_type,
617  bsq::unused_type) const {
618  const std::string lTimeZoneStr (iChar.begin(), iChar.end());
619  const TimeZone_T lTimeZone (lTimeZoneStr);
620  _location.setTimeZone (lTimeZone);
621  // DEBUG
622  //OPENTREP_LOG_DEBUG ("Time-zone code: " << _location.getTimeZone());
623  }
624 
625  // //////////////////////////////////////////////////////////////////
627  : ParserSemanticAction (ioLocation) {
628  }
629 
630  // //////////////////////////////////////////////////////////////////
631  void storeGMTOffset::operator() (float iOffset,
632  bsq::unused_type, bsq::unused_type) const {
633  _location.setGMTOffset (iOffset);
634  // DEBUG
635  //OPENTREP_LOG_DEBUG ("GMT offset: " << _location.getGMTOffset());
636  }
637 
638  // //////////////////////////////////////////////////////////////////
640  : ParserSemanticAction (ioLocation) {
641  }
642 
643  // //////////////////////////////////////////////////////////////////
644  void storeDSTOffset::operator() (float iOffset,
645  bsq::unused_type, bsq::unused_type) const {
646  _location.setDSTOffset (iOffset);
647  // DEBUG
648  //OPENTREP_LOG_DEBUG ("DST offset: " << _location.getDSTOffset());
649  }
650 
651  // //////////////////////////////////////////////////////////////////
653  : ParserSemanticAction (ioLocation) {
654  }
655 
656  // //////////////////////////////////////////////////////////////////
657  void storeRawOffset::operator() (float iOffset,
658  bsq::unused_type, bsq::unused_type) const {
659  _location.setRawOffset (iOffset);
660  // DEBUG
661  //OPENTREP_LOG_DEBUG ("Raw offset: " << _location.getRawOffset());
662  }
663 
664  // //////////////////////////////////////////////////////////////////
666  : ParserSemanticAction (ioLocation) {
667  }
668 
669  // //////////////////////////////////////////////////////////////////
670  void storeModDate::operator() (bsq::unused_type,
671  bsq::unused_type, bsq::unused_type) const {
672  const OPENTREP::Date_T& lModDate = _location.calculateDate();
673  _location.setModificationDate (lModDate);
674  // DEBUG
675  //OPENTREP_LOG_DEBUG ("Modification date: " << _location.getModificationDate());
676  }
677 
678  // //////////////////////////////////////////////////////////////////
680  : ParserSemanticAction (ioLocation) {
681  }
682 
683  // //////////////////////////////////////////////////////////////////
684  void storeCityCode::operator() (std::vector<uchar_t> iChar,
685  bsq::unused_type, bsq::unused_type) const {
686 
687  const std::string lCityCodeStr (iChar.begin(), iChar.end());
688  const OPENTREP::CityCode_T lCityCode (lCityCodeStr);
689  _location._itCityIataCode = lCityCode;
690  // DEBUG
691  //OPENTREP_LOG_DEBUG ("City code: " << _location._itCityIataCode);
692  }
693 
694  // //////////////////////////////////////////////////////////////////
696  : ParserSemanticAction (ioLocation) {
697  }
698 
699  // //////////////////////////////////////////////////////////////////
700  void storeCityGeonamesID::operator() (unsigned int iCtyId,
701  bsq::unused_type,
702  bsq::unused_type) const {
703  _location._itCityGeonamesID = iCtyId;
704  // DEBUG
705  //OPENTREP_LOG_DEBUG("City Geonames ID: " << _location._itCityGeonamesID);
706  }
707 
708  // //////////////////////////////////////////////////////////////////
710  : ParserSemanticAction (ioLocation) {
711  }
712 
713  // //////////////////////////////////////////////////////////////////
714  void storeCityUtfName::operator() (std::vector<uchar_t> iChar,
715  bsq::unused_type,
716  bsq::unused_type) const {
717 
718  const std::string lCityUtfNameStr (iChar.begin(), iChar.end());
719  const OPENTREP::CityUTFName_T lCityUtfName (lCityUtfNameStr);
720  _location._itCityUtfName = lCityUtfName;
721  // DEBUG
722  //OPENTREP_LOG_DEBUG ("City UTF8 name: " << _location._itCityUtfName);
723  }
724 
725  // //////////////////////////////////////////////////////////////////
727  : ParserSemanticAction (ioLocation) {
728  }
729 
730  // //////////////////////////////////////////////////////////////////
731  void storeCityAsciiName::operator() (std::vector<uchar_t> iChar,
732  bsq::unused_type,
733  bsq::unused_type) const {
734 
735  const std::string lCityAsciiNameStr (iChar.begin(), iChar.end());
736  const OPENTREP::CityASCIIName_T lCityAsciiName (lCityAsciiNameStr);
737  _location._itCityAsciiName = lCityAsciiName;
738  // DEBUG
739  //OPENTREP_LOG_DEBUG("City ASCII name: " << _location._itCityAsciiName);
740  }
741 
742  // //////////////////////////////////////////////////////////////////
744  : ParserSemanticAction (ioLocation) {
745  }
746 
747  // //////////////////////////////////////////////////////////////////
748  void storeStateCode::operator() (std::vector<uchar_t> iChar,
749  bsq::unused_type, bsq::unused_type) const {
750 
751  const std::string lStateCodeStr (iChar.begin(), iChar.end());
752  const OPENTREP::StateCode_T lStateCode (lStateCodeStr);
753  _location.setStateCode (lStateCode);
754  // DEBUG
755  //OPENTREP_LOG_DEBUG ("State code: " << _location.getStateCode());
756  }
757 
758  // //////////////////////////////////////////////////////////////////
760  : ParserSemanticAction (ioLocation) {
761  }
762 
763  // //////////////////////////////////////////////////////////////////
764  void storeWAC::operator() (unsigned int iWAC,
765  bsq::unused_type, bsq::unused_type) const {
766  _location.setWAC (iWAC);
767  // DEBUG
768  //OPENTREP_LOG_DEBUG ("WAC: " << _location.getWAC());
769  }
770 
771  // //////////////////////////////////////////////////////////////////
773  : ParserSemanticAction (ioLocation) {
774  }
775 
776  // //////////////////////////////////////////////////////////////////
777  void storeWACName::operator() (std::vector<uchar_t> iChar,
778  bsq::unused_type, bsq::unused_type) const {
779  const std::string lWACNameStr (iChar.begin(), iChar.end());
780  const OPENTREP::WACName_T lWACName (lWACNameStr);
781  _location.setWACName (lWACName);
782  // DEBUG
783  //OPENTREP_LOG_DEBUG ("WAC name: " << _location.getWACName());
784  }
785 
786  // //////////////////////////////////////////////////////////////////
788  : ParserSemanticAction (ioLocation) {
789  }
790 
791  // //////////////////////////////////////////////////////////////////
792  void storeCurrencyCode::operator() (std::vector<uchar_t> iChar,
793  bsq::unused_type,
794  bsq::unused_type) const {
795  const std::string lCurrencyCodeStr (iChar.begin(), iChar.end());
796  const OPENTREP::CurrencyCode_T lCurrencyCode (lCurrencyCodeStr);
797  _location.setCurrencyCode (lCurrencyCode);
798  // DEBUG
799  //OPENTREP_LOG_DEBUG ("Currency code: " << _location.getCurrencyCode());
800  }
801 
802  // //////////////////////////////////////////////////////////////////
804  : ParserSemanticAction (ioLocation) {
805  }
806 
807  // //////////////////////////////////////////////////////////////////
808  void storePORType::operator() (std::vector<uchar_t> iChar,
809  bsq::unused_type, bsq::unused_type) const {
810  const std::string lIATATypeStr (iChar.begin(), iChar.end());
811  const IATAType lIATAType (lIATATypeStr);
812  _location.setIataType (lIATAType);
813  // DEBUG
814  //OPENTREP_LOG_DEBUG ("IATA type: " << _location.getIataType());
815  }
816 
817  // //////////////////////////////////////////////////////////////////
819  : ParserSemanticAction (ioLocation) {
820  }
821 
822  // //////////////////////////////////////////////////////////////////
823  void storeWikiLink::operator() (std::vector<uchar_t> iChar,
824  bsq::unused_type, bsq::unused_type) const {
825 
826  const std::string lWikiLinkStr (iChar.begin(), iChar.end());
827  const OPENTREP::WikiLink_T lWikiLink (lWikiLinkStr);
828  _location.setWikiLink (lWikiLink);
829  // DEBUG
830  // OPENTREP_LOG_DEBUG ("Wiki link: " << _location.getWikiLink());
831  }
832 
833  // //////////////////////////////////////////////////////////////////
835  : ParserSemanticAction (ioLocation) {
836  }
837 
838  // //////////////////////////////////////////////////////////////////
839  void storeAltLangCodeFull::operator() (std::vector<uchar_t> iChar,
840  bsq::unused_type, bsq::unused_type) const {
841 
842  const std::string lAltLangCodeStr (iChar.begin(), iChar.end());
843  const OPENTREP::LanguageCode_T lAltLangCode (lAltLangCodeStr);
844  _location._itLanguageCode = lAltLangCode;
845  // DEBUG
846  //OPENTREP_LOG_DEBUG ("Alt lang full code: " << _location._itLanguageCode);
847  }
848 
849  // //////////////////////////////////////////////////////////////////
851  : ParserSemanticAction (ioLocation) {
852  }
853 
854  // //////////////////////////////////////////////////////////////////
855  void storeAltLangCode2Char::operator() (std::vector<uchar_t> iChar,
856  bsq::unused_type, bsq::unused_type) const {
857 
858  const std::string lAltLangCodeStr (iChar.begin(), iChar.end());
859  _location._itLangCode2Char = lAltLangCodeStr;
862  // DEBUG
863  //OPENTREP_LOG_DEBUG ("Alt lang 2-char code: " << _location._itLangCode2Char);
864  }
865 
866  // //////////////////////////////////////////////////////////////////
868  : ParserSemanticAction (ioLocation) {
869  }
870 
871  // //////////////////////////////////////////////////////////////////
872  void storeAltLangCodeExt::operator() (std::vector<uchar_t> iChar,
873  bsq::unused_type, bsq::unused_type) const {
874 
875  const std::string lAltLangCodeStr (iChar.begin(), iChar.end());
876  std::ostringstream oStr;
877  oStr << _location._itLangCode2Char << "-" << lAltLangCodeStr;
878  _location._itLangCodeExt = oStr.str();
879  // DEBUG
880  //OPENTREP_LOG_DEBUG ("Alt lang 2-char code: " << _location._itLangCodeExt);
881  }
882 
883  // //////////////////////////////////////////////////////////////////
885  : ParserSemanticAction (ioLocation) {
886  }
887 
888  // //////////////////////////////////////////////////////////////////
889  void storeAltLangCodeHist::operator() (std::vector<uchar_t> iChar,
890  bsq::unused_type, bsq::unused_type) const {
891 
892  const std::string lAltLangCodeStr (iChar.begin(), iChar.end());
893  std::ostringstream oStr;
894  oStr << _location._itLangCode2Char << "_" << lAltLangCodeStr;
895  _location._itLangCodeHist = oStr.str();
896  // DEBUG
897  //OPENTREP_LOG_DEBUG ("Alt lang 2-char code: " << _location._itLangCodeHist);
898  }
899 
900  // //////////////////////////////////////////////////////////////////
902  : ParserSemanticAction (ioLocation) {
903  }
904 
905  // //////////////////////////////////////////////////////////////////
906  void storeAltName::operator() (std::vector<uchar_t> iChar,
907  bsq::unused_type, bsq::unused_type) const {
908 
909  const std::string lAltNameStr (iChar.begin(), iChar.end());
910  const OPENTREP::AltNameShortListString_T lAltName (lAltNameStr);
911  //_location.addName (_location._itLanguageCodeNum, lAltName);
913  // Reset the values
914  //_location._itLanguageCodeNum = OPENTREP::Language::LAST_VALUE;
916  // DEBUG
917  //OPENTREP_LOG_DEBUG ("Alt name: " << _location.getAltNameShortList());
918  }
919 
920 
921  // //////////////////////////////////////////////////////////////////
923  : ParserSemanticAction (ioLocation) {
924  }
925 
926  // //////////////////////////////////////////////////////////////////
927  void doEndPor::operator() (bsq::unused_type,
928  bsq::unused_type, bsq::unused_type) const {
929  // DEBUG
930  //OPENTREP_LOG_DEBUG ("Do End. Location structure: " << _location);
931  }
932 
933  // ///////////////////////////////////////////////////////////////////
934  //
935  // Utility Parsers
936  //
937  // ///////////////////////////////////////////////////////////////////
938 
941 
944 
947 
950 
954 
957 
961 
966 
971 
974 
976  //
977  // (Boost Spirit) Grammar Definition
978  //
980 
1165  template <typename Iterator>
1166  struct LocationParser : public bsq::grammar<Iterator, bsu::blank_type> {
1167 
1168  LocationParser (Location& ioPORRule) :
1169  LocationParser::base_type(start), _location(ioPORRule) {
1170 
1171  start = bsq::eps
1172  >> *(header | por_rule);
1173 
1174  header = bsq::lit("iata_code") >> +(bsu::char_ - bsq::eoi - bsq::eol)
1175  >> (bsq::eoi | bsq::eol);
1176 
1177  por_rule = por_key
1178  >> '^' >> por_details
1179  >> '^' >> -alt_name_section
1180  >> '^' >> por_details_additional
1182 
1183  por_rule_end = bsq::eps;
1184 
1185  por_key = -iata_code
1186  >> '^' >> -icao_code
1187  >> '^' >> -faa_code
1188  >> '^' >> is_geonames
1189  >> '^' >> geoname_id
1190  >> '^' >> -envelope_id
1191  ;
1192 
1194  >> '^' >> ascii_name
1195  >> '^' >> -latitude
1196  >> '^' >> -longitude
1197  >> '^' >> feat_class
1198  >> '^' >> feat_code
1199  >> '^' >> -page_rank
1200  >> '^' >> -date_from
1201  >> '^' >> -date_end
1202  >> '^' >> -comments
1203  >> '^' >> country_code
1204  >> '^' >> -country_code2
1205  >> '^' >> country_name
1206  >> '^' >> -continent_name
1207  >> '^' >> -adm1_code
1208  >> '^' >> -adm1_name_utf
1209  >> '^' >> -adm1_name_ascii
1210  >> '^' >> -adm2_code
1211  >> '^' >> -adm2_name_utf
1212  >> '^' >> -adm2_name_ascii
1213  >> '^' >> -adm3_code
1214  >> '^' >> -adm4_code
1215  >> '^' >> -population
1216  >> '^' >> -elevation
1217  >> '^' >> -gtopo30
1218  >> '^' >> -time_zone
1219  >> '^' >> -gmt_offset
1220  >> '^' >> -dst_offset
1221  >> '^' >> -raw_offset
1222  >> '^' >> (mod_date | bsq::lit("-1"))
1223  >> '^' >> -city_code_list
1224  >> '^' >> -city_name_list
1225  >> '^' >> -city_detail_list
1227  >> '^' >> -state_code
1228  >> '^' >> por_type
1229  >> '^' >> -wiki_link
1230  ;
1231  // >> '^' >> -alt_name_short_list[storeAltNameShortListString(_location)]
1232 
1234  wac >> '^' >> wac_name >> '^' >> -ccy_code
1235  >> '^' >> -unlc_section >> '^' >> -uic_section
1236  ;
1237 
1238  iata_code =
1239  bsq::repeat(3)[bsu::char_('A', 'Z')][storeIataCode(_location)];
1240 
1241  icao_code =
1242  bsq::repeat(4)[bsu::char_("A-Z0-9")][storeIcaoCode(_location)];
1243 
1244  faa_code =
1245  bsq::repeat(1,4)[bsu::char_("A-Z0-9")][storeFaaCode(_location)];
1246 
1248 
1249  envelope_id = uint1_4_p[storeEnvelopeID(_location)];
1250 
1252 
1253  common_name =
1254  (bsq::no_skip[+~bsu::char_('^')]
1255  - (bsq::eoi|bsq::eol))[storeCommonName(_location)]
1256  ;
1257 
1258  ascii_name =
1259  (bsq::no_skip[+~bsu::char_('^')]
1260  - (bsq::eoi|bsq::eol))[storeAsciiName(_location)]
1261  ;
1262 
1264 
1265  alt_name_short =
1266  (bsq::no_skip[+~bsu::char_("^,")]
1267  - (bsq::eoi|bsq::eol))[storeAltNameShort(_location)]
1268  ;
1269 
1271 
1272  tvl_por_code =
1273  (bsq::no_skip[+~bsu::char_("^,")]
1274  - (bsq::eoi|bsq::eol))[storeTvlPORCode(_location)]
1275  ;
1276 
1277  latitude = bsq::double_[storeLatitude(_location)];
1278 
1279  longitude = bsq::double_[storeLongitude(_location)];
1280 
1281  feat_class =
1282  bsq::repeat(1)[bsu::char_("A-Z")][storeFeatureClass(_location)]
1283  ;
1284 
1285  feat_code =
1286  bsq::repeat(2,5)[bsu::char_("A-Z1-5")][storeFeatureCode(_location)]
1287  ;
1288 
1289  page_rank = bsq::double_[storePageRank(_location)];
1290 
1292 
1294 
1295  comments =
1296  (bsq::no_skip[+~bsu::char_('^')]
1297  - (bsq::eoi|bsq::eol))[storeComments(_location)]
1298  ;
1299 
1300  country_code =
1301  bsq::repeat(2,3)[bsu::char_("A-Z")][storeCountryCode(_location)]
1302  ;
1303 
1304  country_code2 =
1305  (bsq::no_skip[+~bsu::char_('^')]
1306  - (bsq::eoi|bsq::eol))[storeAltCountryCode(_location)]
1307  ;
1308 
1309  country_name =
1310  (bsq::no_skip[+~bsu::char_('^')]
1311  - (bsq::eoi|bsq::eol))[storeCountryName(_location)]
1312  ;
1313 
1314  continent_name =
1315  (bsq::no_skip[+~bsu::char_('^')]
1316  - (bsq::eoi|bsq::eol))[storeContinentName(_location)]
1317  ;
1318 
1319  adm1_code =
1320  (bsq::no_skip[+~bsu::char_('^')]
1321  - (bsq::eoi|bsq::eol))[storeAdm1Code(_location)]
1322  ;
1323 
1324  adm1_name_utf =
1325  (bsq::no_skip[+~bsu::char_('^')]
1326  - (bsq::eoi|bsq::eol))[storeAdm1UtfName(_location)]
1327  ;
1328 
1329  adm1_name_ascii =
1330  (bsq::no_skip[+~bsu::char_('^')]
1331  - (bsq::eoi|bsq::eol))[storeAdm1AsciiName(_location)]
1332  ;
1333 
1334  adm2_code =
1335  (bsq::no_skip[+~bsu::char_('^')]
1336  - (bsq::eoi|bsq::eol))[storeAdm2Code(_location)]
1337  ;
1338 
1339  adm2_name_utf =
1340  (bsq::no_skip[+~bsu::char_('^')]
1341  - (bsq::eoi|bsq::eol))[storeAdm2UtfName(_location)]
1342  ;
1343 
1344  adm2_name_ascii =
1345  (bsq::no_skip[+~bsu::char_('^')]
1346  - (bsq::eoi|bsq::eol))[storeAdm2AsciiName(_location)]
1347  ;
1348 
1349  adm3_code =
1350  (bsq::no_skip[+~bsu::char_('^')]
1351  - (bsq::eoi|bsq::eol))[storeAdm3Code(_location)]
1352  ;
1353 
1354  adm4_code =
1355  (bsq::no_skip[+~bsu::char_('^')]
1356  - (bsq::eoi|bsq::eol))[storeAdm4Code(_location)]
1357  ;
1358 
1360 
1362 
1364 
1365  time_zone =
1366  (bsq::no_skip[+~bsu::char_('^')]
1367  - (bsq::eoi|bsq::eol))[storeTimeZone(_location)]
1368  ;
1369 
1370  gmt_offset = bsq::float_[storeGMTOffset(_location)];
1371 
1372  dst_offset = bsq::float_[storeDSTOffset(_location)];
1373 
1374  raw_offset = bsq::float_[storeRawOffset(_location)];
1375 
1377 
1378  date = bsq::lexeme
1379  [year_p[boost::phoenix::ref(_location._itYear) = bsq::labels::_1]
1380  >> '-'
1381  >> month_p[boost::phoenix::ref(_location._itMonth) = bsq::labels::_1]
1382  >> '-'
1383  >> day_p[boost::phoenix::ref(_location._itDay) = bsq::labels::_1] ];
1384 
1385  city_code_list = city_code % ',';
1386 
1387  city_code =
1388  bsq::repeat(3)[bsu::char_('A', 'Z')][storeCityCode(_location)]
1389  ;
1390 
1391  city_name_list = city_name_utf % '=';
1392 
1393  city_name_utf =
1394  (bsq::no_skip[+~bsu::char_("^|=")]
1395  - (bsq::eoi|bsq::eol))[storeCityUtfName(_location)]
1396  ;
1397 
1398  city_name_ascii =
1399  (bsq::no_skip[+~bsu::char_("^|=")]
1400  - (bsq::eoi|bsq::eol))[storeCityAsciiName(_location)]
1401  ;
1402 
1404 
1405  city_details =
1406  city_code
1407  >> '|' >> city_geoname_id
1408  >> '|' >> city_name_utf
1409  >> '|' >> city_name_ascii
1410  ;
1411 
1413 
1414  state_code =
1415  (bsq::no_skip[+~bsu::char_('^')]
1416  - (bsq::eoi|bsq::eol))[storeStateCode(_location)]
1417  ;
1418 
1420 
1421  wac_name =
1422  (bsq::no_skip[+~bsu::char_('^')]
1423  - (bsq::eoi|bsq::eol))[storeWACName(_location)]
1424  ;
1425 
1426  ccy_code =
1427  (bsq::no_skip[+~bsu::char_('^')]
1428  - (bsq::eoi|bsq::eol))[storeCurrencyCode(_location)]
1429  ;
1430 
1431  unlc_section = unlc_details % '=';
1432 
1433  unlc_details =
1434  unlocode_code >> '|' >> -unlc_qualifiers
1435  ;
1436 
1437  unlocode_code =
1438  bsq::repeat(5)[bsu::char_("A-Z0-9")][storeUNLOCode(_location)];
1439 
1440  unlc_qualifiers =
1441  bsq::repeat(1,2)[bsu::char_("hp")]
1442  ;
1443 
1444  uic_section = uic_details % '=';
1445 
1446  uic_details =
1447  uic_code >> '|' >> -uic_qualifiers
1448  ;
1449 
1451 
1452  uic_qualifiers =
1453  bsq::repeat(1,2)[bsu::char_("hp")]
1454  ;
1455 
1456  por_type =
1457  bsq::repeat(1,3)[bsu::char_("ABCGHOPRZ")][storePORType(_location)]
1458  ;
1459 
1460  wiki_link =
1461  (bsq::no_skip[+~bsu::char_('^')]
1462  - (bsq::eoi|bsq::eol))[storeWikiLink(_location)]
1463  ;
1464 
1466 
1468  -alt_lang_code
1469  >> '|' >> alt_name
1470  >> '|' >> -alt_name_qualifiers
1471  ;
1472 
1473  alt_lang_code =
1474  (+~bsu::char_("|=")
1475  - (bsq::eoi|bsq::eol))[storeAltLangCodeFull(_location)]
1476  ;
1477 
1479 
1480  lang_code_opt = -(lang_code_ext | lang_code_hist);
1481 
1482  lang_code_2char =
1483  bsq::repeat(2,4)[bsu::char_("a-z")][storeAltLangCode2Char(_location)]
1484  ;
1485 
1486  lang_code_ext =
1487  '-' >> bsq::repeat(1,4)[bsu::char_('A', 'Z')][storeAltLangCodeExt(_location)];
1488 
1489  lang_code_hist =
1490  '_' >> bsq::repeat(1,4)[bsu::char_("a-z0-9")][storeAltLangCodeHist(_location)];
1491 
1492  alt_name =
1493  (bsq::no_skip[+~bsu::char_("|=")]
1494  - (bsq::eoi|bsq::eol))[storeAltName(_location)]
1495  ;
1496 
1497  alt_name_qualifiers =
1498  bsq::repeat(1,4)[bsu::char_("shpc")]
1499  ;
1500 
1501  //BOOST_SPIRIT_DEBUG_NODE (LocationParser);
1502  BOOST_SPIRIT_DEBUG_NODE (start);
1503  BOOST_SPIRIT_DEBUG_NODE (header);
1504  BOOST_SPIRIT_DEBUG_NODE (por_rule);
1505  BOOST_SPIRIT_DEBUG_NODE (por_rule_end);
1506  BOOST_SPIRIT_DEBUG_NODE (por_key);
1507  BOOST_SPIRIT_DEBUG_NODE (por_details);
1508  BOOST_SPIRIT_DEBUG_NODE (iata_code);
1509  BOOST_SPIRIT_DEBUG_NODE (icao_code);
1510  BOOST_SPIRIT_DEBUG_NODE (faa_code);
1511  BOOST_SPIRIT_DEBUG_NODE (geoname_id);
1512  BOOST_SPIRIT_DEBUG_NODE (envelope_id);
1513  BOOST_SPIRIT_DEBUG_NODE (is_geonames);
1514  BOOST_SPIRIT_DEBUG_NODE (common_name);
1515  BOOST_SPIRIT_DEBUG_NODE (ascii_name);
1516  BOOST_SPIRIT_DEBUG_NODE (alt_name_short_list);
1517  BOOST_SPIRIT_DEBUG_NODE (alt_name_short);
1518  BOOST_SPIRIT_DEBUG_NODE (alt_name_sep);
1519  BOOST_SPIRIT_DEBUG_NODE (tvl_por_code_list);
1520  BOOST_SPIRIT_DEBUG_NODE (tvl_por_code);
1521  BOOST_SPIRIT_DEBUG_NODE (tvl_por_sep);
1522  BOOST_SPIRIT_DEBUG_NODE (latitude);
1523  BOOST_SPIRIT_DEBUG_NODE (longitude);
1524  BOOST_SPIRIT_DEBUG_NODE (feat_class);
1525  BOOST_SPIRIT_DEBUG_NODE (feat_code);
1526  BOOST_SPIRIT_DEBUG_NODE (page_rank);
1527  BOOST_SPIRIT_DEBUG_NODE (date_from);
1528  BOOST_SPIRIT_DEBUG_NODE (date_end);
1529  BOOST_SPIRIT_DEBUG_NODE (comments);
1530  BOOST_SPIRIT_DEBUG_NODE (country_code);
1531  BOOST_SPIRIT_DEBUG_NODE (country_code2);
1532  BOOST_SPIRIT_DEBUG_NODE (country_name);
1533  BOOST_SPIRIT_DEBUG_NODE (continent_name);
1534  BOOST_SPIRIT_DEBUG_NODE (adm1_code);
1535  BOOST_SPIRIT_DEBUG_NODE (adm1_name_utf);
1536  BOOST_SPIRIT_DEBUG_NODE (adm1_name_ascii);
1537  BOOST_SPIRIT_DEBUG_NODE (adm2_code);
1538  BOOST_SPIRIT_DEBUG_NODE (adm2_name_utf);
1539  BOOST_SPIRIT_DEBUG_NODE (adm2_name_ascii);
1540  BOOST_SPIRIT_DEBUG_NODE (adm3_code);
1541  BOOST_SPIRIT_DEBUG_NODE (adm4_code);
1542  BOOST_SPIRIT_DEBUG_NODE (population);
1543  BOOST_SPIRIT_DEBUG_NODE (elevation);
1544  BOOST_SPIRIT_DEBUG_NODE (gtopo30);
1545  BOOST_SPIRIT_DEBUG_NODE (time_zone);
1546  BOOST_SPIRIT_DEBUG_NODE (gmt_offset);
1547  BOOST_SPIRIT_DEBUG_NODE (raw_offset);
1548  BOOST_SPIRIT_DEBUG_NODE (dst_offset);
1549  BOOST_SPIRIT_DEBUG_NODE (mod_date);
1550  BOOST_SPIRIT_DEBUG_NODE (date);
1551  BOOST_SPIRIT_DEBUG_NODE (city_code_list);
1552  BOOST_SPIRIT_DEBUG_NODE (city_name_list);
1553  BOOST_SPIRIT_DEBUG_NODE (city_detail_list);
1554  BOOST_SPIRIT_DEBUG_NODE (city_details);
1555  BOOST_SPIRIT_DEBUG_NODE (city_geoname_id);
1556  BOOST_SPIRIT_DEBUG_NODE (city_code);
1557  BOOST_SPIRIT_DEBUG_NODE (city_name_utf);
1558  BOOST_SPIRIT_DEBUG_NODE (city_name_ascii);
1559  BOOST_SPIRIT_DEBUG_NODE (state_code);
1560  BOOST_SPIRIT_DEBUG_NODE (por_type);
1561  BOOST_SPIRIT_DEBUG_NODE (wiki_link);
1562  BOOST_SPIRIT_DEBUG_NODE (alt_name_section);
1563  BOOST_SPIRIT_DEBUG_NODE (alt_name_details);
1564  BOOST_SPIRIT_DEBUG_NODE (alt_lang_code);
1565  BOOST_SPIRIT_DEBUG_NODE (alt_lang_code_ftd);
1566  BOOST_SPIRIT_DEBUG_NODE (alt_name);
1567  BOOST_SPIRIT_DEBUG_NODE (alt_name_qualifiers);
1568  BOOST_SPIRIT_DEBUG_NODE (lang_code_opt);
1569  BOOST_SPIRIT_DEBUG_NODE (lang_code_2char);
1570  BOOST_SPIRIT_DEBUG_NODE (lang_code_ext);
1571  BOOST_SPIRIT_DEBUG_NODE (lang_code_hist);
1572  BOOST_SPIRIT_DEBUG_NODE (por_details_additional);
1573  BOOST_SPIRIT_DEBUG_NODE (wac);
1574  BOOST_SPIRIT_DEBUG_NODE (wac_name);
1575  BOOST_SPIRIT_DEBUG_NODE (ccy_code);
1576  BOOST_SPIRIT_DEBUG_NODE (unlc_section);
1577  BOOST_SPIRIT_DEBUG_NODE (unlc_details);
1578  BOOST_SPIRIT_DEBUG_NODE (unlocode_code);
1579  BOOST_SPIRIT_DEBUG_NODE (unlc_qualifiers);
1580  BOOST_SPIRIT_DEBUG_NODE (uic_section);
1581  BOOST_SPIRIT_DEBUG_NODE (uic_details);
1582  BOOST_SPIRIT_DEBUG_NODE (uic_code);
1583  BOOST_SPIRIT_DEBUG_NODE (uic_qualifiers);
1584  }
1585 
1586  // Instantiation of rules
1587  bsq::rule<Iterator, bsu::blank_type>
1600  mod_date, date,
1604  state_code,
1612 
1613  // Parser Context
1615  };
1616  }
1617 
1618 
1620  //
1621  // Entry class for the string parser
1622  //
1624 
1625  // //////////////////////////////////////////////////////////////////////
1626  PORStringParser::PORStringParser (const std::string& iString)
1627  : _string (iString) {
1628  init();
1629  }
1630 
1631  // //////////////////////////////////////////////////////////////////////
1632  void PORStringParser::init() {
1633  // Store the raw data string
1634  _location.setRawDataString (_string);
1635  }
1636 
1637  // //////////////////////////////////////////////////////////////////////
1639  }
1640 
1641  // //////////////////////////////////////////////////////////////////////
1643  // DEBUG
1644  // OPENTREP_LOG_DEBUG ("Parsing POR string: '" << _string << "'");
1645 
1646  // String to be parsed
1647  std::istringstream stringToBeParsed (_string);
1648 
1649  // Create an input iterator
1650  OPENTREP::base_iterator_t iStr (stringToBeParsed);
1651 
1652  // Convert input iterator to an iterator usable by spirit parser
1653  OPENTREP::iterator_t fwd_start(boost::spirit::make_default_multi_pass(iStr));
1654  OPENTREP::iterator_t fwd_end;
1655 
1656  // Initialise the positional iterators
1657  OPENTREP::pos_iterator_t pos_start (fwd_start, fwd_end, _string);
1658  OPENTREP::pos_iterator_t pos_end;
1659 
1660  // Initialise the parser (grammar) with the helper/staging structure.
1662 
1663  // Launch the parsing of the file and, thanks to the doEndPor
1664  // call-back structure, the building of the whole BomRoot BOM
1665  bool hasParsingBeenSuccesful = false;
1666  try {
1667 
1668  hasParsingBeenSuccesful = bsq::phrase_parse (fwd_start, fwd_end,
1669  lPORParser, bsu::blank);
1670 
1671  } catch (const bsq::expectation_failure<pos_iterator_t>& e) {
1672  const bsc::file_position_base<std::string>& pos = e.first.get_position();
1673  std::ostringstream oStr;
1674  oStr << "Parse error on POR string '" << _string
1675  << "', position " << pos.column << std::endl
1676  << "'" << e.first.get_currentline() << "'" << std::endl
1677  << std::setw(pos.column) << " " << "^- here";
1678  OPENTREP_LOG_ERROR (oStr.str());
1679  throw PorFileParsingException (oStr.str());
1680  }
1681 
1682  if (hasParsingBeenSuccesful == false) {
1683  OPENTREP_LOG_ERROR ("Parsing of POR input string: '" << _string
1684  << "' failed");
1685  throw PorFileParsingException ("Parsing of POR input string: '"
1686  + _string + "' failed");
1687  }
1688 
1689  if (fwd_start != fwd_end) {
1690  OPENTREP_LOG_ERROR ("Parsing of POR input string: '" << _string
1691  << "' failed");
1692  throw PorFileParsingException ("Parsing of POR input file: '"
1693  + _string + "' failed");
1694  }
1695 
1696  //
1697  if (hasParsingBeenSuccesful == true && fwd_start == fwd_end) {
1698  // DEBUG
1699  /*
1700  OPENTREP_LOG_DEBUG ("Parsing of POR input string: '" << _string
1701  << "' succeeded");
1702  */
1703  }
1704 
1705  return _location;
1706  }
1707 
1708 
1710  //
1711  // Entry class for the file parser
1712  //
1714 
1715  // //////////////////////////////////////////////////////////////////////
1717  : _filename (iFilename) {
1718  init();
1719  }
1720 
1721  // //////////////////////////////////////////////////////////////////////
1722  void PORFileParser::init() {
1723  }
1724 
1725  // //////////////////////////////////////////////////////////////////////
1727 
1728  OPENTREP_LOG_DEBUG ("Parsing the POR input file: " << _filename);
1729 
1730  // File to be parsed
1731  const char* lFilenameStr = _filename.c_str();
1732  std::ifstream fileToBeParsed (lFilenameStr, std::ios_base::in);
1733 
1734  // Check if the filename exist and can be open
1735  if (fileToBeParsed.is_open() == false) {
1736  OPENTREP_LOG_ERROR ("The POR file ('" << _filename << "') can not be open."
1737  << std::endl);
1738 
1739  throw FileNotFoundException ("The '" + _filename
1740  + "' file does not exist or can not be read");
1741  }
1742 
1743  // Create an input iterator
1744  OPENTREP::base_iterator_t iStr (fileToBeParsed);
1745 
1746  // Convert input iterator to an iterator usable by spirit parser
1747  OPENTREP::iterator_t start (boost::spirit::make_default_multi_pass (iStr));
1749 
1750  // Initialise the parser (grammar) with the helper/staging structure.
1752 
1753  // Launch the parsing of the file and, thanks to the doEndPor
1754  // call-back structure, the building of the whole BomRoot BOM
1755  const bool hasParsingBeenSuccesful =
1756  bsq::phrase_parse (start, end, lPORParser, bsu::blank);
1757 
1758  if (hasParsingBeenSuccesful == false) {
1759  OPENTREP_LOG_ERROR ("Parsing of POR input file ('" << _filename
1760  << "') failed");
1761  throw PorFileParsingException ("Parsing of POR input file ('"
1762  + _filename + "') failed");
1763  }
1764 
1765  if (start != end) {
1766  OPENTREP_LOG_ERROR ("Parsing of POR input file ('" << _filename
1767  << "') failed");
1768  throw PorFileParsingException ("Parsing of POR input file ('"
1769  + _filename + "') failed");
1770  }
1771 
1772  if (hasParsingBeenSuccesful == true && start == end) {
1773  OPENTREP_LOG_DEBUG ("Parsing of POR input file ('" << _filename
1774  << "') succeeded");
1775  }
1776  }
1777 
1778 }
bsq::rule< Iterator, bsu::blank_type > alt_name_details
void setStateCode(const std::string &iStateCode)
Definition: Location.hpp:597
bsq::rule< Iterator, bsu::blank_type > adm3_code
bsq::rule< Iterator, bsu::blank_type > uic_qualifiers
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > alt_name
void setAdmin4Code(const std::string &iAdminCode)
Definition: Location.hpp:744
bsq::rule< Iterator, bsu::blank_type > uic_section
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
#define OPENTREP_LOG_ERROR(iToBeLogged)
Definition: Logger.hpp:24
void setWAC(const WAC_T &iWAC)
Definition: Location.hpp:604
void setAltCountryCode(const std::string &iCountryCode)
Definition: Location.hpp:583
void consolidateCityDetailsList()
Definition: Location.cpp:365
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void consolidateAltNameShortListString()
Definition: Location.cpp:374
#define OPENTREP_LOG_DEBUG(iToBeLogged)
Definition: Logger.hpp:33
OPENTREP::month_p_t month_p
void setFeatureCode(const std::string &iFeatCode)
Definition: Location.hpp:688
void setAdmin1AsciiName(const std::string &iAdminName)
Definition: Location.hpp:709
bsq::rule< Iterator, bsu::blank_type > unlc_details
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 setFeatureClass(const std::string &iFeatClass)
Definition: Location.hpp:681
void setGTopo30(const GTopo30_T &iGTopo30)
Definition: Location.hpp:765
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::spirit::qi::uint_parser< month_t, 10, 2, 2 > month_p_t
bsq::rule< Iterator, bsu::blank_type > lang_code_ext
bsq::rule< Iterator, bsu::blank_type > tvl_por_code
std::istreambuf_iterator< char > base_iterator_t
std::string _itLangCodeExt
Definition: Location.hpp:1391
bsq::rule< Iterator, bsu::blank_type > continent_name
boost::spirit::qi::int_parser< int, 10, 0, 5 > int0_5_p_t
void operator()(int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
OPENTREP::uint0_9_p_t uint0_9_p
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
Date_T calculateDate() const
Definition: Location.cpp:311
bsq::rule< Iterator, bsu::blank_type > por_details_additional
boost::spirit::qi::uint_parser< second_t, 10, 2, 2 > second_p_t
void setCountryName(const std::string &iCountryName)
Definition: Location.hpp:590
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > adm2_name_utf
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
LanguageCode_T _itLanguageCode
Definition: Location.hpp:1389
boost::spirit::qi::uint_parser< hour_t, 10, 2, 2 > hour_p_t
bsq::rule< Iterator, bsu::blank_type > tvl_por_code_list
bsq::rule< Iterator, bsu::blank_type > alt_name_section
Structure modelling a (geographical) location.
Definition: Location.hpp:25
bsq::rule< Iterator, bsu::blank_type > latitude
bsq::rule< Iterator, bsu::blank_type > uic_code
bsq::rule< Iterator, bsu::blank_type > faa_code
void setEnvelopeID(const EnvelopeID_T &iEnvelopeID)
Definition: Location.hpp:541
void setLongitude(const Longitude_T &iLongitude)
Definition: Location.hpp:674
bsq::rule< Iterator, bsu::blank_type > iata_code
bsq::rule< Iterator, bsu::blank_type > city_name_utf
bsq::rule< Iterator, bsu::blank_type > feat_class
bsq::rule< Iterator, bsu::blank_type > dst_offset
boost::spirit::qi::uint_parser< int, 10, 2, 2 > uint2_p_t
bsq::rule< Iterator, bsu::blank_type > common_name
bsq::rule< Iterator, bsu::blank_type > alt_name_qualifiers
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > lang_code_2char
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
OPENTREP::uint1_4_p_t uint1_4_p
bsq::rule< Iterator, bsu::blank_type > city_code
bsq::rule< Iterator, bsu::blank_type > alt_name_short
OPENTREP::uint1_9_p_t uint1_9_p
bsq::rule< Iterator, bsu::blank_type > adm1_code
bsq::rule< Iterator, bsu::blank_type > city_name_list
boost::spirit::qi::uint_parser< int, 10, 1, 9 > uint1_9_p_t
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
OPENTREP::second_p_t second_p
PORStringParser(const std::string &iString)
bsq::rule< Iterator, bsu::blank_type > date_end
boost::spirit::qi::int_parser< int, 10, 1, 5 > int1_5_p_t
std::string _itCityIataCode
Definition: Location.hpp:1403
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setGeonamesID(const GeonamesID_T &iGeonamesID)
Definition: Location.hpp:477
bsq::rule< Iterator, bsu::blank_type > gtopo30
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setFaaCode(const std::string &iFaaCode)
Definition: Location.hpp:491
bsq::rule< Iterator, bsu::blank_type > por_rule
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::gregorian::date Date_T
bsq::rule< Iterator, bsu::blank_type > country_code2
bsq::rule< Iterator, bsu::blank_type > unlc_qualifiers
OPENTREP::uint2_p_t uint2_p
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > uic_details
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setDSTOffset(const DSTOffset_T &iOffset)
Definition: Location.hpp:653
bsq::rule< Iterator, bsu::blank_type > por_rule_end
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setAdmin2AsciiName(const std::string &iAdminName)
Definition: Location.hpp:730
void operator()(float, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > geoname_id
bsq::rule< Iterator, bsu::blank_type > city_name_ascii
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
OPENTREP::minute_p_t minute_p
void setWikiLink(const std::string &iWikiLink)
Definition: Location.hpp:786
bsq::rule< Iterator, bsu::blank_type > wac_name
bsq::rule< Iterator, bsu::blank_type > icao_code
bsq::rule< Iterator, bsu::blank_type > unlc_section
void setCountryCode(const std::string &iCountryCode)
Definition: Location.hpp:576
bsq::rule< Iterator, bsu::blank_type > date_from
OPENTREP::uint1_p_t uint1_p
bsq::rule< Iterator, bsu::blank_type > wiki_link
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > mod_date
bsq::rule< Iterator, bsu::blank_type > elevation
void setGMTOffset(const GMTOffset_T &iOffset)
Definition: Location.hpp:646
boost::spirit::qi::uint_parser< year_t, 10, 4, 4 > year_p_t
boost::spirit::qi::uint_parser< int, 10, 1, 1 > uint1_p_t
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 setTimeZone(const std::string &iTimeZone)
Definition: Location.hpp:639
OPENTREP::boolean_p_t boolean_p
void operator()(boost::spirit::qi::unused_type, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setIcaoCode(const std::string &iIcaoCode)
Definition: Location.hpp:484
bsq::rule< Iterator, bsu::blank_type > por_type
bsq::rule< Iterator, bsu::blank_type > tvl_por_sep
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
IATACodeList_T _itTvlPORList
Definition: Location.hpp:1398
boost::spirit::qi::bool_parser< bool, short_bool_policies > boolean_p_t
boost::spirit::qi::uint_parser< int, 10, 1, 2 > int1_2_p_t
void setModificationDate(const Date_T &iModDate)
Definition: Location.hpp:779
bsq::rule< Iterator, bsu::blank_type > population
bsq::rule< Iterator, bsu::blank_type > gmt_offset
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > ascii_name
bsq::rule< Iterator, bsu::blank_type > raw_offset
bsq::rule< Iterator, bsu::blank_type > city_code_list
bsq::rule< Iterator, bsu::blank_type > city_detail_list
void setCommonName(const std::string &iName)
Definition: Location.hpp:513
boost::spirit::qi::uint_parser< int, 10, 4, 4 > uint4_p_t
boost::spirit::qi::uint_parser< day_t, 10, 2, 2 > day_p_t
bsq::rule< Iterator, bsu::blank_type > state_code
bsq::rule< Iterator, bsu::blank_type > unlocode_code
void operator()(unsigned 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 setAsciiName(const std::string &iName)
Definition: Location.hpp:520
void addUNLOCode(const std::string &iUNLOCode)
Definition: Location.hpp:498
bsq::rule< Iterator, bsu::blank_type > lang_code_hist
bsq::rule< Iterator, bsu::blank_type > adm4_code
AltNameShortList_T _itAltNameShortList
Definition: Location.hpp:1393
void setAdmin1UtfName(const std::string &iAdminName)
Definition: Location.hpp:702
bsq::rule< Iterator, bsu::blank_type > header
std::string _itLangCodeHist
Definition: Location.hpp:1392
OPENTREP::int1_2_p_t int1_2_p
bsq::rule< Iterator, bsu::blank_type > time_zone
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::spirit::qi::uint_parser< int, 10, 1, 4 > uint1_4_p_t
void setContinentName(const std::string &iContinentName)
Definition: Location.hpp:632
void setDateFrom(const Date_T &iDate)
Definition: Location.hpp:548
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > ccy_code
OPENTREP::uint4_p_t uint4_p
bsq::rule< Iterator, bsu::blank_type > comments
void setIataCode(const std::string &iIataCode)
Definition: Location.hpp:463
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
bsq::rule< Iterator, bsu::blank_type > por_key
void addUICCode(const UICCode_T &iUICCode)
Definition: Location.hpp:505
void operator()(unsigned int iUICCode, 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 setAdmin3Code(const std::string &iAdminCode)
Definition: Location.hpp:737
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::spirit::qi::uint_parser< minute_t, 10, 2, 2 > minute_p_t
void operator()(std::vector< boost::uint32_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > longitude
void setLatitude(const Latitude_T &iLatitude)
Definition: Location.hpp:667
bsq::rule< Iterator, bsu::blank_type > wac
bsq::rule< Iterator, bsu::blank_type > por_details
void setAdmin1Code(const std::string &iAdminCode)
Definition: Location.hpp:695
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
OPENTREP::int1_5_p_t int1_5_p
void setPageRank(const PageRank_T &iPageRank)
Definition: Location.hpp:772
void consolidateTvlPORListString()
Definition: Location.cpp:392
bsq::rule< Iterator, bsu::blank_type > adm1_name_ascii
bsq::rule< Iterator, bsu::blank_type > start
bsq::rule< Iterator, bsu::blank_type > adm1_name_utf
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::spirit::multi_pass< base_iterator_t > iterator_t
void operator()(double, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setWACName(const std::string &iWACName)
Definition: Location.hpp:611
std::string _itCityUtfName
Definition: Location.hpp:1405
void setDateEnd(const Date_T &iDate)
Definition: Location.hpp:555
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
boost::spirit::qi::uint_parser< int, 10, 0, 9 > uint0_9_p_t
Enumeration of place/location types with respect to their use for transportation purposes.
Definition: IATAType.hpp:42
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
std::string _itCityAsciiName
Definition: Location.hpp:1406
bsq::rule< Iterator, bsu::blank_type > date
boost::spirit::classic::position_iterator2< iterator_t > pos_iterator_t
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
bsq::rule< Iterator, bsu::blank_type > envelope_id
void operator()(std::vector< uchar_t >, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
void setElevation(const Elevation_T &iElevation)
Definition: Location.hpp:758
void operator()(unsigned int, boost::spirit::qi::unused_type, boost::spirit::qi::unused_type) const
bsq::rule< Iterator, bsu::blank_type > country_name
bsq::rule< Iterator, bsu::blank_type > alt_lang_code
PORFileParser(const PORFilePath_T &iFilename)
void setRawDataString(const std::string &iRawDataString)
Definition: Location.hpp:861
bsq::rule< Iterator, bsu::blank_type > is_geonames
void addName(const LanguageCode_T &iLanguageCode, const std::string &iName)
Definition: Location.hpp:796
bsq::rule< Iterator, bsu::blank_type > city_geoname_id
bsq::rule< Iterator, bsu::blank_type > country_code
void setCurrencyCode(const std::string &iCurrencyCode)
Definition: Location.hpp:618
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
GeonamesID_T _itCityGeonamesID
Definition: Location.hpp:1404
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
bsq::rule< Iterator, bsu::blank_type > city_details
bsq::rule< Iterator, bsu::blank_type > alt_name_sep
std::string _itLangCode2Char
Definition: Location.hpp:1390
bsq::rule< Iterator, bsu::blank_type > adm2_name_ascii
bsq::rule< Iterator, bsu::blank_type > page_rank
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 setRawOffset(const RawOffset_T &iOffset)
Definition: Location.hpp:660
void setAdmin2UtfName(const std::string &iAdminName)
Definition: Location.hpp:723
OPENTREP::int0_5_p_t int0_5_p
void setPopulation(const Population_T &iPopulation)
Definition: Location.hpp:751
bsq::rule< Iterator, bsu::blank_type > lang_code_opt
void setIataType(const IATAType &iIATAType)
Definition: Location.hpp:470
bsq::rule< Iterator, bsu::blank_type > adm2_code
bsq::rule< Iterator, bsu::blank_type > alt_lang_code_ftd
bsq::rule< Iterator, bsu::blank_type > alt_name_short_list
bsq::rule< Iterator, bsu::blank_type > feat_code
void setAdmin2Code(const std::string &iAdminCode)
Definition: Location.hpp:716