Hello,

I'm new in HDF with C++. I know HDF only in Mathworks Matlab and I'm porting my Matlab Sources to C++. I can read vector and matrix structurs in my C++
application. My code to read strings:

H5::DataSet   l_dataset   = m_file.openDataSet( p_path.c_str() );
H5::DataSpace l_dataspace = l_dataset.getSpace();

hsize_t l_strlength = l_dataset.getStorageSize();
l_dataspace.close();

H5::StrType l_temp(0, l_strlength);
char* l_chars = new char[l_strlength];

l_dataset.read(l_chars, l_temp );
std::string l_str(l_chars);

if (l_chars)
        delete[] l_chars;

If I read a blas structur (template method with T as typename)

blas::vector<T> l_vec(l_size[0]);
T l_data[l_size[0]];
l_dataset.read( l_data, p_datatype );

I set with p_datatype a H5::PredType for reading the
format. Can I do this with the string values? How?
Do I read the information in the correct way?

Thank for helping

Phil
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to