HDF5 C ++:读取复合数据集中的字符串 [英] HDF5 C++: read a string in a compound data set

查看:446
本文介绍了HDF5 C ++:读取复合数据集中的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我现在正在研究如何阅读HDF复合数据集。我的问题是如何获取复合数据集成员的名称,我试图得到但它给了我空名。但是,当我试图在Linux中获得成员的名字时,我得到了它但是在Windows MVS 2010中我不能。任何帮助将不胜感激。



我尝试过:



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:

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     
      }
} 

推荐答案

如果你有点Google,你可能已经找到了 H5 :: StrType 的文档。使用 getCset()功能,你应该得到一个char *来工作。 />


检查您使用UNICODE的编译器设置。阅读此链接以在Visual Studio中启用支持Unicode
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.


这篇关于HDF5 C ++:读取复合数据集中的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆