//-------------------------------------------------------------------------- // Function: IdComponent::p_get_file_name (protected) // Purpose Gets the name of the file, in which this object belongs. // Exception: H5::IdComponentException // Description: // This function is protected so that the user applications can // only have access to its code via H5Location subclasses. // September 2017 // This function should be moved to H5Location now that Attribute // inherits from H5Location. // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- H5std_string IdComponent::p_get_file_name() const { hid_t temp_id = getId(); // Preliminary call to H5Fget_name to get the length of the file name ssize_t name_size = H5Fget_name(temp_id, NULL, 0); // If H5Aget_name returns a negative value, raise an exception, if (name_size < 0) { throw IdComponentException("", "H5Fget_name failed"); } // Call H5Fget_name again to get the actual file name char* name_C = new char[name_size+1]; // temporary C-string for C API HDmemset(name_C, 0, name_size+1); // clear buffer name_size = H5Fget_name(temp_id, name_C, name_size+1); // Check for failure again if (name_size < 0) { delete []name_C; throw IdComponentException("", "H5Fget_name failed"); } // Convert the C file name and return H5std_string file_name(name_C); delete []name_C; return(file_name); }
std::string file::name() const { // same function as for group char _n[1]; ssize_t size = H5Fget_name(id, _n, 1); // first call, get the size only std::vector<char> buf(size + 1, 0x00); H5Fget_name(id, buf.data(), 1); // now get the name std::string res = ""; res.append(&(buf.front())); return res; }
string FileHDF5::location() const { ssize_t size = H5Fget_name(hid, nullptr, 0); if (size < 0) { throw H5Exception("H5Fget_name failed"); } std::vector<char> buf(static_cast<size_t>(size + 1), 0); size = H5Fget_name(hid, buf.data(), buf.size()); if (size < 0) { throw H5Exception("H5Fget_name failed"); } return std::string(buf.data()); }
/****if* H5Ff/h5fget_name_c * NAME * h5fget_name_c * PURPOSE * Call H5Fget_name to get file's name * INPUTS * obj_id - object identifier * buflen -size of the buffer * OUTPUTS * buf - buffer to hold the name * size - size of the file's name * RETURNS * 0 on success, -1 on failure * AUTHOR * Elena Pourmal * Tuesday, July 6, 2004 * SOURCE */ int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) /******/ { char *c_buf = NULL; /* Buffer to hold C string */ ssize_t size_c = -1; int_f ret_value = 0; /* Return value */ /* * Allocate buffer to hold name of an attribute */ if(NULL == (c_buf = (char *)HDmalloc((size_t)*buflen + 1))) HGOTO_DONE(FAIL); /* * Call H5Fget_name function */ if ((size_c = H5Fget_name((hid_t)*obj_id, c_buf, (size_t)*buflen)) < 0) HGOTO_DONE(FAIL); /* * Convert C name to FORTRAN and place it in the given buffer */ HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buflen); done: *size = (size_t_f)size_c; if(c_buf) HDfree(c_buf); return ret_value; }
static VALUE rb_H5Fget_name (VALUE mod, VALUE v_obj_id) { ssize_t len; VALUE v_name; len = H5Fget_name(NUM2INT(v_obj_id), (char*)0, 0); if ( len < 0 ) rb_hdf5_raise("can't get object file name"); v_name = rb_str_new("", len); H5Fget_name(NUM2INT(v_obj_id), StringValuePtr(v_name), len+1); return v_name; }
// Read dataset in externalElement and open external files char AH5_read_eet_dataset (hid_t file_id, const char *path, AH5_eet_dataset_t *eet_dataset) { H5T_class_t type_class; char rdata = AH5_FALSE; hsize_t dims[2], i; size_t length; int nb_dims; ssize_t fpath_size; eet_dataset->path = strdup(path); fpath_size = H5Fget_name(file_id, NULL, 0); // Strange behavior of H5Fget_name: it seems to return to small length. eet_dataset->principle_file_path = malloc(fpath_size + 2); eet_dataset->principle_file_path[fpath_size + 1] = '\0'; eet_dataset->principle_file_path[fpath_size] = '\0'; H5Fget_name(file_id, eet_dataset->principle_file_path, fpath_size + 1); if (AH5_path_valid(file_id, path)) if (H5LTget_dataset_ndims(file_id, path, &nb_dims) >= 0) if (nb_dims == 2) if (H5LTget_dataset_info(file_id, path, dims, &type_class, &length) >= 0) if (dims[0] > 0 && dims[1] == 3 && type_class == H5T_STRING) if(AH5_read_str_dataset(file_id, path, dims[0] * dims[1], length, &(eet_dataset->eed_items))) { eet_dataset->nb_eed_items = dims[0]; rdata = AH5_TRUE; eet_dataset->file_id = (hid_t *) malloc((size_t) eet_dataset->nb_eed_items * sizeof(hid_t)); for (i = 0; i < eet_dataset->nb_eed_items; i++) eet_dataset->file_id[i] = -1; } if (!rdata) { AH5_print_err_dset(AH5_C_EXTERNAL_ELEMENT, path); eet_dataset->nb_eed_items = 0; eet_dataset->file_id = NULL; eet_dataset->eed_items = NULL; } else if (!AH5_open_external_files(eet_dataset)) rdata = AH5_FALSE; return rdata; }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void SurfaceMeshDataContainerWriter::writeXdmfGridHeader() { if (m_WriteXdmfFile == false || m_XdmfPtr == NULL) { return; } DREAM3D::SurfaceMesh::FaceListPointer_t faces = getSurfaceMeshDataContainer()->getFaces(); if (NULL == faces.get()) { return; } DREAM3D::SurfaceMesh::VertListPointer_t verts = getSurfaceMeshDataContainer()->getVertices(); if(NULL == verts.get()) { return; } std::ostream& out = *m_XdmfPtr; out << " <Grid Name=\"SurfaceMesh DataContainer\">" << std::endl; out << " <Topology TopologyType=\"Triangle\" NumberOfElements=\"" << faces->GetNumberOfTuples() << "\">" << std::endl; out << " <DataItem Format=\"HDF\" NumberType=\"Int\" Dimensions=\"" << faces->GetNumberOfTuples() << " 3\">" << std::endl; ssize_t nameSize = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer(nameSize, 0); nameSize = H5Fget_name(m_HdfFileId, &(nameBuffer.front()), nameSize); std::string hdfFileName(&(nameBuffer.front()), nameSize); hdfFileName = MXAFileInfo::filename(hdfFileName); out << " " << hdfFileName << ":/SurfaceMeshDataContainer/Faces" << std::endl; out << " </DataItem>" << std::endl; out << " </Topology>" << std::endl; out << " <Geometry Type=\"XYZ\">" << std::endl; out << " <DataItem Format=\"HDF\" Dimensions=\"" << verts->GetNumberOfTuples() << " 3\" NumberType=\"Float\" Precision=\"4\">" << std::endl; out << " " << hdfFileName << ":/SurfaceMeshDataContainer/Vertices" << std::endl; out << " </DataItem>" << std::endl; out << " </Geometry>" << std::endl; out << "" << std::endl; }
static std::string filename(hid_t id) { MPQC_FILE_THREADSAFE; std::vector<char> str(H5Fget_name(id, NULL, 0) + 1); MPQC_FILE_VERIFY(H5Fget_name(id, &str[0], str.size())); return std::string(&str[0]); }
hid_t dat1Reopen( hid_t file_id, unsigned int flags, hid_t fapl, int *status ){ /* Local Variables; */ HDSLoc **loc; HDSLoc **loclist; char **paths; char file[EMS__SZMSG+1]; char path[EMS__SZMSG+1]; hid_t *file_ids; hid_t id; int *isgroup; int iloc; int nlev; int nloc; ssize_t size; /* Return immediately if an error has already occurred. */ if( *status != SAI__OK ) return file_id; /* Get a list of any active locators associated with the file. Also get a list of file_ids for the same file that have associated locators. */ hds1GetLocators( file_id, &nloc, &loclist, &file_ids, status ); /* Check that none of the locators are mapped. */ if( *status == SAI__OK ) { loc = loclist; for( iloc = 0; iloc < nloc; iloc++,loc++ ) { if( (*loc)->regpntr ) { hdsTrace( (*loc), &nlev, path, file, status, sizeof(path), sizeof(file) ); *status = DAT__PRMAP; emsRepf( " ", "hdsOpen: Cannot re-open '%s' in read-write mode " "since '%s' is currently mapped.", status, file, path ); break; } } } /* Store the path to the HDF5 object associated with each active locator, and also a flag indicating if the HDF5 object is a group or dataset. Then close the HDF5 objects. */ paths = MEM_CALLOC( nloc, sizeof( *paths ) ); isgroup = MEM_CALLOC( nloc, sizeof( *isgroup ) ); if( paths && isgroup && *status == SAI__OK ) { loc = loclist; for( iloc = 0; iloc < nloc; iloc++,loc++ ) { if( (*loc)->group_id ) { isgroup[ iloc ] = 1; id = (*loc)->group_id; } else { isgroup[ iloc ] = 0; id = (*loc)->dataset_id; } if( id ) { size = H5Iget_name( id, NULL, 0 ); paths[ iloc ] = MEM_CALLOC( size + 1, 1 ); H5Iget_name( id, paths[ iloc ], size + 1 ); } else { hdsTrace( (*loc), &nlev, path, file, status, sizeof(path), sizeof(file) ); *status = DAT__FATAL; emsRepf( " ", "hdsOpen: Locator for '%s.%s' has no group or " "dataset so cannot be reopened.", status, file, path ); break; } if( H5Oclose( id ) < 0 ) { hdsTrace( (*loc), &nlev, path, file, status, sizeof(path), sizeof(file) ); *status = DAT__FATAL; dat1H5EtoEMS( status ); emsRepf( " ", "hdsOpen: Failed to close HDF5 object for '%s.%s'.", status, file, path ); break; } } } /* Get the path for the file. */ H5Fget_name( file_id, path, sizeof(path) ); /* Close all HDF5 file_ids associated with file. */ if( *status == SAI__OK ) { int this_closed = 0; int i = -1; while( file_ids[ ++i ] ) { if( file_ids[ i ] == file_id ) this_closed = 1; if( H5Fclose( file_ids[ i ] ) < 0 ) { *status = DAT__FATAL; dat1H5EtoEMS( status ); emsRepf( " ", "hdsOpen: Failed to close file '%s' prior to " "re-opening it.", status, path ); break; } } /* Close the supplied file_id if it has not already been closed. */ if( !this_closed ) { if( H5Fclose( file_id ) < 0 ) { *status = DAT__FATAL; dat1H5EtoEMS( status ); emsRepf( " ", "hdsOpen: Failed to close file '%s' prior to " "re-opening it.", status, path ); } } } /* Re-open it. */ if( *status == SAI__OK ) { file_id = H5Fopen( path, flags, fapl ); if( file_id < 0 ) { *status = DAT__FATAL; dat1H5EtoEMS( status ); emsRepf( " ", "hdsOpen: Failed to reopen file '%s'.", status, path ); } } /* Update the file, group and dataset id in each locator. */ if( *status == SAI__OK ) { loc = loclist; for( iloc = 0; iloc < nloc; iloc++,loc++ ) { hds1SetFileId( (*loc), file_id, status ); if( isgroup[ iloc ] ) { (*loc)->group_id = H5Gopen2( file_id, paths[ iloc ], H5P_DEFAULT ); } else { (*loc)->dataset_id = H5Dopen2( file_id, paths[ iloc ], H5P_DEFAULT ); } } } /* Free resources. */ if( paths ) { for( iloc = 0; iloc < nloc; iloc++ ) { MEM_FREE( paths[ iloc ] ); } MEM_FREE( paths ); } if( isgroup ) MEM_FREE( isgroup ); if( loclist ) MEM_FREE( loclist ); if( file_ids ) MEM_FREE( file_ids ); /* Return the new file id. */ return file_id; }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- int VoxelDataContainerWriter::writeFieldData(hid_t dcGid) { std::stringstream ss; int err = 0; VoxelDataContainer* m = getVoxelDataContainer(); #if WRITE_FIELD_XDMF // Get the name of the .dream3d file that we are writing to: ssize_t nameSize = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer(nameSize, 0); nameSize = H5Fget_name(m_HdfFileId, &(nameBuffer.front()), nameSize); std::string hdfFileName(&(nameBuffer.front()), nameSize); hdfFileName = MXAFileInfo::filename(hdfFileName); std::string xdmfGroupPath = std::string(":/") + VoxelDataContainer::ClassName() + std::string("/") + H5_FIELD_DATA_GROUP_NAME; #endif int64_t volDims[3] = { 0,0,0 }; // Write the Field Data err = H5Utilities::createGroupsFromPath(H5_FIELD_DATA_GROUP_NAME, dcGid); if(err < 0) { std::cout << "Error creating HDF Group " << H5_FIELD_DATA_GROUP_NAME << std::endl; return err; } err = H5Lite::writeStringAttribute(dcGid, H5_FIELD_DATA_GROUP_NAME, H5_NAME, H5_FIELD_DATA_DEFAULT); if(err < 0) { return err; } hid_t fieldGroupId = H5Gopen(dcGid, H5_FIELD_DATA_GROUP_NAME, H5P_DEFAULT); if(err < 0) { ss.str(""); ss << "Error opening field Group " << H5_FIELD_DATA_GROUP_NAME << std::endl; setErrorCondition(-65); notifyErrorMessage( ss.str(), err); H5Gclose(dcGid); // Close the Data Container Group return err; } size_t total = 0; typedef std::vector<IDataArray*> VectorOfIDataArrays_t; VectorOfIDataArrays_t neighborListArrays; NameListType names = m->getFieldArrayNameList(); if (names.size() > 0) { IDataArray::Pointer array = m->getFieldData(names.front()); total = array->GetSize(); volDims[0] = total; volDims[1] = 1; volDims[2] = 1; #if WRITE_FIELD_XDMF ss.str(""); ss << "Field Data (" << total << ")"; writeFieldXdmfGridHeader(total, ss.str()); #endif } // Now loop over all the field data and write it out, possibly wrapping it with XDMF code also. for (NameListType::iterator iter = names.begin(); iter != names.end(); ++iter) { IDataArray::Pointer array = m->getFieldData(*iter); if (array->getTypeAsString().compare(NeighborList<int>::ClassName()) == 0) { neighborListArrays.push_back(array.get()); } else if (NULL != array.get()) { err = array->writeH5Data(fieldGroupId); if(err < 0) { ss.str(""); ss << "Error writing field array '" << (*iter).c_str() << "' to the HDF5 File"; notifyErrorMessage( ss.str(), err); setErrorCondition(err); H5Gclose(fieldGroupId); // Close the Cell Group H5Gclose(dcGid); // Close the Data Container Group return err; } #if WRITE_FIELD_XDMF array->writeXdmfAttribute( *m_XdmfPtr, volDims, hdfFileName, xdmfGroupPath, " (Field)"); #endif } } #if WRITE_FIELD_XDMF if (names.size() > 0) { writeXdmfGridFooter("Field Data"); } #endif // Write the NeighborLists onto their own grid // We need to determine how many total elements we are going to end up with and group the arrays by // those totals so we can minimize the number of grids typedef std::map<size_t, VectorOfIDataArrays_t> SizeToIDataArrays_t; SizeToIDataArrays_t sizeToDataArrays; for(VectorOfIDataArrays_t::iterator iter = neighborListArrays.begin(); iter < neighborListArrays.end(); ++iter) { IDataArray* array = (*iter); sizeToDataArrays[array->GetSize()].push_back(array); } // Now loop over each pair in the map creating a section in the XDMF and also writing the data to the HDF5 file for(SizeToIDataArrays_t::iterator pair = sizeToDataArrays.begin(); pair != sizeToDataArrays.end(); ++pair) { total = (*pair).first; VectorOfIDataArrays_t& arrays = (*pair).second; volDims[0] = total; volDims[1] = 1; volDims[2] = 1; #if WRITE_FIELD_XDMF ss.str(""); ss << "Neighbor Data (" << total << ")"; writeFieldXdmfGridHeader(total, ss.str()); #endif for(VectorOfIDataArrays_t::iterator iter = arrays.begin(); iter < arrays.end(); ++iter) { err = (*iter)->writeH5Data(fieldGroupId); if(err < 0) { ss.str(""); ss << "Error writing neighbor list field array '" << (*iter)->GetName() << "' to the HDF5 File"; notifyErrorMessage( ss.str(), err); setErrorCondition(err); H5Gclose(fieldGroupId); // Close the Cell Group H5Gclose(dcGid); // Close the Data Container Group return err; } #if WRITE_FIELD_XDMF (*iter)->writeXdmfAttribute( *m_XdmfPtr, volDims, hdfFileName, xdmfGroupPath, " (Neighbor Data)"); #endif } #if WRITE_FIELD_XDMF writeXdmfGridFooter(ss.str()); #endif } H5Gclose(fieldGroupId); return err; }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- int VoxelDataContainerWriter::writeCellData(hid_t dcGid) { std::stringstream ss; int err = 0; VoxelDataContainer* m = getVoxelDataContainer(); int64_t volDims[3] = { m->getXPoints(), m->getYPoints(), m->getZPoints() }; float spacing[3] = { m->getXRes(), m->getYRes(), m->getZRes() }; float origin[3] = { 0.0f, 0.0f, 0.0f }; m->getOrigin(origin); writeCellXdmfGridHeader(origin, spacing, volDims); // Get the name of the .dream3d file that we are writing to: ssize_t nameSize = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer(nameSize, 0); nameSize = H5Fget_name(m_HdfFileId, &(nameBuffer.front()), nameSize); std::string hdfFileName(&(nameBuffer.front()), nameSize); hdfFileName = MXAFileInfo::filename(hdfFileName); std::string xdmfGroupPath = std::string(":/") + VoxelDataContainer::ClassName() + std::string("/") + H5_CELL_DATA_GROUP_NAME; // Write the Voxel Data err = H5Utilities::createGroupsFromPath(H5_CELL_DATA_GROUP_NAME, dcGid); if(err < 0) { ss.str(""); ss << "Error creating HDF Group " << H5_CELL_DATA_GROUP_NAME << std::endl; setErrorCondition(-63); notifyErrorMessage(ss.str(), err); H5Gclose(dcGid); // Close the Data Container Group return err; } hid_t cellGroupId = H5Gopen(dcGid, H5_CELL_DATA_GROUP_NAME, H5P_DEFAULT); if(err < 0) { ss.str(""); ss << "Error writing string attribute to HDF Group " << H5_CELL_DATA_GROUP_NAME << std::endl; setErrorCondition(-64); notifyErrorMessage(ss.str(), err); H5Gclose(dcGid); // Close the Data Container Group return err; } NameListType names = m->getCellArrayNameList(); for (NameListType::iterator iter = names.begin(); iter != names.end(); ++iter) { ss.str(""); ss << "Writing Cell Data '" << *iter << "' to HDF5 File" << std::endl; notifyStatusMessage(ss.str()); IDataArray::Pointer array = m->getCellData(*iter); err = array->writeH5Data(cellGroupId); if(err < 0) { ss.str(""); ss << "Error writing array '" << *iter << "' to the HDF5 File"; notifyErrorMessage(ss.str(), err); setErrorCondition(err); H5Gclose(cellGroupId); // Close the Cell Group H5Gclose(dcGid); // Close the Data Container Group return err; } array->writeXdmfAttribute( *m_XdmfPtr, volDims, hdfFileName, xdmfGroupPath, " (Cell)"); } H5Gclose(cellGroupId); // Close the Cell Group writeXdmfGridFooter("Cell Data"); return err; }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- std::string SurfaceMeshDataContainerWriter::writeXdmfAttributeDataHelper(int numComp, const std::string &attrType, const std::string &groupName, IDataArray::Pointer array, const std::string ¢ering, int precision, const std::string &xdmfTypeName) { std::stringstream out; std::stringstream dimStr; std::stringstream dimStr1; std::stringstream dimStr1half; std::stringstream dimStr2; std::stringstream dimStr2half; if((numComp%2) == 1) { out << " <Attribute Name=\"" << array->GetName() << "\" "; out << "AttributeType=\"" << attrType << "\" "; dimStr << array->GetNumberOfTuples() << " " << array->GetNumberOfComponents(); out << "Center=\"" << centering << "\">" << std::endl; // Open the <DataItem> Tag out << " <DataItem Format=\"HDF\" Dimensions=\"" << dimStr.str() << "\" "; out << "NumberType=\"" << xdmfTypeName << "\" " << "Precision=\"" << precision << "\" >" << std::endl; ssize_t nameSize = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer(nameSize, 0); nameSize = H5Fget_name(m_HdfFileId, &(nameBuffer.front()), nameSize); std::string hdfFileName(&(nameBuffer.front()), nameSize); hdfFileName = MXAFileInfo::filename(hdfFileName); out << " " << hdfFileName << ":/SurfaceMeshDataContainer/" << groupName << "/" << array->GetName() << std::endl; out << " </DataItem>" << std::endl; out << " </Attribute>" << std::endl << std::endl; } else { //First Slab out << " <Attribute Name=\"" << array->GetName() << " (Field 0)\" "; out << "AttributeType=\"" << attrType << "\" "; dimStr1 << array->GetNumberOfTuples() << " " << array->GetNumberOfComponents(); dimStr1half << array->GetNumberOfTuples() << " " << (array->GetNumberOfComponents()/2); out << "Center=\"" << centering << "\">" << std::endl; // Open the <DataItem> Tag out << " <DataItem ItemType=\"HyperSlab\" Dimensions=\"" << dimStr1half.str() << "\" "; out << "Type=\"HyperSlab\" " << "Name=\"" << array->GetName() << " (Field 0)\" >" << std::endl; out << " <DataItem Dimensions=\"3 2\" " << "Format=\"XML\" >" << std::endl; out << " 0 0" << std::endl; out << " 1 1" << std::endl; out << " " << dimStr1half.str() << " </DataItem>" << std::endl; out << std::endl; out << " <DataItem Format=\"HDF\" Dimensions=\"" << dimStr1.str() << "\" " << "NumberType=\"" << xdmfTypeName << "\" " << "Precision=\"" << precision << "\" >" << std::endl; ssize_t nameSize = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer(nameSize, 0); nameSize = H5Fget_name(m_HdfFileId, &(nameBuffer.front()), nameSize); std::string hdfFileName(&(nameBuffer.front()), nameSize); hdfFileName = MXAFileInfo::filename(hdfFileName); out << " " << hdfFileName << ":/SurfaceMeshDataContainer/" << groupName << "/" << array->GetName() << std::endl; out << " </DataItem>" << std::endl; out << " </DataItem>" << std::endl; out << " </Attribute>" << std::endl << std::endl; //Second Slab out << " <Attribute Name=\"" << array->GetName() << " (Field 1)\" "; out << "AttributeType=\"" << attrType << "\" "; dimStr2 << array->GetNumberOfTuples() << " " << array->GetNumberOfComponents(); dimStr2half << array->GetNumberOfTuples() << " " << (array->GetNumberOfComponents()/2); out << "Center=\"" << centering << "\">" << std::endl; // Open the <DataItem> Tag out << " <DataItem ItemType=\"HyperSlab\" Dimensions=\"" << dimStr2half.str() << "\" "; out << "Type=\"HyperSlab\" " << "Name=\"" << array->GetName() << " (Field 1)\" >" << std::endl; out << " <DataItem Dimensions=\"3 2\" " << "Format=\"XML\" >" << std::endl; out << " 0 " << (array->GetNumberOfComponents()/2) << std::endl; out << " 1 1" << std::endl; out << " " << dimStr2half.str() << " </DataItem>" << std::endl; out << std::endl; out << " <DataItem Format=\"HDF\" Dimensions=\"" << dimStr2.str() << "\" " << "NumberType=\"" << xdmfTypeName << "\" " << "Precision=\"" << precision << "\" >" << std::endl; ssize_t nameSize2 = H5Fget_name(m_HdfFileId, NULL, 0) + 1; std::vector<char> nameBuffer2(nameSize2, 0); nameSize2 = H5Fget_name(m_HdfFileId, &(nameBuffer2.front()), nameSize2); std::string hdfFileName2(&(nameBuffer2.front()), nameSize2); hdfFileName2 = MXAFileInfo::filename(hdfFileName2); out << " " << hdfFileName2 << ":/SurfaceMeshDataContainer/" << groupName << "/" << array->GetName() << std::endl; out << " </DataItem>" << std::endl; out << " </DataItem>" << std::endl; out << " </Attribute>" << std::endl << std::endl; } return out.str(); }