1#ifndef __STDAIR_BOM_CONFIGHOLDERSTRUCT_HPP
2#define __STDAIR_BOM_CONFIGHOLDERSTRUCT_HPP
11#include <boost/static_assert.hpp>
12#include <boost/type_traits/is_same.hpp>
13#if BOOST_VERSION_MACRO >= 104100
15#include <boost/property_tree/ptree.hpp>
24#if BOOST_VERSION_MACRO >= 104100
61 bool addValue (
const std::string& iValue,
62 const std::string& iPath);
72 template <
typename ValueType>
73 bool exportValue (ValueType& ioValue,
const std::string& iPath)
const;
96 void toStream (std::ostream& ioOut)
const;
143 template <
typename ValueType>
145 const std::string& iPath)
const {
147 bool hasValueBeenSuccessfullyRetrieved =
true;
149#if BOOST_VERSION_MACRO >= 104100
153 const std::string lPrefix (
"config.");
154 const std::string lFinalPath = lPrefix + iPath;
155 ioValue = _pt.get<ValueType> (lFinalPath);
157 }
catch (bpt::ptree_error& bptException) {
158 hasValueBeenSuccessfullyRetrieved =
false;
162 return hasValueBeenSuccessfullyRetrieved;
174 inline bool ConfigHolderStruct::exportValue<Date_T>
176 const std::string& iPath)
const {
178 bool hasValueBeenSuccessfullyRetrieved =
true;
180#if BOOST_VERSION_MACRO >= 104100
186 const std::string lPrefix (
"config.");
187 const std::string lFinalPath = lPrefix + iPath;
188 const std::string& lDateStr =
189 _pt.get<std::string> (lFinalPath);
193 boost::gregorian::from_simple_string (lDateStr);
195 }
catch (bpt::ptree_error& bptException) {
196 hasValueBeenSuccessfullyRetrieved =
false;
200 return hasValueBeenSuccessfullyRetrieved;
Handle on the StdAir library context.
boost::gregorian::date Date_T
Base class for the light structures.
Class representing the actual attributes for the Bom root.
const std::string describe() const
void add(const bpt::ptree &)
bool exportValue(ValueType &ioValue, const std::string &iPath) const
bool addValue(const std::string &iValue, const std::string &iPath)
const std::string jsonExport() const
void updateAirlineFeatures(BomRoot &)
void toStream(std::ostream &ioOut) const
void fromStream(std::istream &ioIn)