SALOMEDS_Tool::PutStreamToFiles(theStream, aTmpDir, false);
if(MYDEBUG) MESSAGE("Result_i::PasteInto - aListOfFileNames->length() = "<<aListOfFileNames->length());
- std::string aLocalPersistentID;
+ std::ostrstream aLocalPersistentID;
{
std::string aCopyPersist = aTmpDir + "copy_persistent";
- std::ifstream anInputFileStream(aCopyPersist.c_str());
- std::ostrstream anOutputStream;
- anInputFileStream >> anOutputStream.rdbuf();
- aLocalPersistentID = anOutputStream.str();
- anInputFileStream.close();
+ std::ifstream anInputFileStream( aCopyPersist.c_str() );
+ anInputFileStream >> aLocalPersistentID.rdbuf();
}
//Just for Result::Restore to find the Comment attribute :(
std::string aFileName(aTmpDir);
if(aListOfFileNames->length() > 1)
aFileName += aListOfFileNames[1].in();
- Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID, aFileName, false);
+ Storable* aStorable = Storable::Create(aSObject, aLocalPersistentID.str(), aFileName, false);
SALOMEDS::ListOfFileNames_var aFilesToRemove = new SALOMEDS::ListOfFileNames;
aFilesToRemove->length(1);