You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The handling of variable-length strings is not yet implemented in
hdf5_unified_read
For the case that the dataset has just a single element, I implemented it in my local version:
} else if (ourType == GDL_STRING) {
- if (debug) printf("fixed-length string dataset\n");
+ bool isVarLenStr = H5Tis_variable_str(elem_dtype) > 0;
+ if (debug) printf(isVarLenStr ? "variable-length string dataset\n" : "fixed-length string dataset\n");
// string length (terminator included)
SizeT str_len = H5Tget_size(elem_dtype);
// total number of array elements
SizeT num_elems=1;
for(int i=0; i<rank_s; i++) num_elems *= count_s[i];
+ if (num_elems == 1 && isVarLenStr) {
+ char* raw = nullptr;
+ hdf5_basic_read( loc_id, datatype, ms_id, fs_id, &raw, e );
+
+ // create GDL variable
+ res = new DStringGDL(raw);
+
+ H5Dvlen_reclaim (ms_id, fs_id, H5P_DEFAULT, &raw);
+
+ return res;
+ }
// allocate & read raw buffer
char* raw = (char*) malloc(num_elems*str_len*sizeof(char));
Implementation of the array case is probably not difficult either, but I am neither familiar enough with DStringGDL, nor do I have a suitable .hdf5 file ready with which I could test that scenario.
The text was updated successfully, but these errors were encountered:
Thanks, @klimpel . I will have a look, if I find some time. But it's been long enough that I need to re-familiarize myself with the Array-specific code.
The handling of variable-length strings is not yet implemented in
hdf5_unified_read
For the case that the dataset has just a single element, I implemented it in my local version:
Implementation of the array case is probably not difficult either, but I am neither familiar enough with DStringGDL, nor do I have a suitable .hdf5 file ready with which I could test that scenario.
The text was updated successfully, but these errors were encountered: