1
0
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:
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

@@ -684,7 +684,7 @@ void BRepTools::Write(const TopoDS_Shape& Sh, Standard_OStream& S,
//=======================================================================
void BRepTools::Read(TopoDS_Shape& Sh,
istream& S,
std::istream& S,
const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& PR)
{
@@ -703,8 +703,8 @@ Standard_Boolean BRepTools::Write(const TopoDS_Shape& Sh,
const Standard_CString File,
const Handle(Message_ProgressIndicator)& PR)
{
ofstream os;
OSD_OpenStream(os, File, ios::out);
std::ofstream os;
OSD_OpenStream(os, File, std::ios::out);
if (!os.is_open() || !os.good())
return Standard_False;
@@ -741,9 +741,9 @@ Standard_Boolean BRepTools::Read(TopoDS_Shape& Sh,
const BRep_Builder& B,
const Handle(Message_ProgressIndicator)& PR)
{
filebuf fic;
istream in(&fic);
OSD_OpenStream (fic, File, ios::in);
std::filebuf fic;
std::istream in(&fic);
OSD_OpenStream (fic, File, std::ios::in);
if(!fic.is_open()) return Standard_False;
BRepTools_ShapeSet SS(B);

View File

@@ -52,11 +52,11 @@ const char* BRepTools_Dump (void* theShapePtr)
try {
OCC_CATCH_SIGNALS
cout <<"\n\n";
BRepTools::Dump (*(TopoDS_Shape*)theShapePtr, cout);
cout << endl;
std::cout <<"\n\n";
BRepTools::Dump (*(TopoDS_Shape*)theShapePtr, std::cout);
std::cout << std::endl;
return "Shape dumped to cout";
return "Shape dumped to std::cout";
}
catch (Standard_Failure const& anException)
{
@@ -74,13 +74,13 @@ const char* BRepTools_DumpLoc (void* theLocationPtr)
try {
OCC_CATCH_SIGNALS
cout <<"\n\n";
std::cout <<"\n\n";
TopTools_LocationSet LS;
LS.Add(*(TopLoc_Location*)theLocationPtr);
LS.Dump(cout);
cout <<endl;
LS.Dump(std::cout);
std::cout <<std::endl;
return "Location dumped to cout";
return "Location dumped to std::cout";
}
catch (Standard_Failure const& anException)
{

View File

@@ -107,7 +107,7 @@ static void CopyShape(const TopoDS_Edge& E,TopTools_IndexedDataMapOfShapeShape&
}*/
void BRepTools_Quilt::Add(const TopoDS_Shape& S)
{
//cout <<" Version of sewing with free edges"<<endl;
//std::cout <<" Version of sewing with free edges"<<std::endl;
// Binds all the faces of S
// - to the face itself if it is not copied
// - to the copy if it is copied

View File

@@ -181,7 +181,7 @@ void BRepTools_ReShape::replace (const TopoDS_Shape& ashape,
#ifdef OCCT_DEBUG
if ( IsRecorded ( shape ) && ((myConsiderLocation && ! Value ( shape ).IsPartner ( newshape )) ||
(!myConsiderLocation && ! Value ( shape ).IsSame ( newshape ))))
cout << "Warning: BRepTools_ReShape::Replace: shape already recorded" << endl;
std::cout << "Warning: BRepTools_ReShape::Replace: shape already recorded" << std::endl;
#endif
myShapeToReplacement.Bind(shape, TReplacement(newshape, theKind));

View File

@@ -70,7 +70,7 @@
//
// On NT platforms (in BRepTools_ShapeSet):
// ----------------
// In Visual C++ 5 (or higher) the fstream::tellg method is not
// In Visual C++ 5 (or higher) the std::fstream::tellg method is not
// conform to Standard C++ because it modifies the file pointer
// position and returns a wrong position. After that the next
// readings are shifted and the reading process stop with errors.
@@ -1111,7 +1111,7 @@ void BRepTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
{
// create a face :
TopoDS_Face& F = TopoDS::Face(S);
// streampos pos;
// std::streampos pos;
myBuilder.MakeFace(F);
IS >> val; // natural restriction
@@ -1390,12 +1390,12 @@ void BRepTools_ShapeSet::WritePolygon3D(Standard_OStream& OS,
Standard_Integer i1, nbNodes = P->NbNodes();
const TColgp_Array1OfPnt& Nodes = P->Nodes();
for (j = 1; j <= nbNodes; j++) {
if (!Compact) OS << setw(10) << j << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << j << " : ";
if (!Compact) OS << std::setw(17);
OS << Nodes(j).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(j).Y() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(j).Z();
if (!Compact) OS << "\n";
else OS << " ";
@@ -1518,12 +1518,12 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
nbNodes = T->NbNodes();
const TColgp_Array1OfPnt& Nodes = T->Nodes();
for (j = 1; j <= nbNodes; j++) {
if (!Compact) OS << setw(10) << j << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << j << " : ";
if (!Compact) OS << std::setw(17);
OS << Nodes(j).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(j).Y() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << Nodes(j).Z();
if (!Compact) OS << "\n";
else OS << " ";
@@ -1533,10 +1533,10 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
if (!Compact) OS << "\nUV Nodes :\n";
const TColgp_Array1OfPnt2d& UVNodes = T->UVNodes();
for (j = 1; j <= nbNodes; j++) {
if (!Compact) OS << setw(10) << j << " : ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(10) << j << " : ";
if (!Compact) OS << std::setw(17);
OS << UVNodes(j).X() << " ";
if (!Compact) OS << setw(17);
if (!Compact) OS << std::setw(17);
OS << UVNodes(j).Y();
if (!Compact) OS << "\n";
else OS << " ";
@@ -1547,13 +1547,13 @@ void BRepTools_ShapeSet::WriteTriangulation(Standard_OStream& OS,
nbTriangles = T->NbTriangles();
const Poly_Array1OfTriangle& Triangles = T->Triangles();
for (j = 1; j <= nbTriangles; j++) {
if (!Compact) OS << setw(10) << j << " : ";
if (!Compact) OS << std::setw(10) << j << " : ";
Triangles(j).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;
if (!Compact) OS << "\n";
else OS << " ";