EleFits  4.0.1
A modern C++ API on top of CFitsIO
Public Member Functions | Public Attributes | List of all members
Euclid::Cfitsio::CStrArray Struct Reference

#include <CfitsioUtils.h>

Class Description

A helper structure to safely convert vector<string> to char **.

To call some function f(char **) with a vector of strings v, do:

CStrArray a(v);
f(a.data());
Warning
The CStrArray should not be destroyed before the user function ends.

Public Member Functions

template<typename T >
 CStrArray (const T begin, const T end)
 Create from begin and end iterators.
 
 CStrArray (const std::vector< std::string > &data)
 Create from a vector.
 
 CStrArray (const std::initializer_list< std::string > &data)
 Create from an initializer_list.
 
std::size_t size () const
 The number of elements.
 
char ** data ()
 Get the data as a non-const char **.
 

Public Attributes

std::vector< std::unique_ptr< char[]> > smartPtrVector
 A vector of smart pointers to char[]. More...
 
std::vector< char * > cStrVector
 A vector of char*. More...
 

The documentation for this struct was generated from the following file:
Euclid::Cfitsio::CStrArray::CStrArray
CStrArray(const T begin, const T end)
Create from begin and end iterators.