MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032490Open CASCADE[OCCT] OCCT:Data Exchangepublic2021-07-23 15:252021-08-07 13:38
Reporterkgv 
Assigned Tobugmaster 
PrioritynormalSeverityintegration request 
StatusverifiedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
DescriptionOSD_FileSystem::OpenIStream() creates input stream.
It is necessary extending interface with output stream ::OpenOStream(), and probably with ::OpenIOStream().
Steps To ReproduceNot required
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
related to 0032455verifiedbugmaster Data Exchange - replace OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem() 
child of 0032099verifiedbugmaster Visualization - define OSD_FileSystem class managing opening of file streams 

-  Notes
(0102751)
mkrylova (developer)
2021-07-23 16:53

Analysis
(0102820)
git (administrator)
2021-07-26 18:22

Branch CR32490 has been created by mkrylova.

SHA-1: 62942fa358698b9258d413b87df688f35c98e85b


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102834)
git (administrator)
2021-07-27 15:04

Branch CR32490_1 has been created by mkrylova.

SHA-1: b598c9a7f5d65dc1498422d65a4bbbdf467f482c


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102835)
mkrylova (developer)
2021-07-27 17:09

http://jenkins-test-occt.nnov.opencascade.com/view/CR32490_1-CR32490_1-MKRYLOVA/view/ALL/ [^]
(0102836)
mkrylova (developer)
2021-07-27 17:10

Patch is ready to review:
- OCCT: CR32490_1
- Products: CR32490_1
(0102837)
mkrylova (developer)
2021-07-27 17:10

Solution implementation
(0102841)
kgv (developer)
2021-07-27 20:16

-  aFileOut.close();
-  if (!aFileOut.good())
+  if (!aFileOut->good())

As std::ostream does not have method close(),
the code should be updated to call flush() instead to ensure that buffered sequence is actually (tried to be) written to the file before checking for error via good().

@@ -70,17 +70,18 @@ Message_PrinterOStream::Message_PrinterOStream (const 
-  std::ofstream* aFile = new std::ofstream();
-  OSD_OpenStream (*aFile, aFileName.ToCString(), (theToAppend ? (std::ios_base::app | std::ios_base::out) 
: std::ios_base::out));
+  opencascade::std::shared_ptr<std::ostream> aFile = aFileSystem->OpenOStream
+    (aFileName, (theToAppend ? (std::ios_base::app | std::ios_base::out) : std::ios_base::out));
+  if (aFile.get() != NULL)
   {
-    myStream = (Standard_OStream* )aFile;
+    myStream = (Standard_OStream*) aFile.get();

This wouldn't work like this - the code will lead to crash.
Please just revert changes in Message_PrinterOStream in scope of this patch.

+  Standard_EXPORT virtual opencascade::std::shared_ptr<std::ostream> OpenOStream
+                          (const TCollection_AsciiString& theUrl,
+                           const std::ios_base::openmode theMode,
+                           const int64_t theOffset = 0,
+                           const opencascade::std::shared_ptr<std::ostream>& theOldStream 
= opencascade::std::shared_ptr<std::ostream>());

Opening file for writing has very different meaning compared to input stream.
I propose simplifying interface in scope of this patch and drop theOldStream and theOffset arguments.

@@ -42,6 +42,20 @@ Standard_Boolean OSD_LocalFileSystem::IsOpenIStream (const opencascade::std::sha
   
return (aFileBuf != NULL) ? aFileBuf->is_open() : false;
...
+Standard_Boolean OSD_LocalFileSystem::IsOpenOStream (const opencascade::std::shared_ptr<std::ostream>& 
theStream) const
+  return (aFileStream != NULL) ? aFileStream->good() : false;

Why implementation of IsOpenOStream() is inconsistent to IsOpenIStream()?

opencascade::std::shared_ptr<std::streambuf> OSD_CachedFileSystem::OpenStreamBuffer()

Please update OSD_CachedFileSystem::OpenStreamBuffer() to skip myStream in case of std::ios::out flag.
(0102849)
git (administrator)
2021-07-28 15:43

Branch CR32490_1 has been updated by mkrylova.

SHA-1: 92b29e6ff2fa00a0851169706bdb0a22ac919892


Detailed log of new commits:

Author: mkrylova
Date: Wed Jul 28 13:29:39 2021 +0300

    # kgv remarks

(0102855)
git (administrator)
2021-07-28 17:50

Branch CR32490_2 has been created by mkrylova.

SHA-1: 9146eeb70bcc05cad9da4bdcfc041d9400272f1e


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102867)
git (administrator)
2021-07-29 12:20

Branch CR32490_2 has been updated by mkrylova.

SHA-1: f669a330bd8580cb86037e8d45fe1f79c21955f6


Detailed log of new commits:

Author: mkrylova
Date: Thu Jul 29 12:20:02 2021 +0300

    # fixed warnings

(0102868)
git (administrator)
2021-07-29 12:21

Branch CR32490_3 has been created by mkrylova.

SHA-1: ac725ed2685757ca3a9a20c62eb410476eb5759f


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102872)
mkrylova (developer)
2021-07-29 14:23

http://jenkins-test-occt.nnov.opencascade.com/view/CR32490_3-CR32490_3-MKRYLOVA/view/ALL/ [^]
(0102873)
mkrylova (developer)
2021-07-29 14:23

Patch is ready to review:
- OCCT: CR32490_3
- Products: CR32490_3
(0102880)
git (administrator)
2021-07-30 11:46

Branch CR32490_3 has been updated by mkrylova.

SHA-1: 002962b21ba6136f82e2fb9176b4ac7eb25a5579


Detailed log of new commits:

Author: mkrylova
Date: Fri Jul 30 11:34:59 2021 +0300

    # kgv remarks

(0102882)
git (administrator)
2021-07-30 11:50

Branch CR32490_4 has been created by mkrylova.

SHA-1: 9e2a2e3aa5cd680b780beeacfd4d4aea159e5c40


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102884)
mkrylova (developer)
2021-07-30 11:51

Patch is ready to review:
- OCCT: CR32490_4
- Products: CR32490_4
(0102885)
mkrylova (developer)
2021-07-30 12:02
edited on: 2021-07-30 18:21

Solution implementation, Testing

(0102908)
bugmaster (administrator)
2021-07-31 16:46

http://jenkins-test-08.nnov.opencascade.com/view/CR32490_4-CR32490_4-INV/ [^]
(0102921)
git (administrator)
2021-08-02 12:14

Branch CR32490_4 has been updated forcibly by mkrylova.

SHA-1: 9be632d2d7bb8e8841a9978cf8cf5d11684ce92c
(0102923)
git (administrator)
2021-08-02 12:18

Branch CR32490_5 has been created by mkrylova.

SHA-1: 9f0c55c6145d53e62fb5329ca190374bd8045199


Detailed log of new commits:

Author: mkrylova
Date: Mon Jul 26 11:09:57 2021 +0300

    0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams
    
    - provided OSD_FileSystem::OpenOStream() for output streams
    - replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
(0102927)
mkrylova (developer)
2021-08-02 15:24

http://jenkins-test-occt.nnov.opencascade.com/view/CR32490_5-CR32490_5-MKRYLOVA/view/ALL/ [^]
(0102928)
mkrylova (developer)
2021-08-02 15:24

Patch is ready to review:
- OCCT: CR32490_5
- Products: CR32490_5
(0102981)
mkrylova (developer)
2021-08-04 17:09

Solution Implementation, Testing
(0103055)
bugmaster (administrator)
2021-08-07 13:11

Combination -
OCCT branch : IR-2021-08-06
master SHA - 27e64adb38a9a8e6370b5dbd38a9018313884a9c
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-08-06 SHA - d93b03b621e54fe532eb3f2eba1a1613534cfc91
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17370.66000000038 / 17380.800000000403 [-0.06%]
Products
Total CPU difference: 11454.410000000084 / 11476.060000000101 [-0.19%]
Windows-64-VC14:
OCCT
Total CPU difference: 19180.84375 / 19196.421875 [-0.08%]
Products
Total CPU difference: 12822.75 / 12808.78125 [+0.11%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0103067)
git (administrator)
2021-08-07 13:37

Branch CR32490 has been deleted by mnt.

SHA-1: 62942fa358698b9258d413b87df688f35c98e85b
(0103068)
git (administrator)
2021-08-07 13:38

Branch CR32490_1 has been deleted by mnt.

SHA-1: 92b29e6ff2fa00a0851169706bdb0a22ac919892
(0103069)
git (administrator)
2021-08-07 13:38

Branch CR32490_2 has been deleted by mnt.

SHA-1: f669a330bd8580cb86037e8d45fe1f79c21955f6
(0103070)
git (administrator)
2021-08-07 13:38

Branch CR32490_3 has been deleted by mnt.

SHA-1: 002962b21ba6136f82e2fb9176b4ac7eb25a5579
(0103071)
git (administrator)
2021-08-07 13:38

Branch CR32490_4 has been deleted by mnt.

SHA-1: 9be632d2d7bb8e8841a9978cf8cf5d11684ce92c
(0103072)
git (administrator)
2021-08-07 13:38

Branch CR32490_5 has been deleted by mnt.

SHA-1: 9f0c55c6145d53e62fb5329ca190374bd8045199

- Related Changesets
occt: master 27e64adb
Timestamp: 2021-07-26 08:09:57
Author: mkrylova
Committer: bugmaster
Details ] Diff ]
0032490: Data Exchange - provide OSD_FileSystem::OpenOStream() for output streams

- provided OSD_FileSystem::OpenOStream() for output streams
- replaced OSD_OpenStream() usage with OSD_FileSystem::DefaultFileSystem()
mod - src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx Diff ] File ]
mod - src/BinTools/BinTools.cxx Diff ] File ]
mod - src/BRepTools/BRepTools.cxx Diff ] File ]
mod - src/DDocStd/DDocStd_ApplicationCommands.cxx Diff ] File ]
mod - src/Draw/Draw_VariableCommands.cxx Diff ] File ]
mod - src/IGESControl/IGESControl_Writer.cxx Diff ] File ]
mod - src/IGESSelect/IGESSelect_WorkLibrary.cxx Diff ] File ]
mod - src/Image/Image_Texture.cxx Diff ] File ]
mod - src/OSD/OSD_CachedFileSystem.cxx Diff ] File ]
mod - src/OSD/OSD_CachedFileSystem.hxx Diff ] File ]
mod - src/OSD/OSD_FileSystem.cxx Diff ] File ]
mod - src/OSD/OSD_FileSystem.hxx Diff ] File ]
mod - src/OSD/OSD_FileSystemSelector.cxx Diff ] File ]
mod - src/OSD/OSD_FileSystemSelector.hxx Diff ] File ]
mod - src/OSD/OSD_LocalFileSystem.cxx Diff ] File ]
mod - src/OSD/OSD_LocalFileSystem.hxx Diff ] File ]
mod - src/RWGltf/RWGltf_CafWriter.cxx Diff ] File ]
mod - src/StepSelect/StepSelect_WorkLibrary.cxx Diff ] File ]
mod - src/TObjDRAW/TObjDRAW.cxx Diff ] File ]
mod - src/ViewerTest/ViewerTest_OpenGlCommands.cxx Diff ] File ]
mod - src/VrmlAPI/VrmlAPI_Writer.cxx Diff ] File ]
mod - src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2021-07-23 15:25 kgv New Issue
2021-07-23 15:25 kgv Assigned To => mkrylova
2021-07-23 15:25 kgv Relationship added related to 0032455
2021-07-23 15:25 kgv Relationship added child of 0032099
2021-07-23 15:26 kgv Status new => assigned
2021-07-23 16:53 mkrylova Note Added: 0102751
2021-07-26 18:22 git Note Added: 0102820
2021-07-27 15:04 git Note Added: 0102834
2021-07-27 17:09 mkrylova Note Added: 0102835
2021-07-27 17:10 mkrylova Note Added: 0102836
2021-07-27 17:10 mkrylova Note Added: 0102837
2021-07-27 17:11 mkrylova Assigned To mkrylova => kgv
2021-07-27 17:11 mkrylova Status assigned => resolved
2021-07-27 17:11 mkrylova Steps to Reproduce Updated View Revisions
2021-07-27 20:16 kgv Note Added: 0102841
2021-07-27 20:16 kgv Assigned To kgv => mkrylova
2021-07-27 20:16 kgv Status resolved => assigned
2021-07-28 15:43 git Note Added: 0102849
2021-07-28 17:50 git Note Added: 0102855
2021-07-29 12:20 git Note Added: 0102867
2021-07-29 12:21 git Note Added: 0102868
2021-07-29 14:23 mkrylova Note Added: 0102872
2021-07-29 14:23 mkrylova Note Added: 0102873
2021-07-29 14:23 mkrylova Assigned To mkrylova => kgv
2021-07-29 14:23 mkrylova Status assigned => resolved
2021-07-29 16:07 kgv Assigned To kgv => mkrylova
2021-07-29 16:07 kgv Status resolved => assigned
2021-07-30 11:46 git Note Added: 0102880
2021-07-30 11:50 git Note Added: 0102882
2021-07-30 11:51 mkrylova Note Added: 0102884
2021-07-30 11:51 mkrylova Assigned To mkrylova => kgv
2021-07-30 11:51 mkrylova Status assigned => resolved
2021-07-30 12:02 mkrylova Note Added: 0102885
2021-07-30 12:06 kgv Assigned To kgv => bugmaster
2021-07-30 12:06 kgv Status resolved => reviewed
2021-07-30 18:21 mkrylova Note Edited: 0102885 View Revisions
2021-07-31 16:46 bugmaster Note Added: 0102908
2021-07-31 16:46 bugmaster Assigned To bugmaster => mkrylova
2021-07-31 16:46 bugmaster Status reviewed => assigned
2021-08-02 12:14 git Note Added: 0102921
2021-08-02 12:18 git Note Added: 0102923
2021-08-02 15:24 mkrylova Note Added: 0102927
2021-08-02 15:24 mkrylova Note Added: 0102928
2021-08-02 15:24 mkrylova Assigned To mkrylova => kgv
2021-08-02 15:24 mkrylova Status assigned => resolved
2021-08-02 16:48 kgv Assigned To kgv => bugmaster
2021-08-02 16:48 kgv Status resolved => reviewed
2021-08-04 17:09 mkrylova Note Added: 0102981
2021-08-07 13:11 bugmaster Note Added: 0103055
2021-08-07 13:11 bugmaster Status reviewed => tested
2021-08-07 13:14 bugmaster Test case number => Not required
2021-08-07 13:27 bugmaster Changeset attached => occt master 27e64adb
2021-08-07 13:27 bugmaster Status tested => verified
2021-08-07 13:27 bugmaster Resolution open => fixed
2021-08-07 13:37 git Note Added: 0103067
2021-08-07 13:38 git Note Added: 0103068
2021-08-07 13:38 git Note Added: 0103069
2021-08-07 13:38 git Note Added: 0103070
2021-08-07 13:38 git Note Added: 0103071
2021-08-07 13:38 git Note Added: 0103072


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker