If you only need to read them from python, then a quick solution is to create an adapter class that uses std::string
s, and an adapter function. This all goes in the .i file via %inline, you'll also need %rename and probably %ignore. Example,
%ignore(S)
%rename(S) Swrap
%rename(get_S) get_SWrap
%newobject get_Swrap
%inline %{
struct Swrap
{
inline Swrap(S* s): one_name(s.one_name)
{
for (i=0; i<N_NAMES; ++i)
names[i] = s.names[i];
// no longer need s:
delete s;
}
string one_name;
string names[N_NAMES];
};
Swrap* get_Swrap() {
return new Swrap(get_S());
}
%}