]> OCCT Git - occt.git/commitdiff
0029219: Application Framework - XML document is written with CRLF on Windows
authorvro <vro@opencascade.com>
Mon, 21 Feb 2022 07:41:05 +0000 (10:41 +0300)
committersmoskvin <smoskvin@opencascade.com>
Tue, 22 Feb 2022 17:25:47 +0000 (20:25 +0300)
The last symbol of a line is synchronized with external products.
Also, XML ends by LF now.

Modified:
XML: XmlLDrivers_DocumentStorageDriver::Write() ends by LF
BREP: BRepTools::Write(), Draw_VariableCommands::save() ends by LF
STEP: StepSelect_WorkLibrary::WriteFile() ends by LF
IGES: IGESSelect_WorkLibrary::WriteFile(), IGESControl_Writer::Write(), XSDRAWIGES::WriteShape() ends by LF
VRML: VrmlAPI_Writer::write_v2() ends by LF

0029219: Application Framework - XML document is written with CRLF on Windows

The last symbol of a line is synchronized with external products.
Also, XML ends by LF now.

Modified:
XML: XmlLDrivers_DocumentStorageDriver::Write() ends by LF
BREP: BRepTools::Write(), Draw_VariableCommands::save() ends by LF
STEP: StepSelect_WorkLibrary::WriteFile() ends by LF
IGES: IGESSelect_WorkLibrary::WriteFile(), IGESControl_Writer::Write(), XSDRAWIGES::WriteShape() ends by LF
VRML: VrmlAPI_Writer::write_v2() ends by LF
STL: RWStl::WriteAscii() ends by CR LF (to synchronize with Blender)

0029219: Application Framework - XML document is written with CRLF on Windows

The last symbol of a line is synchronized with external products.
Also, XML ends by LF now.

Modified:
XML: XmlLDrivers_DocumentStorageDriver::Write() ends by LF
BREP: BRepTools::Write(), Draw_VariableCommands::save() ends by LF
STEP: StepSelect_WorkLibrary::WriteFile() ends by LF
IGES: IGESSelect_WorkLibrary::WriteFile(), IGESControl_Writer::Write(), XSDRAWIGES::WriteShape() ends by LF
VRML: VrmlAPI_Writer::write_v2() ends by LF

src/BRepTools/BRepTools.cxx
src/Draw/Draw_VariableCommands.cxx
src/IGESControl/IGESControl_Writer.cxx
src/IGESSelect/IGESSelect_WorkLibrary.cxx
src/StepSelect/StepSelect_WorkLibrary.cxx
src/VrmlAPI/VrmlAPI_Writer.cxx
src/XSDRAWIGES/XSDRAWIGES.cxx
src/XmlLDrivers/XmlLDrivers_DocumentStorageDriver.cxx

index 37b11db375e4e938cccc7d3093c925fd90ea33aa..de3716bd973aa7fbf406b73afcbd3723225f6f38 100644 (file)
@@ -695,7 +695,7 @@ Standard_Boolean  BRepTools::Write (const TopoDS_Shape& theShape,
                                     const Message_ProgressRange& theProgress)
 {
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out);
+  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
   if (aStream.get() == NULL || !aStream->good())
   {
     return Standard_False;
index 8f0b4f68ec9098c0ae06cfc4019e8c201d676370..473b212887a2aa1d15c2d241d622be4965127e01 100644 (file)
@@ -92,7 +92,7 @@ static Standard_Integer save (Draw_Interpretor& theDI,
 
   const char* aName = theArgVec[2];
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (aName, std::ios::out);
+  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (aName, std::ios::out | std::ios::binary);
   aStream->precision (15);
   if (aStream.get() == NULL || !aStream->good())
   {
index 735f49ac06d9e97d1adb7bf66ead52e68d750316..c59f645a27c5225d082e8db561d931e424390879 100644 (file)
@@ -254,7 +254,7 @@ Standard_Boolean IGESControl_Writer::Write
   (const Standard_CString file, const Standard_Boolean fnes)
 {
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (file, std::ios::out);
+  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (file, std::ios::out | std::ios::binary);
   if (aStream.get() == NULL)
   {
     return Standard_False;
index 50f583078c5668966e5c07320961f709674f267c..9bfbbd21070333add1110cae230fb662c9a7809d 100644 (file)
@@ -102,7 +102,7 @@ static  Handle(IGESData_FileProtocol) IGESProto;
 
   if (igesmod.IsNull() || prot.IsNull()) return Standard_False;
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out);
+  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::binary);
   if (aStream.get() == NULL)
   {
     ctx.CCheck(0)->AddFail("IGES File could not be created");
index 6f672e13e3f8597db2488f94abbcaa9f642021c8..66e8ee006c307d1a6ef5861d94869c9250ec38fe 100644 (file)
@@ -99,7 +99,7 @@ Standard_Boolean  StepSelect_WorkLibrary::WriteFile
   if (stepmodel.IsNull() || stepro.IsNull()) return Standard_False;
 
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::trunc);
+  std::shared_ptr<std::ostream> aStream = aFileSystem->OpenOStream (ctx.FileName(), std::ios::out | std::ios::binary | std::ios::trunc);
 
   if (aStream.get() == NULL) {
     ctx.CCheck(0)->AddFail("Step File could not be created");
index 0275a949de20ac27bca71bbdaa5f747d3d529d38..f4a4f49a801c825798fffca797a8f068e67ee061 100644 (file)
@@ -226,7 +226,7 @@ Standard_Boolean VrmlAPI_Writer::write_v1(const TopoDS_Shape& aShape,const Stand
   OSD_Path thePath(aFile);
   TCollection_AsciiString theFile;thePath.SystemName(theFile);
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out);
+  std::shared_ptr<std::ostream> anOutFile = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
   if (anOutFile.get() == NULL)
   {
     return Standard_False;
@@ -370,7 +370,7 @@ Standard_Boolean VrmlAPI_Writer::write_v2(const TopoDS_Shape& aShape,const Stand
   aConv.Convert(anExtFace, anExtEdge);
 
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out);
+  std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (aFile, std::ios::out | std::ios::binary);
   if (anOutStream.get() != NULL)
   {
     *anOutStream << aScene;
@@ -395,7 +395,7 @@ Standard_Boolean VrmlAPI_Writer::WriteDoc(
   aConv.ConvertDocument(theDoc);
 
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out);
+  std::shared_ptr<std::ostream> anOutStream = aFileSystem->OpenOStream (theFile, std::ios::out | std::ios::binary);
   if (anOutStream.get() != NULL)
   {
     *anOutStream << aScene;
index b0117bf3cb525860d03a5b4dce0074bf927641a6..571a2d74d2ee027f036e1a0281ea7fa105ebed9c 100644 (file)
@@ -76,7 +76,7 @@ void WriteShape(const TopoDS_Shape& shape, const Standard_Integer number)
 {
   char fname[110];
   sprintf(fname, "Shape_%d",number);
-  std::ofstream f(fname,std::ios::out);
+  std::ofstream f(fname,std::ios::out | std::ios::binary);
   std::cout << "Output file name : " << fname << std::endl;
   f << "DBRep_DrawableShape\n";
   
index 271d4dcdd788436f65bf66fac4a4ae3637890c3e..bd6a537ac7f30db72b1afa2badecca8c8c841ab6 100644 (file)
@@ -99,7 +99,7 @@ void XmlLDrivers_DocumentStorageDriver::Write (const Handle(CDM_Document)&
   myFileName = theFileName;
 
   const Handle(OSD_FileSystem)& aFileSystem = OSD_FileSystem::DefaultFileSystem();
-  std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out);
+  std::shared_ptr<std::ostream> aFileStream = aFileSystem->OpenOStream (theFileName, std::ios::out | std::ios::binary);
   if (aFileStream.get() != NULL && aFileStream->good())
   {
     Write (theDocument, *aFileStream, theRange);