-// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//Open the Study HDF file
HDFfile *hdf_file = new HDFfile((char*)aHDFUrl.c_str());
- char aMultifileState[2];
- char ASCIIfileState[2];
+ char aMultifileState[2] = { '0','0' };
+ char ASCIIfileState[2] = { '0','0' };
bool hasModuleData = false;
try {
std::string scoid = anSCO.GetID();
} else
aStreamFile = NULL;
- HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group);
- multifile_hdf_dataset->OpenOnDisk();
- multifile_hdf_dataset->ReadFromDisk(aMultifileState);
+ if (hdf_sco_group->ExistInternalObject("MULTIFILE_STATE")) {
+ HDFdataset *multifile_hdf_dataset = new HDFdataset("MULTIFILE_STATE", hdf_sco_group);
+ multifile_hdf_dataset->OpenOnDisk();
+ multifile_hdf_dataset->ReadFromDisk(aMultifileState);
+ multifile_hdf_dataset->CloseOnDisk();
+ multifile_hdf_dataset = 0;
+ }
- HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group);
- ascii_hdf_dataset->OpenOnDisk();
- ascii_hdf_dataset->ReadFromDisk(ASCIIfileState);
+ if (hdf_sco_group->ExistInternalObject("ASCII_STATE")) {
+ HDFdataset *ascii_hdf_dataset = new HDFdataset("ASCII_STATE", hdf_sco_group);
+ ascii_hdf_dataset->OpenOnDisk();
+ ascii_hdf_dataset->ReadFromDisk(ASCIIfileState);
+ ascii_hdf_dataset->CloseOnDisk();
+ ascii_hdf_dataset = 0;
+ }
std::string aDir = SALOMEDSImpl_Tool::GetDirFromPath(Res);
//if(aDir != NULL) delete []aDir;
- multifile_hdf_dataset->CloseOnDisk();
- multifile_hdf_dataset = 0;
- ascii_hdf_dataset->CloseOnDisk();
- ascii_hdf_dataset = 0;
-
hdf_sco_group->CloseOnDisk();
hdf_sco_group = 0;
hdf_group->CloseOnDisk();
persist_ref,
isMultiFile,
isASCII);
- SALOMEDSImpl_AttributeIOR* iorAttr = SALOMEDSImpl_AttributeIOR::Set (current, ior_string);
-
- // make myRefCounter of a loaded GenericObj == 1
- SALOMEDSImpl_Study::UnRegisterGenObj( ior_string, iorAttr->Label());
+ SALOMEDSImpl_AttributeIOR::Set (current, ior_string);
}
Translate_persistentID_to_IOR (current, driver, isMultiFile, isASCII);
}