1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-24 13:50:49 +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

@@ -165,9 +165,9 @@ void BinTools::Read (TopoDS_Shape& theShape, Standard_IStream& theStream)
Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_CString theFile)
{
ofstream aStream;
std::ofstream aStream;
aStream.precision (15);
OSD_OpenStream (aStream, theFile, ios::out | ios::binary);
OSD_OpenStream (aStream, theFile, std::ios::out | std::ios::binary);
if (!aStream.good())
return Standard_False;
@@ -183,8 +183,8 @@ Standard_Boolean BinTools::Write (const TopoDS_Shape& theShape, const Standard_C
Standard_Boolean BinTools::Read (TopoDS_Shape& theShape, const Standard_CString theFile)
{
filebuf aBuf;
OSD_OpenStream (aBuf, theFile, ios::in | ios::binary);
std::filebuf aBuf;
OSD_OpenStream (aBuf, theFile, std::ios::in | std::ios::binary);
if (!aBuf.is_open())
return Standard_False;

View File

@@ -334,8 +334,8 @@ void BinTools_Curve2dSet::WriteCurve2d(const Handle(Geom2d_Curve)& C,
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_Curve2dSet::WriteCurve2d(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_Curve2dSet::WriteCurve2d(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -680,8 +680,8 @@ Standard_IStream& BinTools_Curve2dSet::ReadCurve2d(Standard_IStream& IS,
catch(Standard_Failure const& anException) {
C = NULL;
Standard_SStream aMsg;
aMsg <<"EXCEPTION in BinTools_Curve2dSet::ReadCurve2d(...)" << endl;
aMsg << anException << endl;
aMsg <<"EXCEPTION in BinTools_Curve2dSet::ReadCurve2d(...)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
return IS;
@@ -699,9 +699,9 @@ void BinTools_Curve2dSet::Read(Standard_IStream& IS)
IS >> buffer;
if (IS.fail() || strcmp(buffer,"Curve2ds")) {
Standard_SStream aMsg;
aMsg << "BinTools_Curve2dSet::Read: Not a Curve2d table"<<endl;
aMsg << "BinTools_Curve2dSet::Read: Not a Curve2d table"<<std::endl;
#ifdef OCCT_DEBUG
cout <<"Curve2dSet buffer: " << buffer << endl;
std::cout <<"Curve2dSet buffer: " << buffer << std::endl;
#endif
throw Standard_Failure(aMsg.str().c_str());
return;

View File

@@ -347,8 +347,8 @@ void BinTools_CurveSet::WriteCurve(const Handle(Geom_Curve)& C,
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_CurveSet::WriteCurve(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_CurveSet::WriteCurve(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -699,8 +699,8 @@ Standard_IStream& BinTools_CurveSet::ReadCurve(Standard_IStream& IS,
catch(Standard_Failure const& anException) {
C = NULL;
Standard_SStream aMsg;
aMsg <<"EXCEPTION in BinTools_CurveSet::ReadCurve(..)" << endl;
aMsg << anException << endl;
aMsg <<"EXCEPTION in BinTools_CurveSet::ReadCurve(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
return IS;
@@ -717,9 +717,9 @@ void BinTools_CurveSet::Read(Standard_IStream& IS)
IS >> buffer;
if (IS.fail() || strcmp(buffer,"Curves")) {
Standard_SStream aMsg;
aMsg << "BinTools_CurveSet::Read: Not a Curve table"<<endl;
aMsg << "BinTools_CurveSet::Read: Not a Curve table"<<std::endl;
#ifdef OCCT_DEBUG
cout <<"CurveSet buffer: " << buffer << endl;
std::cout <<"CurveSet buffer: " << buffer << std::endl;
#endif
throw Standard_Failure(aMsg.str().c_str());
return;

View File

@@ -198,8 +198,8 @@ void BinTools_LocationSet::Write(Standard_OStream& OS) const
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_LocatioSet::Write(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_LocatioSet::Write(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -218,7 +218,7 @@ void BinTools_LocationSet::Read(Standard_IStream& IS)
IS >> buffer;
if (IS.fail() || (strcmp(buffer,"Locations"))) {
Standard_SStream aMsg;
aMsg << "BinTools_LocationSet::Read: Not a location table"<<endl;
aMsg << "BinTools_LocationSet::Read: Not a location table"<<std::endl;
throw Standard_Failure(aMsg.str().c_str());
return;
}
@@ -250,7 +250,7 @@ void BinTools_LocationSet::Read(Standard_IStream& IS)
}
} else {
Standard_SStream aMsg;
aMsg << "Unexpected location's type = " << aTypLoc << endl;
aMsg << "Unexpected location's type = " << aTypLoc << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
if (!L.IsIdentity()) myMap.Add(L);
@@ -258,8 +258,8 @@ void BinTools_LocationSet::Read(Standard_IStream& IS)
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_LocationSet::Read(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_LocationSet::Read(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}

View File

@@ -397,7 +397,7 @@ void BinTools_ShapeSet::Read(Standard_IStream& IS)
} while ( ! IS.fail() && strcmp(vers,Version_1) && strcmp(vers,Version_2) &&
strcmp(vers,Version_3));
if (IS.fail()) {
cout << "BinTools_ShapeSet::Read: File was not written with this version of the topology"<<endl;
std::cout << "BinTools_ShapeSet::Read: File was not written with this version of the topology"<<std::endl;
return;
}
@@ -424,7 +424,7 @@ void BinTools_ShapeSet::Read(Standard_IStream& IS)
IS >> buffer;
if (IS.fail() || strcmp(buffer,"TShapes")) {
Standard_SStream aMsg;
aMsg << "BinTools_ShapeSet::Read: Not a TShape table"<<endl;
aMsg << "BinTools_ShapeSet::Read: Not a TShape table"<<std::endl;
throw Standard_Failure(aMsg.str().c_str());
return;
}
@@ -748,8 +748,8 @@ void BinTools_ShapeSet::WriteGeometry(const TopoDS_Shape& S,
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteGeometry(S,OS)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteGeometry(S,OS)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -783,7 +783,7 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
case TopAbs_VERTEX :
{
// Standard_Integer aPos = IS.tellg();
// cout << "\nPOS = " << aPos << endl;
// std::cout << "\nPOS = " << aPos << std::endl;
TopoDS_Vertex& V = TopoDS::Vertex(S);
// Read the point geometry
@@ -804,11 +804,11 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
if (val > 0 && val <= 3)
BinTools::GetReal(IS, p1);
} else {
streampos aPos = IS.tellg();
std::streampos aPos = IS.tellg();
BinTools::GetReal(IS, p1);
val = (Standard_Integer)IS.get();//case {0|1|2|3}
#ifdef OCCT_DEBUG
cout << "\nVal = " << val <<endl;
std::cout << "\nVal = " << val <<std::endl;
#endif
if(val != 1 && val !=2 && val !=3){
IS.seekg(aPos);
@@ -870,7 +870,7 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
default:
{
Standard_SStream aMsg;
aMsg << "BinTools_SurfaceSet::ReadGeometry: UnExpected BRep_PointRepresentation = "<< val <<endl;
aMsg << "BinTools_SurfaceSet::ReadGeometry: UnExpected BRep_PointRepresentation = "<< val <<std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1065,7 +1065,7 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
default:
{
Standard_SStream aMsg;
aMsg <<"Unexpected Curve Representation ="<< val << endl;
aMsg <<"Unexpected Curve Representation ="<< val << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
@@ -1152,7 +1152,7 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
default:
{
Standard_SStream aMsg;
aMsg << "Unexpected topology type = "<< T <<endl;
aMsg << "Unexpected topology type = "<< T <<std::endl;
throw Standard_Failure(aMsg.str().c_str());
break;
}
@@ -1160,8 +1160,8 @@ void BinTools_ShapeSet::ReadGeometry(const TopAbs_ShapeEnum T,
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadGeometry(S,OS)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadGeometry(S,OS)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1217,8 +1217,8 @@ void BinTools_ShapeSet::WritePolygonOnTriangulation(Standard_OStream& OS) const
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygonOnTriangulation(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygonOnTriangulation(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1270,8 +1270,8 @@ void BinTools_ShapeSet::ReadPolygonOnTriangulation(Standard_IStream& IS)
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygonOnTriangulation(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygonOnTriangulation(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1316,8 +1316,8 @@ void BinTools_ShapeSet::WritePolygon3D(Standard_OStream& OS)const
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygon3D(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::WritePolygon3D(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1336,7 +1336,7 @@ void BinTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS)
if (IS.fail() || strstr(buffer,"Polygon3D") == NULL) {
#ifdef OCCT_DEBUG
cout <<"Buffer: " << buffer << endl;
std::cout <<"Buffer: " << buffer << std::endl;
#endif
throw Standard_Failure("BinTools_ShapeSet::ReadPolygon3D: Not a Polygon3D section");
}
@@ -1371,8 +1371,8 @@ void BinTools_ShapeSet::ReadPolygon3D(Standard_IStream& IS)
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygon3D(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadPolygon3D(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1427,8 +1427,8 @@ void BinTools_ShapeSet::WriteTriangulation(Standard_OStream& OS) const
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteTriangulation(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::WriteTriangulation(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -1497,8 +1497,8 @@ void BinTools_ShapeSet::ReadTriangulation(Standard_IStream& IS)
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadTriangulation(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_ShapeSet::ReadTriangulation(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}

View File

@@ -269,8 +269,8 @@ static Standard_OStream& operator <<(Standard_OStream& OS, const Handle(Geom_Bez
Standard_Boolean vrational = S->IsVRational() ? 1:0;
BinTools::PutBool(OS, urational); //rational
BinTools::PutBool(OS, vrational);
// cout << "Bezier Surface:"<< endl;
// cout << "\turational = "<<urational<<" vrational = " <<vrational<<endl;
// std::cout << "Bezier Surface:"<< std::endl;
// std::cout << "\turational = "<<urational<<" vrational = " <<vrational<<std::endl;
// poles and weights
Standard_Integer i,j,udegree,vdegree;
@@ -425,8 +425,8 @@ void BinTools_SurfaceSet::WriteSurface(const Handle(Geom_Surface)& S,
}
catch(Standard_Failure const& anException) {
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_SurfaceSet::WriteSurface(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_SurfaceSet::WriteSurface(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
}
@@ -617,12 +617,12 @@ static Standard_IStream& operator>>(Standard_IStream& IS,
static Standard_IStream& operator>>(Standard_IStream& IS,
Handle(Geom_BezierSurface)& S)
{
// cout << "BezierSurface:" <<endl;
// std::cout << "BezierSurface:" <<std::endl;
Standard_Boolean urational=Standard_False, vrational=Standard_False;
BinTools::GetBool(IS, urational);
BinTools::GetBool(IS, vrational);
// cout << "\turational = " << urational << " vrational = " << vrational<<endl;
// std::cout << "\turational = " << urational << " vrational = " << vrational<<std::endl;
Standard_Integer udegree=0, vdegree=0;
Standard_ExtCharacter aVal='\0';
BinTools::GetExtChar(IS, aVal);
@@ -630,7 +630,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS,
udegree = (Standard_Integer)aVal;
BinTools::GetExtChar(IS, aVal);
vdegree = (Standard_Integer)aVal;
// cout << "\ttudegree = " << udegree << ", vdegree = " << vdegree << endl;
// std::cout << "\ttudegree = " << udegree << ", vdegree = " << vdegree << std::endl;
TColgp_Array2OfPnt poles(1,udegree+1,1,vdegree+1);
TColStd_Array2OfReal weights(1,udegree+1,1,vdegree+1);
@@ -639,7 +639,7 @@ static Standard_IStream& operator>>(Standard_IStream& IS,
for (i = 1; i <= udegree+1; i++) {
for (j = 1; j <= vdegree+1; j++) {
IS >> poles(i,j);//Pnt
// cout <<"Pole X = " <<poles(i,j).X()<< " Y = " <<poles(i,j).Y()<< " Z = " << poles(i,j).Z()<<endl;
// std::cout <<"Pole X = " <<poles(i,j).X()<< " Y = " <<poles(i,j).Y()<< " Z = " << poles(i,j).Z()<<std::endl;
if (urational || vrational)
BinTools::GetReal(IS, weights(i,j));
}
@@ -861,8 +861,8 @@ Standard_IStream& BinTools_SurfaceSet::ReadSurface(Standard_IStream& IS,
catch(Standard_Failure const& anException) {
S = NULL;
Standard_SStream aMsg;
aMsg << "EXCEPTION in BinTools_SurfaceSet::ReadSurface(..)" << endl;
aMsg << anException << endl;
aMsg << "EXCEPTION in BinTools_SurfaceSet::ReadSurface(..)" << std::endl;
aMsg << anException << std::endl;
throw Standard_Failure(aMsg.str().c_str());
}
return IS;
@@ -879,9 +879,9 @@ void BinTools_SurfaceSet::Read(Standard_IStream& IS)
IS >> buffer;
if (IS.fail() || strcmp(buffer,"Surfaces")) {
Standard_SStream aMsg;
aMsg << "BinTools_SurfaceSet::Read: Not a surface table"<<endl;
aMsg << "BinTools_SurfaceSet::Read: Not a surface table"<<std::endl;
#ifdef OCCT_DEBUG
cout <<"SurfaceSet buffer: " << buffer << endl;
std::cout <<"SurfaceSet buffer: " << buffer << std::endl;
#endif
throw Standard_Failure(aMsg.str().c_str());
return;