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:
@@ -692,7 +692,7 @@ void Interface_Check::Print(const Handle(Message_Messenger)& S, const Standard_I
|
||||
|
||||
if (level >= 1) {
|
||||
nb = NbFails();
|
||||
// if (nb > 0) S<<" --> Fails : "<<nb<<endl;
|
||||
// if (nb > 0) S<<" --> Fails : "<<nb<<std::endl;
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
if (final >= 0)
|
||||
S<<CFail(j,Standard_True)<<"\n";
|
||||
@@ -706,7 +706,7 @@ void Interface_Check::Print(const Handle(Message_Messenger)& S, const Standard_I
|
||||
|
||||
if (level >= 2) {
|
||||
nb = NbWarnings();
|
||||
// if (nb > 0) S<<" --> Warnings : "<<nb<<endl;
|
||||
// if (nb > 0) S<<" --> Warnings : "<<nb<<std::endl;
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
if (final >= 0)
|
||||
S<<CWarning(j,Standard_True)<<"\n";
|
||||
@@ -721,7 +721,7 @@ void Interface_Check::Print(const Handle(Message_Messenger)& S, const Standard_I
|
||||
// InfoMsg : regle causant (user message)
|
||||
if (level >= 0) {
|
||||
nb = NbInfoMsgs();
|
||||
// if (nb > 0) S<<" --> Infos : "<<nb<<endl;
|
||||
// if (nb > 0) S<<" --> Infos : "<<nb<<std::endl;
|
||||
for (j = 1; j <= nb; j ++) {
|
||||
if (final >= 0)
|
||||
S<<CInfoMsg(j,Standard_True)<<"\n";
|
||||
|
@@ -540,11 +540,11 @@ void Interface_CheckIterator::Print(const Handle(Message_Messenger)& S,
|
||||
// mesnum = mesnum0;
|
||||
// if (yamod) mesnum = (nm0 > 0 ? mesnum1 : mesnum2);
|
||||
|
||||
if (!titre) S<<" ** " << Name() << " **"<<endl;
|
||||
if (!titre) S<<" ** " << Name() << " **"<<Message_EndLine;
|
||||
titre = Standard_True;
|
||||
S<<"Check:"; if(nb > 9 && i < 10) S<<" "; if (nb > 99 && i < 100) S<<" ";
|
||||
S<<i;
|
||||
if (num < 0) S<<" -- Global Check"<<endl;
|
||||
if (num < 0) S<<" -- Global Check"<<Message_EndLine;
|
||||
else if (num == 0) S<<" -- Entity n0 ??:";
|
||||
else {
|
||||
if (yamod) { S<<" -- Entity (n0:id) "; model->Print (ent,S); }
|
||||
@@ -552,16 +552,16 @@ void Interface_CheckIterator::Print(const Handle(Message_Messenger)& S,
|
||||
// S<<" -- Entity n0 "<<num<<mesnum;
|
||||
// if (yamod) model->PrintLabel(ent,S);
|
||||
}
|
||||
if (num >= 0 && entnul) S<<" (unknown Type)"<<endl;
|
||||
if (num >= 0 && entnul) S<<" (unknown Type)"<<Message_EndLine;
|
||||
else if (num >= 0 && !entnul) {
|
||||
if (yamod) S<<" Type:"<<model->TypeName(ent)<<endl;
|
||||
else S<<" Type:"<<ent->DynamicType()->Name()<<endl;
|
||||
if (yamod) S<<" Type:"<<model->TypeName(ent)<<Message_EndLine;
|
||||
else S<<" Type:"<<ent->DynamicType()->Name()<<Message_EndLine;
|
||||
}
|
||||
|
||||
nbch ++;
|
||||
ach->Print (S, (failsonly ? 1 : 3));
|
||||
}
|
||||
// if (nbch > 0) S<<" ---- Checks : "<<nbch<<" ----"<<endl;
|
||||
// if (nbch > 0) S<<" ---- Checks : "<<nbch<<" ----"<<std::endl;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -207,7 +207,7 @@ const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
|
||||
}
|
||||
////sln 21.01.2002 OCC133: Exception handling
|
||||
// catch (Standard_OutOfRange) {
|
||||
// cout<<" Catch of sln"<<endl;
|
||||
// std::cout<<" Catch of sln"<<std::endl;
|
||||
|
||||
// return dummy;
|
||||
// }
|
||||
@@ -216,12 +216,12 @@ const Handle(Standard_Transient)& Interface_FileReaderData::BoundEntity
|
||||
// some work-around, the best would be to modify CDL to
|
||||
// return "Handle(Standard_Transient)" not "const Handle(Standard_Transient)&"
|
||||
static Handle(Standard_Transient) dummy;
|
||||
// cout<<" Catch of smh"<<endl;
|
||||
// std::cout<<" Catch of smh"<<std::endl;
|
||||
return dummy;
|
||||
}
|
||||
}
|
||||
//cout<<" Normal"<<endl;
|
||||
if (theents.Value(num).IsImmutable()) cout << "IMMUTABLE:"<<num<<endl;
|
||||
//std::cout<<" Normal"<<std::endl;
|
||||
if (theents.Value(num).IsImmutable()) std::cout << "IMMUTABLE:"<<num<<std::endl;
|
||||
return theents(num);
|
||||
}
|
||||
*/
|
||||
@@ -232,7 +232,7 @@ void Interface_FileReaderData::BindEntity
|
||||
{
|
||||
// #ifdef OCCT_DEBUG
|
||||
// if (ent.IsImmutable())
|
||||
// cout << "Bind IMMUTABLE:"<<num<<endl;
|
||||
// std::cout << "Bind IMMUTABLE:"<<num<<std::endl;
|
||||
// #endif
|
||||
theents.SetValue(num,ent);
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@
|
||||
|
||||
//! This class converts a floting number (Real) to a string
|
||||
//! It can be used if the standard C-C++ output functions
|
||||
//! (sprintf or cout<<) are not convenient. That is to say :
|
||||
//! (sprintf or std::cout<<) are not convenient. That is to say :
|
||||
//! - to suppress trailing '0' and 'E+00' (if desired)
|
||||
//! - to control exponant output and floating point output
|
||||
//!
|
||||
|
@@ -144,7 +144,7 @@ Standard_Integer Interface_MSG::Read (Standard_IStream& S)
|
||||
|
||||
Standard_Integer Interface_MSG::Read (const Standard_CString file)
|
||||
{
|
||||
ifstream S(file);
|
||||
std::ifstream S(file);
|
||||
if (!S) return -1;
|
||||
return Read (S);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ Standard_Integer Interface_MSG::Read (Standard_IStream& S)
|
||||
{
|
||||
Standard_Integer nb = 0;
|
||||
if (thedic.IsEmpty()) return nb;
|
||||
if (rootkey[0] != '\0') S<<"@@ ROOT:"<<rootkey<<endl;
|
||||
if (rootkey[0] != '\0') S<<"@@ ROOT:"<<rootkey<<std::endl;
|
||||
NCollection_DataMap<TCollection_AsciiString, Handle(TCollection_HAsciiString)>::Iterator iter(thedic);
|
||||
for (; iter.More(); iter.Next()) {
|
||||
if (!iter.Key().StartsWith(rootkey)) continue;
|
||||
@@ -164,7 +164,7 @@ Standard_Integer Interface_MSG::Read (Standard_IStream& S)
|
||||
nb ++;
|
||||
S<<str->ToCString()<<"\n";
|
||||
}
|
||||
S<<flush;
|
||||
S<<std::flush;
|
||||
return nb;
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ Standard_CString Interface_MSG::Translated (const Standard_CString key)
|
||||
if (thedic.Find(key, str))
|
||||
return str->ToCString();
|
||||
}
|
||||
if (theprint) cout<<" ** Interface_MSG:Translate ?? "<<key<<" **"<<endl;
|
||||
if (theprint) std::cout<<" ** Interface_MSG:Translate ?? "<<key<<" **"<<std::endl;
|
||||
if (therec) {
|
||||
if (thelist.IsBound(key)) {
|
||||
thelist.ChangeFind(key)++;
|
||||
@@ -208,7 +208,7 @@ void Interface_MSG::Record
|
||||
thedic.Bind(key,str);
|
||||
return;
|
||||
}
|
||||
if (theprint) cout<<" ** Interface_MSG:Record ?? "<<key<<" ** "<<item<<" **"<<endl;
|
||||
if (theprint) std::cout<<" ** Interface_MSG:Record ?? "<<key<<" ** "<<item<<" **"<<std::endl;
|
||||
if (therec) {
|
||||
if (thedup.IsNull()) thedup = new TColStd_HSequenceOfHAsciiString();
|
||||
dup = new TCollection_HAsciiString(key);
|
||||
@@ -244,13 +244,13 @@ void Interface_MSG::PrintTrace (Standard_OStream& S)
|
||||
dup = thedup->Value(2*i-1);
|
||||
S<<"** DUP:"<<dup->ToCString();
|
||||
dup = thedup->Value(2*i);
|
||||
S<<" ** "<<dup->ToCString()<<endl;
|
||||
S<<" ** "<<dup->ToCString()<<std::endl;
|
||||
}
|
||||
|
||||
if (thelist.IsEmpty()) return;
|
||||
NCollection_DataMap<TCollection_AsciiString, Standard_Integer>::Iterator iter(thelist);
|
||||
for (; iter.More(); iter.Next()) {
|
||||
S<<"** MSG(NB="<<iter.Value()<<"): "<<iter.Key()<<endl;
|
||||
S<<"** MSG(NB="<<iter.Value()<<"): "<<iter.Key()<<std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -211,5 +211,5 @@ Interface_ShareTool::Interface_ShareTool (const Handle(Interface_HGraph)& ahgrap
|
||||
Handle(Standard_Transient) ent = iter.Value();
|
||||
S << " n0/id:"; Model()->Print(ent,S);
|
||||
}
|
||||
S<<endl;
|
||||
S<<Message_EndLine;
|
||||
}
|
||||
|
@@ -89,10 +89,10 @@ void Interface_Static::PrintStatic (const Handle(Message_Messenger)& S) const
|
||||
S<<"--- Static Value : "<<Name()<<" Family:"<<Family();
|
||||
Print (S);
|
||||
if (!thewild.IsNull())
|
||||
S<<" -- Attached to wild-card : "<<thewild->Name()<<endl;
|
||||
S<<" -- Attached to wild-card : "<<thewild->Name()<<Message_EndLine;
|
||||
S<<"--- Actual status : "<<(theupdate ? "" : "original")<<" Value : ";
|
||||
|
||||
if (thesatisf) S<<" -- Specific Function for Satisfies : "<<thesatisn.ToCString()<<endl;
|
||||
if (thesatisf) S<<" -- Specific Function for Satisfies : "<<thesatisn.ToCString()<<Message_EndLine;
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ Standard_CString Interface_Static::CVal (const Standard_CString name)
|
||||
Handle(Interface_Static) item = Interface_Static::Static(name);
|
||||
if (item.IsNull()) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Interface_Static::CVal: incorrect parameter " << name << endl;
|
||||
std::cout << "Warning: Interface_Static::CVal: incorrect parameter " << name << std::endl;
|
||||
#endif
|
||||
return "";
|
||||
}
|
||||
@@ -317,7 +317,7 @@ Standard_Integer Interface_Static::IVal (const Standard_CString name)
|
||||
Handle(Interface_Static) item = Interface_Static::Static(name);
|
||||
if (item.IsNull()) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Interface_Static::IVal: incorrect parameter " << name << endl;
|
||||
std::cout << "Warning: Interface_Static::IVal: incorrect parameter " << name << std::endl;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ Standard_Real Interface_Static::RVal (const Standard_CString name)
|
||||
Handle(Interface_Static) item = Interface_Static::Static(name);
|
||||
if (item.IsNull()) {
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: Interface_Static::RVal: incorrect parameter " << name << endl;
|
||||
std::cout << "Warning: Interface_Static::RVal: incorrect parameter " << name << std::endl;
|
||||
#endif
|
||||
return 0.0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user