Skip to content
Snippets Groups Projects
Commit f0c95013 authored by Luc Hermitte's avatar Luc Hermitte
Browse files

COM: OTB-134/OGR -> type promotion char[42] -> char* for Field::SetValue()

parent 0892c6b6
Branches
Tags
No related merge requests found
......@@ -119,6 +119,19 @@ public:
*/
template <typename T> void SetValue(T const& value);
/**
* Value setter.
* This overload is meant to help type promotions from <tt>char const[42]</tt> to
* <tt>char const*</tt>.
* \param[in] value New value for the field.
* \throw None
* \pre \c value's kind must match the field's type.
* \internal
* This function automagically decodes the type of the parameter in order to
* use the ad'hoc setter from \c OGRFeature.
*/
template <typename T, size_t N> void SetValue(T const value[N]);
/**
* Value getter.
* \tparam T expected type for the stored value.
......
......@@ -395,6 +395,13 @@ void otb::ogr::Field::SetValue(T const& value)
SetterType::call(*m_Feature, m_index, Converter::convert(value));
}
template <typename T, size_t N>
inline
void otb::ogr::Field::SetValue(T const value[N])
{
this->SetValue(&value[0]);
}
template <typename T>
inline
T otb::ogr::Field::GetValue() const
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment