Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone nowadays I am working on how to read HDF compound dataset. My question is how can I get the name of the compound dataset members, I tried to get but it gave me empty name. However, when I try to get the name of members in Linux I got it but in windows MVS 2010 I could not. Any help would be appreciated.

What I have tried:

C++
H5T_class_t cTT = dataSet.getTypeClass();

if( cTT == H5T_COMPOUND )
{
      H5::CompType dc = dataSet.getCompType();

      for( int i = 0; i < dc.getNmembers(); i++ )
      {
           H5std_string memberName = dc.getMemberName( i );
          
          //memberName is = NULL; in windows
          //memberName is = ok; in linux     
      }
} 
Posted
Updated 2-Nov-17 7:17am
v2
Comments
Jochen Arndt 2-Nov-17 5:48am    
What do you mean by "memberName is = NULL; in windows"?

I don't know HDF but a quick research shows that H5std_string seems to be a std::string. That can't be NULL (but an empty string).
To access the string use memberName.c_str() and convert the encoding if necessary (it is probably UTF-8 which must be then converted before printed with Windows builds).

1 solution

If you Google a bit you might have found the documentation of H5::StrType. With the function getCset() you should get a char* to work with.

Check your compiler settings that you are working with UNICODE. Read this link to enable Support for Unicode in Visual Studio.
 
Share this answer
 
Comments
Sukerbek 2-Nov-17 21:18pm    
I have already googled whole day and then I posted my question anyway, I solved my problem with release model in Visual studio 2010.
Thank you guys

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900