StdAir Logo  1.00.0
C++ Standard Airline IT Object Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BomJSONExport.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_BOM_BOMJSONEXPORT_HPP
2 #define __STDAIR_BOM_BOMJSONEXPORT_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // STL
8 #include <iosfwd>
9 // Boost Property Tree
10 #if BOOST_VERSION >= 104100
11 #include <boost/property_tree/ptree.hpp>
12 #include <boost/property_tree/json_parser.hpp>
13 #endif // BOOST_VERSION >= 104100
14 // StdAir
16 
17 #if BOOST_VERSION >= 104100
18  namespace bpt = boost::property_tree;
19 #else // BOOST_VERSION >= 104100
20  namespace bpt {
21  typedef char ptree;
22  }
23 #endif // BOOST_VERSION >= 104100
24 
25 namespace stdair {
26 
28  class BomRoot;
29  class Inventory;
30  class FlightDate;
31  class LegDate;
32  class LegCabin;
33  class SegmentDate;
34  class SegmentCabin;
35  class BookingClass;
36  class EventStruct;
37 
42  class BomJSONExport {
43  public:
44  // //////////////// Export support methods /////////////////
45 
61  static void jsonExportFlightDateList (std::ostream&, const BomRoot&,
62  const AirlineCode_T& iAirlineCode = "all",
63  const FlightNumber_T& iFlightNumber = 0);
64 
74  static void jsonExportFlightDateObjects (std::ostream&, const FlightDate&);
75 
85  static void jsonExportBookingRequestObject (std::ostream&,
86  const EventStruct&);
87 
97  static void jsonExportBreakPointObject (std::ostream&,
98  const EventStruct&);
99 
100  private:
101 
113  static void jsonExportFlightDate (bpt::ptree&,
114  const Inventory&,
115  const FlightNumber_T&);
116 
125  static void jsonExportLegDate (bpt::ptree&, const FlightDate&);
126 
135  static void jsonExportLegCabin (bpt::ptree&, const LegDate&);
136 
145  static void jsonExportBucket (bpt::ptree&, const LegCabin&);
146 
156  static void jsonExportSegmentDate (bpt::ptree&, const FlightDate&);
157 
166  static void jsonExportSegmentCabin (bpt::ptree&, const SegmentDate&);
167 
180  static void jsonExportFareFamily (bpt::ptree&, bpt::ptree&,
181  const SegmentCabin&);
182 
192  static void jsonExportBookingClass (bpt::ptree&, bpt::ptree&,
193  const BookingClass&);
194 
195  };
196 
197 }
198 #endif // __STDAIR_BOM_BOMJSONEXPORT_HPP