OTB  6.7.0
Orfeo Toolbox
Public Member Functions | List of all members
otb::ogr::StringListConverter Class Reference

#include <otbOGRHelpers.h>

+ Collaboration diagram for otb::ogr::StringListConverter:

Public Member Functions

template<class ContainerType >
 StringListConverter (ContainerType const &strings)
 
std::vector< char const * > m_raw
 
char ** to_ogr () const
 

Detailed Description

Helper class to convert a set of standard C++ string into char** as OGR API expects.

Usage:

std::vector<std::string> options;
options.push_back(....);
new otb::ogr::DataSource("name.shp", StringListConverter(options).to_ogr());
Since
OTB v 3.14.0
Todo:
Have DataSource constructor receive a std::vector<std::string>, or even more precide types.

Definition at line 73 of file otbOGRHelpers.h.

Constructor & Destructor Documentation

template<class ContainerType >
otb::ogr::StringListConverter::StringListConverter ( ContainerType const &  strings)
inlineexplicit

Init constructor.

Template Parameters
ContainerTypeAny container matching C++ convention for standard containers (have a value_type, begin(), end()).
Parameters
[in]stringslist of strings to convert
Exceptions
std::bad_allocPrepares m_raw with to contain a list of strings that can be seen as a 0-terminated array of char*.

Definition at line 88 of file otbOGRHelpers.h.

Member Function Documentation

char** otb::ogr::StringListConverter::to_ogr ( ) const
inline

Access to the OGR compliant list of strings.

Definition at line 103 of file otbOGRHelpers.h.

Referenced by otb::OGRDataSourceToLabelImageFilter< TOutputImage >::GenerateData().

Member Data Documentation

std::vector<char const*> otb::ogr::StringListConverter::m_raw
private

Access to the OGR compliant list of strings.

Definition at line 110 of file otbOGRHelpers.h.


The documentation for this class was generated from the following file: