0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- prepar...
[occt.git] / src / IGESSelect / IGESSelect_WorkLibrary.cxx
index 06882d7..7f7260d 100644 (file)
@@ -77,15 +77,15 @@ static  Handle(IGESData_FileProtocol) IGESProto;
    Handle(Interface_InterfaceModel)& model,
    const Handle(Interface_Protocol)& protocol) const
 {
-  Handle(Message_Messenger) sout = Message::DefaultMessenger();
+  Message_Messenger::StreamBuffer sout = Message::SendInfo();
   Handle(IGESData_IGESModel) igesmod = new IGESData_IGESModel;
   DeclareAndCast(IGESData_Protocol,prot,protocol);
 
   char* pname=(char*) name;
   Standard_Integer status = IGESFile_Read (pname,igesmod,prot);
 
-  if (status < 0) sout<<"File not found : "<<name<<Message_EndLine;
-  if (status > 0) sout<<"Error when reading file : "<<name<<Message_EndLine;
+  if (status < 0) sout<<"File not found : "<<name<<std::endl;
+  if (status > 0) sout<<"Error when reading file : "<<name<<std::endl;
   if (status == 0) model = igesmod;
   else             model.Nullify();
   return status;
@@ -95,7 +95,7 @@ static  Handle(IGESData_FileProtocol) IGESProto;
     Standard_Boolean  IGESSelect_WorkLibrary::WriteFile
   (IFSelect_ContextWrite& ctx) const
 {
-  Handle(Message_Messenger) sout = Message::DefaultMessenger();
+  Message_Messenger::StreamBuffer sout = Message::SendInfo();
 //  Preparation
   DeclareAndCast(IGESData_IGESModel,igesmod,ctx.Model());
   DeclareAndCast(IGESData_Protocol,prot,ctx.Protocol());
@@ -105,7 +105,7 @@ static  Handle(IGESData_FileProtocol) IGESProto;
   OSD_OpenStream(fout,ctx.FileName(),std::ios::out );
   if (!fout) {
     ctx.CCheck(0)->AddFail("IGES File could not be created");
-    sout<<" - IGES File could not be created : " << ctx.FileName() << Message_EndLine; return 0;
+    sout<<" - IGES File could not be created : " << ctx.FileName() << std::endl; return 0;
   }
   sout<<" IGES File Name : "<<ctx.FileName();
   IGESData_IGESWriter VW(igesmod);  
@@ -128,13 +128,13 @@ static  Handle(IGESData_FileProtocol) IGESProto;
   VW.SendModel(prot);            
   sout<<" Write ";
   if (themodefnes) VW.WriteMode() = 10;
-  Standard_Boolean status = VW.Print(fout);                sout<<" Done"<<Message_EndLine;
+  Standard_Boolean status = VW.Print(fout);                sout<<" Done"<<std::endl;
 
   errno = 0;
   fout.close();
   status = fout.good() && status && !errno;
   if(errno)
-    sout << strerror(errno) << Message_EndLine;
+    sout << strerror(errno) << std::endl;
 
   return status;
 }
@@ -156,7 +156,7 @@ static  Handle(IGESData_FileProtocol) IGESProto;
   (const Handle(Interface_InterfaceModel)& model, 
    const Handle(Interface_Protocol)& protocol,
    const Handle(Standard_Transient)& entity,
-   const Handle(Message_Messenger)& S, const Standard_Integer level) const
+   Standard_OStream& S, const Standard_Integer level) const
 {
   DeclareAndCast(IGESData_IGESModel,igesmod,model);
   DeclareAndCast(IGESData_Protocol,igespro,protocol);
@@ -165,17 +165,17 @@ static  Handle(IGESData_FileProtocol) IGESProto;
   Standard_Integer num = igesmod->Number(igesent);
   if (num == 0) return;
 
-  S<<" --- Entity "<<num;
+  S <<" --- Entity "<<num;
   Standard_Boolean iserr = model->IsRedefinedContent(num);
   Handle(Standard_Transient) con;
   if (iserr) con = model->ReportEntity(num)->Content();
-  if (entity.IsNull()) { S<<" Null"<<Message_EndLine; return ;  }
+  if (entity.IsNull()) { S <<" Null"<<std::endl; return ;  }
 
 //  On attaque le dump : d abord cas de l Erreur
   if (iserr) {
     S << " ERRONEOUS, Content, Type cdl : ";
     if (!con.IsNull()) S << con->DynamicType()->Name();
-    else S << "(undefined)" << Message_EndLine;
+    else S << "(undefined)" << std::endl;
     igesent = GetCasted(IGESData_IGESEntity,con);
     con.Nullify();
     Handle(Interface_Check) check = model->ReportEntity(num)->Check();
@@ -192,6 +192,6 @@ static  Handle(IGESData_FileProtocol) IGESProto;
     dump.Dump(igesent,S,level,(level-1)/3);
   }
   catch (Standard_Failure const&) {
-    S << " **  Dump Interrupt **" << Message_EndLine;
+    S << " **  Dump Interrupt **" << std::endl;
   }
 }