1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +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

@@ -14,6 +14,7 @@
#include <FSD_BinaryFile.ixx>
#include <OSD.hxx>
#include <OSD_OpenFile.hxx>
const Standard_CString MAGICNUMBER = "BINFILE";
@@ -81,28 +82,15 @@ Storage_Error FSD_BinaryFile::Open(const TCollection_AsciiString& aName,const St
SetName(aName);
if (OpenMode() == Storage_VSNone) {
#ifdef _WIN32
TCollection_ExtendedString aWName(aName);
if (aMode == Storage_VSRead) {
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"rb");
myStream = OSD_OpenFile(aName.ToCString(),"rb");
}
else if (aMode == Storage_VSWrite) {
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"wb");
myStream = OSD_OpenFile(aName.ToCString(),"wb");
}
else if (aMode == Storage_VSReadWrite) {
myStream = _wfopen((const wchar_t*)aWName.ToExtString(),L"w+b");
myStream = OSD_OpenFile(aName.ToCString(),"w+b");
}
#else
if (aMode == Storage_VSRead) {
myStream = fopen(aName.ToCString(),"rb");
}
else if (aMode == Storage_VSWrite) {
myStream = fopen(aName.ToCString(),"wb");
}
else if (aMode == Storage_VSReadWrite) {
myStream = fopen(aName.ToCString(),"w+b");
}
#endif
if (myStream == 0L) {
result = Storage_VSOpenError;