1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +03:00

0032455: Data Exchange - replace OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()

- replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
This commit is contained in:
mkrylova
2021-07-14 15:06:35 +03:00
committed by bugmaster
parent 000c21fa0c
commit ad3f20c684
17 changed files with 150 additions and 152 deletions

View File

@@ -27,7 +27,7 @@
#include <Message_Messenger.hxx>
#include <FSD_BinaryFile.hxx>
#include <FSD_FileHeader.hxx>
#include <OSD_OpenFile.hxx>
#include <OSD_FileSystem.hxx>
#include <PCDM_Document.hxx>
#include <PCDM_ReadWriter.hxx>
#include <Standard_ErrorHandler.hxx>
@@ -77,15 +77,15 @@ void BinLDrivers_DocumentRetrievalDriver::Read
const Handle(PCDM_ReaderFilter)& theFilter,
const Message_ProgressRange& theRange)
{
std::ifstream aFileStream;
OSD_OpenStream (aFileStream, theFileName, std::ios::in | std::ios::binary);
const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
opencascade::std::shared_ptr<std::istream> aFileStream = aFileSystem->OpenIStream (theFileName, std::ios::in | std::ios::binary);
if (aFileStream.is_open() && aFileStream.good())
if (aFileStream.get() != NULL && aFileStream->good())
{
Handle(Storage_Data) dData;
TCollection_ExtendedString aFormat = PCDM_ReadWriter::FileFormat (aFileStream, dData);
TCollection_ExtendedString aFormat = PCDM_ReadWriter::FileFormat (*aFileStream, dData);
Read (aFileStream, dData, theNewDocument, theApplication, theFilter, theRange);
Read (*aFileStream, dData, theNewDocument, theApplication, theFilter, theRange);
if (!theRange.More())
{
myReaderStatus = PCDM_RS_UserBreak;