0024644: Draw_Printer - provide the way to control messages gravity filter
[occt.git] / src / Message / Message_PrinterOStream.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 93cd194..88cf345
@@ -1,7 +1,17 @@
-// File:      Message_PrinterOStream.cxx
-// Created:   Sat Jan  6 20:01:38 2001
-// Author:    OCC Team
-// Copyright: Open CASCADE S.A. 2005
+// Created on: 2001-01-06
+// Created by: OCC Team
+// Copyright (c) 2001-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <Message_PrinterOStream.ixx>
 
 //purpose  : Empty constructor, defaulting to cerr
 //=======================================================================
 
-Message_PrinterOStream::Message_PrinterOStream (const Message_Gravity theTraceLevel) 
-: myTraceLevel(theTraceLevel), myStream(&cout), 
-  myIsFile(Standard_False), myUseUtf8(Standard_False)
+Message_PrinterOStream::Message_PrinterOStream (const Message_Gravity theTraceLevel)
+: myStream  (&cout),
+  myIsFile  (Standard_False),
+  myUseUtf8 (Standard_False)
 {
+  myTraceLevel = theTraceLevel;
 }
 
 //=======================================================================
@@ -28,10 +40,12 @@ Message_PrinterOStream::Message_PrinterOStream (const Message_Gravity theTraceLe
 //           for specific file names standard streams are created
 //=======================================================================
 Message_PrinterOStream::Message_PrinterOStream (const Standard_CString theFileName,
-                                               const Standard_Boolean doAppend,
-                                               const Message_Gravity theTraceLevel)
-: myTraceLevel(theTraceLevel), myStream(&cout), myIsFile(Standard_False)
+                                                const Standard_Boolean theToAppend,
+                                                const Message_Gravity  theTraceLevel)
+: myStream (&cout),
+  myIsFile (Standard_False)
 {
+  myTraceLevel = theTraceLevel;
   if ( strcasecmp(theFileName, "cout") == 0 ) 
     myStream = &cerr;
   else if ( strcasecmp(theFileName, "cerr") == 0 ) 
@@ -39,15 +53,15 @@ Message_PrinterOStream::Message_PrinterOStream (const Standard_CString theFileNa
   else 
   {
     TCollection_AsciiString aFileName (theFileName);
-#ifdef WNT
+#ifdef _WIN32
     aFileName.ChangeAll ('/', '\\');
 #endif
 
     ofstream *ofile = new ofstream (aFileName.ToCString(),
 #ifdef USE_STL_STREAMS
-                                (doAppend ? (std::ios_base::app | std::ios_base::out) : std::ios_base::out ) );
+                                    (theToAppend ? (std::ios_base::app | std::ios_base::out) : std::ios_base::out ) );
 #else
-                                (doAppend ? ios::app : ios::out ) );
+                                    (theToAppend ? ios::app : ios::out ) );
 #endif
     if ( ofile ) {
       myStream = (Standard_OStream*)ofile;