1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +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:
tiv
2019-08-02 10:32:16 +03:00
committed by bugmaster
parent 3977d18aca
commit 0423218095
972 changed files with 8554 additions and 8550 deletions

View File

@@ -98,8 +98,8 @@ void Poly::Write(const Handle(Poly_Triangulation)& T,
OS << ((T->HasUVNodes()) ? "1" : "0") << "\n";
}
else {
OS << setw(8) << T->NbNodes() << " Nodes\n";
OS << setw(8) << T->NbTriangles() << " Triangles\n";
OS << std::setw(8) << T->NbNodes() << " Nodes\n";
OS << std::setw(8) << T->NbTriangles() << " Triangles\n";
OS << ((T->HasUVNodes()) ? "with" : "without") << " UV nodes\n";
}
@@ -115,12 +115,12 @@ void Poly::Write(const Handle(Poly_Triangulation)& T,
Standard_Integer i, nbNodes = T->NbNodes();
const TColgp_Array1OfPnt& Nodes = T->Nodes();
for (i = 1; i <= nbNodes; i++) {
if (!Compact) OS << setw(10) << i << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << i << " : ";
if (!Compact) OS << std::setw(17);
OS << Nodes(i).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(i).Y() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(i).Z() << "\n";
}
@@ -128,10 +128,10 @@ void Poly::Write(const Handle(Poly_Triangulation)& T,
if (!Compact) OS << "\nUV Nodes :\n";
const TColgp_Array1OfPnt2d& UVNodes = T->UVNodes();
for (i = 1; i <= nbNodes; i++) {
if (!Compact) OS << setw(10) << i << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << i << " : ";
if (!Compact) OS << std::setw(17);
OS << UVNodes(i).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << UVNodes(i).Y() << "\n";
}
}
@@ -141,13 +141,13 @@ void Poly::Write(const Handle(Poly_Triangulation)& T,
Standard_Integer n1, n2, n3;
const Poly_Array1OfTriangle& Triangles = T->Triangles();
for (i = 1; i <= nbTriangles; i++) {
if (!Compact) OS << setw(10) << i << " : ";
if (!Compact) OS << std::setw(10) << i << " : ";
Triangles(i).Get(n1, n2, n3);
if (!Compact) OS << setw(10);
if (!Compact) OS << std::setw(10);
OS << n1 << " ";
if (!Compact) OS << setw(10);
if (!Compact) OS << std::setw(10);
OS << n2 << " ";
if (!Compact) OS << setw(10);
if (!Compact) OS << std::setw(10);
OS << n3 << "\n";
}
@@ -168,7 +168,7 @@ void Poly::Write(const Handle(Poly_Polygon3D)& P,
OS << ((P->HasParameters()) ? "1" : "0") << "\n";
}
else {
OS << setw(8) << P->NbNodes() << " Nodes\n";
OS << std::setw(8) << P->NbNodes() << " Nodes\n";
OS << ((P->HasParameters()) ? "with" : "without") << " parameters\n";
}
@@ -184,12 +184,12 @@ void Poly::Write(const Handle(Poly_Polygon3D)& P,
Standard_Integer i, nbNodes = P->NbNodes();
const TColgp_Array1OfPnt& Nodes = P->Nodes();
for (i = 1; i <= nbNodes; i++) {
if (!Compact) OS << setw(10) << i << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << i << " : ";
if (!Compact) OS << std::setw(17);
OS << Nodes(i).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(i).Y() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(i).Z() << "\n";
}
@@ -220,7 +220,7 @@ void Poly::Write(const Handle(Poly_Polygon2D)& P,
OS << P->NbNodes() << " ";
}
else {
OS << setw(8) << P->NbNodes() << " Nodes\n";
OS << std::setw(8) << P->NbNodes() << " Nodes\n";
}
// write the deflection
@@ -235,10 +235,10 @@ void Poly::Write(const Handle(Poly_Polygon2D)& P,
Standard_Integer i, nbNodes = P->NbNodes();
const TColgp_Array1OfPnt2d& Nodes = P->Nodes();
for (i = 1; i <= nbNodes; i++) {
if (!Compact) OS << setw(10) << i << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << i << " : ";
if (!Compact) OS << std::setw(17);
OS << Nodes(i).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(i).Y() << "\n";
}
}
@@ -291,7 +291,7 @@ Handle(Poly_Triangulation) Poly::ReadTriangulation(Standard_IStream& IS)
IS >> line;
if (strcmp(line,"Poly_Triangulation")) {
#ifdef OCCT_DEBUG
cout << "Not a Triangulation in the file" << endl;
std::cout << "Not a Triangulation in the file" << std::endl;
#endif
return Handle(Poly_Triangulation)();
}
@@ -357,7 +357,7 @@ Handle(Poly_Polygon3D) Poly::ReadPolygon3D(Standard_IStream& IS)
IS >> line;
if (strcmp(line,"Poly_Polygon3D")) {
#ifdef OCCT_DEBUG
cout << "Not a Polygon3D in the file" << endl;
std::cout << "Not a Polygon3D in the file" << std::endl;
#endif
return Handle(Poly_Polygon3D)();
}
@@ -412,7 +412,7 @@ Handle(Poly_Polygon2D) Poly::ReadPolygon2D(Standard_IStream& IS)
IS >> line;
if (strcmp(line,"Poly_Polygon2D")) {
#ifdef OCCT_DEBUG
cout << "Not a Polygon2D in the file" << endl;
std::cout << "Not a Polygon2D in the file" << std::endl;
#endif
return Handle(Poly_Polygon2D)();
}

View File

@@ -99,11 +99,11 @@ void Poly_CoherentNode::Dump(Standard_OStream& theStream) const
{
char buf[256];
Sprintf (buf, " X =%9.4f; Y =%9.4f; Z =%9.4f", X(), Y(), Z());
theStream << buf << endl;
theStream << buf << std::endl;
Poly_CoherentTriPtr::Iterator anIter(* myTriangles);
for (; anIter.More(); anIter.Next()) {
const Poly_CoherentTriangle& aTri = anIter.Value();
Sprintf (buf, " %5d %5d %5d", aTri.Node(0),aTri.Node(1),aTri.Node(2));
theStream << buf << endl;
theStream << buf << std::endl;
}
}

View File

@@ -178,10 +178,10 @@ Standard_Integer Poly_MakeLoops::Perform()
if (aStartNumber > 1)
if (doDebug)
{
cout << "--- found contour with hanging links:" << endl;
std::cout << "--- found contour with hanging links:" << std::endl;
for (i = 1; i <= aContour.Extent(); i++)
cout << " " << aContour(i);
cout << endl;
std::cout << " " << aContour(i);
std::cout << std::endl;
}
#endif
if (aStartNumber == 0)
@@ -223,8 +223,8 @@ Standard_Integer Poly_MakeLoops::Perform()
}
#ifdef OCCT_DEBUG
if (doDebug && nbLoopsOnPass2)
cout << "MakeLoops: " << nbLoopsOnPass2
<< " contours accepted on the second pass" << endl;
std::cout << "MakeLoops: " << nbLoopsOnPass2
<< " contours accepted on the second pass" << std::endl;
#endif
if (!myLoops.IsEmpty())
@@ -545,13 +545,13 @@ void Poly_MakeLoops::showBoundaryBreaks() const
if (isFirst)
{
isFirst = Standard_False;
cout << "boundary breaks are found in the following nodes:" << endl;
std::cout << "boundary breaks are found in the following nodes:" << std::endl;
}
cout << aNode << " ";
std::cout << aNode << " ";
}
}
if (!isFirst)
cout << endl;
std::cout << std::endl;
}
#endif