47 if (!
res)
return NULL;
49 res->n = vdata.size();
51 res->strings =
new char*[
res->n];
52 if (!
res->strings)
goto hadError_Strings;
53 memset(
res->strings, 0,
sizeof(
char*) *
res->n);
55 for (
size_t i = 0;
i <
res->n; ++
i) {
56 size_t slen = vdata[
i].length();
57 res->strings[
i] =
new char[slen + 1];
58 if (!
res->strings[
i])
goto hadError_InnerStrings;
60 std::copy_n(vdata[
i].cbegin(), slen,
res->strings[
i]);
61 res->strings[
i][slen] =
'\0';
66 hadError_InnerStrings:
67 for (
size_t i = 0;
i <
res->n; ++
i)
68 if (
res->strings[
i])
delete res->strings[
i];
Interfaces for ioda::Group and related classes.
C bindings interface to templated C++ ioda classes and functions.
This class represents attributes, which may be attached to both Variables and Groups.
Groups are a new implementation of ObsSpaces.
This class exists inside of ioda::Group or ioda::Variable and provides the interface to manipulating ...
This class exists inside of ioda::Group and provides the interface to manipulating Variables.
Describes the dimensions of an Attribute or Variable.
Used to specify Variable creation-time properties.
ioda::Has_Attributes atts
Return type when arrays of strings are encountered.
ioda::VariableCreationParameters params
ioda_string_ret_t * create_str_vector_c(const std::vector< std::string > &vdata) noexcept