X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHDFPersist%2FHDFgroup.cc;h=e8838b73ab99f2c90ed3883b444e5c135e430eec;hb=refs%2Fheads%2Fduc%2Fcm_update;hp=28876397594d6cf9c73e1e32105275ff2f023f80;hpb=e429ce02076e083051c6520e0d7113022bd67b18;p=modules%2Fkernel.git diff --git a/src/HDFPersist/HDFgroup.cc b/src/HDFPersist/HDFgroup.cc index 288763975..e8838b73a 100644 --- a/src/HDFPersist/HDFgroup.cc +++ b/src/HDFPersist/HDFgroup.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -29,11 +29,11 @@ #include "HDFgroup.hxx" #include "HDFexception.hxx" -herr_t group_attr(hid_t loc_id, const char *attr_name, void *operator_data) +herr_t group_attr(hid_t /*loc_id*/, const char *attr_name, void *operator_data) { - *(char**)operator_data = new char[strlen(attr_name)+1]; - strcpy(*(char**)operator_data, attr_name); - return 1; + *(char**)operator_data = new char[strlen(attr_name)+1]; + strcpy(*(char**)operator_data, attr_name); + return 1; } HDFgroup::HDFgroup(const char *name, HDFcontainerObject *father) @@ -44,7 +44,7 @@ HDFgroup::HDFgroup(const char *name, HDFcontainerObject *father) _father->AddSon(this); _mid = -1; _attribute = NULL; -}; +} void HDFgroup::CreateOnDisk() { @@ -104,17 +104,31 @@ int HDFgroup::ExistInternalObject(const char *object_name) n = this->nInternalObjects(); for (i=0;iInternalObjectIndentify(i,name); + if (!strcmp(name,object_name)) { - this->InternalObjectIndentify(i,name); - if (!strcmp(name,object_name)) - { - ret = 1; - break; - } - } + ret = 1; + break; + } + } return ret; } +void HDFgroup::GetAllObjects(std::vector< std::string > & object_names ) +{ + int n,i; + char name[HDF_NAME_MAX_LEN+1]; + + n = this->nInternalObjects(); + object_names.reserve( object_names.size() + n ); + for (i=0;iInternalObjectIndentify(i,name); + object_names.push_back( name ); + } +} + hdf_object_type HDFgroup::InternalObjectType(char *object_name) { hdf_object_type type; @@ -145,10 +159,10 @@ void HDFgroup::FileUnMount() hdf_err ret; if ((ret = HDFfileUmount(_fid,_name)) < 0) - throw HDFexception("Can't unmount the file"); + throw HDFexception("Can't unmount the file"); if ((ret = HDFfileClose(_mid)) < 0) - throw HDFexception("Can't unmount the file"); + throw HDFexception("Can't unmount the file"); _mid = -1; }