#include <BinTools_ShapeSet.hxx>
#include <FSD_FileHeader.hxx>
#include <OSD_FileSystem.hxx>
-#include <OSD_OpenFile.hxx>
#include <Storage_StreamTypeMismatchError.hxx>
//=======================================================================
const BinTools_FormatVersion theVersion,
const Message_ProgressRange& theRange)
{
- std::ofstream aStream;
- aStream.precision (15);
- OSD_OpenStream (aStream, theFile, std::ios::out | std::ios::binary);
- if (!aStream.good())
+ const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
+ opencascade::std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
+ aStream->precision (15);
+ if (aStream.get() == NULL || !aStream->good())
return Standard_False;
- Write (theShape, aStream, theWithTriangles, theWithNormals, theVersion, theRange);
- aStream.close();
- return aStream.good();
+ Write (theShape, *aStream, theWithTriangles, theWithNormals, theVersion, theRange);
+ aStream->flush();
+ return aStream->good();
}
//=======================================================================