18 #ifndef __otbOGRHelpers_h
19 #define __otbOGRHelpers_h
24 #include <boost/range/begin.hpp>
25 #include <boost/range/end.hpp>
26 #include <boost/range/size.hpp>
27 #include <boost/mpl/assert.hpp>
28 #include <boost/type_traits/is_same.hpp>
30 #include "cpl_string.h"
58 template <
class ContainerType>
71 BOOST_MPL_ASSERT((boost::is_same<typename ContainerType::value_type, std::string>));
72 m_raw.reserve(boost::size(strings)+1);
73 for (
typename ContainerType::const_iterator b = boost::begin(strings), e = boost::end(strings); b != e; ++b)
75 m_raw.push_back(b->c_str());
78 assert(CSLCount(const_cast <char**>(&
m_raw[0])) == boost::size(strings));
85 return m_raw.size() == 1
87 : const_cast <
char**>(&
m_raw[0]);
96 #endif // __otbOGRHelpers_h