0031501: Foundation Classes, Message_Printer - remove theToPutEndl argument -- prepar...
[occt.git] / src / IFSelect / IFSelect_SignatureList.cxx
index 7407ab4..a56ab4a 100644 (file)
@@ -16,8 +16,6 @@
 #include <Interface_InterfaceModel.hxx>
 #include <Interface_Macros.hxx>
 #include <Interface_MSG.hxx>
-#include <Message.hxx>
-#include <Message_Messenger.hxx>
 #include <Standard_Transient.hxx>
 #include <Standard_Type.hxx>
 #include <TCollection_HAsciiString.hxx>
@@ -147,30 +145,30 @@ IFSelect_SignatureList::IFSelect_SignatureList
       {  return thename->ToCString();  }
 
 
-    void  IFSelect_SignatureList::PrintCount (const Handle(Message_Messenger)& S) const
+    void  IFSelect_SignatureList::PrintCount (Standard_OStream& S) const
 {
   Standard_Integer nbtot = 0, nbsign = 0;
   NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedicount);
-  S << " Count "<<thename->ToCString()<<"\n -----      -----------"<<Message_EndLine;
+  S << " Count "<<thename->ToCString()<<"\n -----      -----------"<<std::endl;
   for (; iter.More(); iter.Next()) {
     Standard_Integer val = iter.Value();
-    S << Interface_MSG::Blanks(val,6) << val <<"       "<<iter.Key()<<Message_EndLine;
+    S << Interface_MSG::Blanks(val,6) << val <<"       "<<iter.Key()<<std::endl;
     nbtot += val;
     nbsign ++;
   }
-  if (thenbnuls > 0) S << thename->ToCString()<< " Nul : " << thenbnuls<<Message_EndLine;
-  S<<"    Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<Message_EndLine;
+  if (thenbnuls > 0) S << thename->ToCString()<< " Nul : " << thenbnuls <<std::endl;
+  S << "    Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<std::endl;
 }
 
     void  IFSelect_SignatureList::PrintList
-  (const Handle(Message_Messenger)& S, const Handle(Interface_InterfaceModel)& model,
+  (Standard_OStream& S, const Handle(Interface_InterfaceModel)& model,
    const IFSelect_PrintCount mod) const
 {
   if (mod == IFSelect_ItemsByEntity) return;
   if (mod == IFSelect_CountByItem)   {  PrintCount (S);  return;  }
   if (mod == IFSelect_CountSummary)  {  PrintSum   (S);  return;  }
   if (!HasEntities()) {
-    S <<" SignatureList "<<Name()<<" : PrintList, list not available"<<Message_EndLine;
+    S <<" SignatureList "<<Name()<<" : PrintList, list not available"<<std::endl;
     PrintCount(S);
     return;
   }
@@ -178,35 +176,36 @@ IFSelect_SignatureList::IFSelect_SignatureList
   NCollection_IndexedDataMap<TCollection_AsciiString, Handle(Standard_Transient)>::Iterator iter(thediclist);
   for (; iter.More(); iter.Next()) {
     DeclareAndCast(TColStd_HSequenceOfTransient,list,iter.Value());
-    S<<Name()<<" : "<<iter.Key()<<Message_EndLine;
-    if (list.IsNull())  {  S<<"  - (empty list)"<<Message_EndLine; continue;  }
+    S<<Name()<<" : "<<iter.Key()<<std::endl;
+    if (list.IsNull())  {  S<<"  - (empty list)"<<std::endl; continue;  }
     Standard_Integer nb = list->Length();
     S<<"  - Nb: "<<nb<<" : ";
     Standard_Integer nc = nb;  if (nb > 5 && mod == IFSelect_ShortByItem) nc = 5;
     for (Standard_Integer i = 1; i <= nc; i ++) {
       if (list->Value(i).IsNull()) {
-       S<<"  0";  if (mod == IFSelect_EntitiesByItem) S<<":(Global)";
+       S << "  0";  
+        if (mod == IFSelect_EntitiesByItem) S<<":(Global)";
        continue;
       }
       Standard_Integer num = model->Number(list->Value(i));
       if (num == IFSelect_ShortByItem)  {  S<<"  ??";  continue;  }
       S<<"  "<<num;
       if (mod == IFSelect_EntitiesByItem)
-       {  S<<":";  model->PrintLabel(list->Value(i),S);  }
+       {  S<<":";  model->PrintLabel(list->Value(i), S);  }
     }
     if (nc < nb) S<<"  .. etc";
-    S<<Message_EndLine;
+    S<<std::endl;
     nbtot += nb;
     nbsign ++;
   }
-  S<<" Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<Message_EndLine;
+  S <<" Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<std::endl;
 }
 
 
-    void  IFSelect_SignatureList::PrintSum (const Handle(Message_Messenger)& S) const
+    void  IFSelect_SignatureList::PrintSum (Standard_OStream& S) const
 {
   NCollection_IndexedDataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thedicount);
-  S << " Summary "<<thename->ToCString()<<"\n -----    -----------"<<Message_EndLine;
+  S << " Summary "<<thename->ToCString()<<"\n -----    -----------"<<std::endl;
   Standard_Integer nbtot = 0, nbsign = 0, maxent = 0, nbval = 0, nbve = 0, minval = 0, maxval = 0, totval = 0;
   for (; iter.More(); iter.Next()) {
     Standard_Integer nbent = iter.Value();
@@ -232,18 +231,18 @@ IFSelect_SignatureList::IFSelect_SignatureList
     nbve += nbent;
     totval += (val*nbent);
   }
-  S << "    Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<Message_EndLine;
-  S << "    Highest count of entities : "<<maxent<<" on one item"<<Message_EndLine;
+  S << "    Nb Total:"<<nbtot<<"  for "<<nbsign<<" items"<<std::endl;
+  S << "    Highest count of entities : "<<maxent<<" on one item"<<std::endl;
   if (nbval > 0) {
-    S<<"    Summary on Integer Values"<<Message_EndLine;
-    S<<"    Nb Integer Items : "<<nbval<<Message_EndLine;
-    S<<"    For Nb Entities  : "<<nbve<<Message_EndLine;
-    S<<"    Cumulated Values : "<<totval<<Message_EndLine;
-    S<<"    Maximum Value    : "<<maxval<<Message_EndLine;
+    S<<"    Summary on Integer Values"<<std::endl;
+    S<<"    Nb Integer Items : "<<nbval<<std::endl;
+    S<<"    For Nb Entities  : "<<nbve<<std::endl;
+    S<<"    Cumulated Values : "<<totval<<std::endl;
+    S <<"    Maximum Value    : "<<maxval<<std::endl;
     Standard_Integer avg1, avg2;
     avg1 = totval/nbve;
     avg2 = ((totval - (avg1*nbve)) * 10) / nbve;
-    S<<"    Average Value    : "<<avg1<<" "<<avg2<<"/10"<<Message_EndLine;
-    S<<"    Minimum Value    : "<<minval<<Message_EndLine;
+    S <<"    Average Value    : "<<avg1<<" "<<avg2<<"/10"<<std::endl;
+    S <<"    Minimum Value    : "<<minval<<std::endl;
   }
 }