StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
DbaAirline.cpp
Go to the documentation of this file.
1 // //////////////////////////////////////////////////////////////////////
2 // Import section
3 // //////////////////////////////////////////////////////////////////////
4 // STL
5 #include <exception>
6 #include <string>
7 // Stdair
12 
13 namespace soci {
14 
15  // //////////////////////////////////////////////////////////////////////
17  from_base (values const& iAirlineValues, indicator /* ind */,
18  stdair::AirlineStruct& ioAirline) {
19  /*
20  iata_code, name
21  */
22  ioAirline.setAirlineCode (iAirlineValues.get<std::string> ("iata_code"));
23  // The city code will be set to the default value (empty string)
24  // when the column is null
25  ioAirline.setAirlineName (iAirlineValues.get<std::string> ("name", ""));
26  }
27 
28  // //////////////////////////////////////////////////////////////////////
30  to_base (const stdair::AirlineStruct& iAirline, values& ioAirlineValues,
31  indicator& ioIndicator) {
32  const indicator lNameIndicator =
33  iAirline.getAirlineName().empty() ? i_null : i_ok;
34  ioAirlineValues.set ("iata_code", iAirline.getAirlineCode());
35  ioAirlineValues.set ("name", iAirline.getAirlineName(), lNameIndicator);
36  ioIndicator = i_ok;
37  }
38 
39 }
40 
41 namespace stdair {
42 
43 }
Handle on the StdAir library context.
const std::string & getAirlineName() const
static void to_base(const stdair::AirlineStruct &iAirline, values &ioAirlineValues, indicator &ioIndicator)
Definition: DbaAirline.cpp:30
static void from_base(values const &iAirlineValues, indicator, stdair::AirlineStruct &ioAirline)
Definition: DbaAirline.cpp:17
void setAirlineCode(const AirlineCode_T &iAirlineCode)
void setAirlineName(const std::string &iAirlineName)
const AirlineCode_T & getAirlineCode() const