mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0030895: Coding Rules - specify std namespace explicitly for std::cout and streams
"endl" manipulator for Message_Messenger is renamed to "Message_EndLine". The following entities from std namespace are now used with std:: explicitly specified (from Standard_Stream.hxx): std::istream,std::ostream,std::ofstream,std::ifstream,std::fstream, std::filebuf,std::streambuf,std::streampos,std::ios,std::cout,std::cerr, std::cin,std::endl,std::ends,std::flush,std::setw,std::setprecision, std::hex,std::dec.
This commit is contained in:
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
//! Defines default messenger for OCCT applications.
|
||||
//! This is global static instance of the messenger.
|
||||
//! By default, it contains single printer directed to cout.
|
||||
//! By default, it contains single printer directed to std::cout.
|
||||
//! It can be customized according to the application needs.
|
||||
Standard_EXPORT static const Handle(Message_Messenger)& DefaultMessenger();
|
||||
|
||||
|
@@ -53,7 +53,7 @@ class Message_Messenger : public Standard_Transient
|
||||
DEFINE_STANDARD_RTTIEXT(Message_Messenger, Standard_Transient)
|
||||
public:
|
||||
|
||||
//! Empty constructor; initializes by single printer directed to cout.
|
||||
//! Empty constructor; initializes by single printer directed to std::cout.
|
||||
//! Note: the default messenger is not empty but directed to cout
|
||||
//! in order to protect against possibility to forget defining printers.
|
||||
//! If printing to cout is not needed, clear messenger by GetPrinters().Clear()
|
||||
@@ -178,6 +178,13 @@ inline const Handle(Message_Messenger)&
|
||||
return pman (theMessenger);
|
||||
}
|
||||
|
||||
// Message_EndLine
|
||||
inline const Handle(Message_Messenger)& Message_EndLine (const Handle(Message_Messenger)& theMessenger)
|
||||
{
|
||||
theMessenger->Send ("", Message_Info, Standard_True);
|
||||
return theMessenger;
|
||||
}
|
||||
|
||||
// endl
|
||||
inline const Handle(Message_Messenger)& endl (const Handle(Message_Messenger)& theMessenger)
|
||||
{
|
||||
|
@@ -39,7 +39,7 @@ Message_PrinterOStream::Message_PrinterOStream (const Message_Gravity theTraceLe
|
||||
|
||||
//=======================================================================
|
||||
//function : Constructor
|
||||
//purpose : Opening a file as an ostream
|
||||
//purpose : Opening a file as an std::ostream
|
||||
// for specific file names standard streams are created
|
||||
//=======================================================================
|
||||
Message_PrinterOStream::Message_PrinterOStream (const Standard_CString theFileName,
|
||||
@@ -115,7 +115,7 @@ void Message_PrinterOStream::Send (const Standard_CString theString,
|
||||
if ( theGravity < myTraceLevel || ! myStream ) return;
|
||||
Standard_OStream* ostr = (Standard_OStream*)myStream;
|
||||
(*ostr) << theString;
|
||||
if ( putEndl ) (*ostr) << endl;
|
||||
if ( putEndl ) (*ostr) << std::endl;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
@@ -23,8 +23,8 @@
|
||||
class Message_PrinterOStream;
|
||||
DEFINE_STANDARD_HANDLE(Message_PrinterOStream, Message_Printer)
|
||||
|
||||
//! Implementation of a message printer associated with an ostream
|
||||
//! The ostream may be either externally defined one (e.g. cout),
|
||||
//! Implementation of a message printer associated with an std::ostream
|
||||
//! The std::ostream may be either externally defined one (e.g. std::cout),
|
||||
//! or file stream maintained internally (depending on constructor).
|
||||
class Message_PrinterOStream : public Message_Printer
|
||||
{
|
||||
|
Reference in New Issue
Block a user