OTB  9.0.0
Orfeo Toolbox
Public Member Functions | Private Attributes | 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)
 
char ** to_ogr () const
 

Private Attributes

std::vector< char const * > m_raw
 

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

◆ StringListConverter()

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

◆ to_ogr()

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

◆ m_raw

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

Definition at line 109 of file otbOGRHelpers.h.


The documentation for this class was generated from the following file:
otb::ogr::DataSource
Collection of geometric objects.
Definition: otbOGRDataSourceWrapper.h:83
otb::ogr::StringListConverter::to_ogr
char ** to_ogr() const
Definition: otbOGRHelpers.h:103
otb::ogr::StringListConverter::StringListConverter
StringListConverter(ContainerType const &strings)
Definition: otbOGRHelpers.h:88