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

0025367: IGES and BRep persistence - support unicode file names on Windows

OSD_OpenFile.hxx header is created for using in file open operations with Unicode names.

Fix for STEP files reading.

Adding test cases for issue 25367
Update test case for issue 25364
Update test cases due to improvements
This commit is contained in:
pdn
2014-10-22 12:17:10 +04:00
committed by bugmaster
parent 2caff0b32f
commit 947085567f
27 changed files with 341 additions and 80 deletions

View File

@@ -50,6 +50,7 @@
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Geom_RectangularTrimmedSurface.hxx>
#include <OSD_OpenFile.hxx>
#include <errno.h>
@@ -611,8 +612,7 @@ Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
const Handle(Message_ProgressIndicator)& PR)
{
ofstream os;
// if (!fic.open(File,output)) return Standard_False;
os.open(File, ios::out);
OSD_OpenStream(os, File, ios::out);
if (!os.rdbuf()->is_open()) return Standard_False;
Standard_Boolean isGood = (os.good() && !os.eof());
@@ -650,8 +650,9 @@ Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
{
filebuf fic;
istream in(&fic);
if (!fic.open(File, ios::in)) return Standard_False;
OSD_OpenFileBuf(fic,File,ios::in);
if(!fic.is_open()) return Standard_False;
BRepTools_ShapeSet SS(B);
SS.SetProgress(PR);
SS.Read(in);