void suspend()
{
if (myLocked) {
- myStudy->GetProperties()->SetLocked(true);
- myPrevLocked = myLocked;
- myLocked = false;
+ myStudy->GetProperties()->SetLocked(true);
+ myPrevLocked = myLocked;
+ myLocked = false;
}
}
void resume()
{
if (myPrevLocked) {
- myStudy->GetProperties()->SetLocked(false);
- myLocked = myPrevLocked;
- myPrevLocked = false;
+ myStudy->GetProperties()->SetLocked(false);
+ myLocked = myPrevLocked;
+ myPrevLocked = false;
}
}
private:
int month=0,day=0,year=0,hh=0,mn=0,ss=0;
SALOMEDSImpl_Tool::GetSystemDate(year, month, day, hh, mn, ss);
aProp->SetModification(SALOMEDSImpl_Tool::GetUserName(),
- mn, hh, day, month, year);
+ mn, hh, day, month, year);
// lock study back if it was locked initially, to write correct value of Locked flag
unlock.suspend();
//...........................,
//component=versions, char(1), char(0)
- //string length: 1 byte = locked flag, 1 byte = modified flag, (12 + name length + 1) for each name and date, 1 byte (char(30) section delimeter)
+ //string length: 1 byte = locked flag, 1 byte = modified flag, (12 + name length + 1) for each name and date, 1 byte (char(30) section delimiter)
// unit length + 1, comment length, "zero" byte
char* aProperty = new char[3 + aLength + 12 * aNames.size() + 1 + unitsSize + 1 + commentSize + 1 + aLength1 ];
aProperty[a++] = 1;
}
- //Write delimeter of the section to define end of the modifications section
+ //Write delimiter of the section to define end of the modifications section
aProperty[a++] = 30;
//Write units if need
a = strlen(aProperty);
}
- aProperty[a++] = 30; //delimeter of the component versions
+ aProperty[a++] = 30; //delimiter of the component versions
std::map<std::string, std::string>::const_iterator versionsIt;
for ( versionsIt = versions.begin(); versionsIt != versions.end(); ++versionsIt ) {
sprintf(&(aProperty[a]),"%s=%s",
(char*)(versionsIt->first.c_str()),
- (char*)(versionsIt->second.c_str()));
+ (char*)(versionsIt->second.c_str()));
a = a + versionsIt->first.size() + versionsIt->second.size() + 1;
aProperty[a++] = 1;
}
// HDF File will be composed of differents part :
// * For each ComponentDataType, all data created by the component
- // Informations in data group hdf_group_datacomponent
+ // Information in data group hdf_group_datacomponent
// * Study Structure -> Exactly what is contained in Document
- // Informations in data group hdf_group_study_structure
+ // Information in data group hdf_group_study_structure
_errorCode = "";
}
}
}
- else {
- aDriver = aFactory->GetDriverByIOR(IOREngine);
- }
- aMapTypeDriver[aCompType] = aDriver;
+ else {
+ aDriver = aFactory->GetDriverByIOR(IOREngine);
+ }
+ aMapTypeDriver[aCompType] = aDriver;
}
catch(...) {
_errorCode = "Can not restore information to resave it";
URL(aStudyUrl);
// To change for Save
- // Do not have to do a new file but just a Open??? Rewrite all informations after erasing evrything??
+ // Do not have to do a new file but just a Open??? Rewrite all information after erasing evrything??
hdf_file = new HDFfile((char*)aUrl.c_str());
hdf_file->CreateOnDisk();
std::string componentDataType = sco.ComponentDataType();
std::string IOREngine;
if (sco.ComponentIOR(IOREngine)) {
- // Engine should be already in the map as it was to added before
- SALOMEDSImpl_Driver* Engine = aMapTypeDriver[componentDataType];
+ // Engine should be already in the map as it was to added before
+ SALOMEDSImpl_Driver* Engine = aMapTypeDriver[componentDataType];
if (Engine != NULL) {
SALOMEDSImpl_TMPFile* aStream = NULL;
long length = 0;
hdf_dataset->WriteOnDisk((void*)(theASCII?"A":"B")); // save: ASCII or BINARY
hdf_dataset->CloseOnDisk();
hdf_dataset=0; //will be deleted by hdf_sco_AuxFiles destructor
- // Creation of the persistance reference attribute
+ // Creation of the persistence reference attribute
Translate_IOR_to_persistentID (sco, Engine, theMultiFile, theASCII);
}
}
IsSaved(true);
}
+ std::map<std::string, SALOMEDSImpl_Driver*>::iterator n2dr = aMapTypeDriver.begin();
+ for ( ; n2dr != aMapTypeDriver.end(); ++n2dr )
+ delete n2dr->second;
+
return !errors;
}
{
_errorCode = "";
- // Write in group hdf_group_datatype all informations of SObject SC
+ // Write in group hdf_group_datatype all information of SObject SC
// Iterative function to parse all SObjects under a SComponent
HDFgroup *hdf_group_sobject = 0;
anAttr = theStudy->NewBuilder()->FindOrCreateAttribute(aSO, "AttributeComment");
}
else if (!strcmp(hdf_dataset->GetName(),"AttributeReference") ||
- !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintainance
+ !strcmp(hdf_dataset->GetName(),"Reference")) { // Old format maintenance
theStudy->NewBuilder()->Addreference(aSO, theStudy->CreateObjectID(current_string));
delete [] (current_string);
hdf_dataset->CloseOnDisk();