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

@@ -125,28 +125,28 @@ static Interface_ReaderLib lib;
Standard_Integer nb = thenames.Length();
Standard_Integer lng = 0; Standard_Integer ln1;
S << " --- StepData_HeaderTool : List of Protocol Names --- Count : "
<< nb << endl;
<< nb << std::endl;
Standard_Integer i; // svv Jan11 2000 : porting on DEC
for (i = 1; i <= nb; i ++) {
ln1 = thenames.Value(i).Length() + 8; lng += ln1;
if (lng > 80) { S << endl; lng = ln1; }
if (lng > 80) { S << std::endl; lng = ln1; }
S << " " << i << " : " << thenames.Value(i);
}
if (lng == 0) S << endl;
if (lng == 0) S << std::endl;
nb = theignored.Length();
if (!thedone) {
S << " --- Evaluation of Protocol not Done ---" << endl;
S << " --- Evaluation of Protocol not Done ---" << std::endl;
} else if (nb == 0) {
S << " --- All Names correspond to a known Protocol ---" << endl;
S << " --- All Names correspond to a known Protocol ---" << std::endl;
} else {
lng = ln1 = 0;
S << " --- Among them, " << nb << " remain unrecognized ---" << endl;
S << " --- Among them, " << nb << " remain unrecognized ---" << std::endl;
for (i = 1; i <= nb; i ++) {
ln1 = theignored.Value(i).Length() + 3; lng += ln1;
if (lng > 80) { S << endl; lng = ln1; }
if (lng > 80) { S << std::endl; lng = ln1; }
S << " : " << theignored.Value(i);
}
if (lng == 0) S << endl;
if (lng == 0) S << std::endl;
}
}

View File

@@ -64,18 +64,18 @@ Standard_Boolean StepData_StepDumper::Dump
TColStd_SequenceOfAsciiString listypes;
if (!module->ComplexType(CN,listypes))
S << "(Complex Type : ask level > 0) cdl = "
<< ent->DynamicType()->Name() << " (...);" << endl;
<< ent->DynamicType()->Name() << " (...);" << Message_EndLine;
else {
Standard_Integer n = listypes.Length();
for (i = 1; i <= n; i ++) S << listypes.Value(i) << " (...)";
S << endl;
S << Message_EndLine;
}
}
else S << module->StepType(CN) << " (...);" << endl;
else S << module->StepType(CN) << " (...);" << Message_EndLine;
}
else S << "(Unrecognized Type for protocol) cdl = "
<< ent->DynamicType()->Name() << " (...);" << endl;
if (nlab > 0) S << "/* Ident in file for "<<num<<" : #"<<nlab<<" */"<<endl;
<< ent->DynamicType()->Name() << " (...);" << Message_EndLine;
if (nlab > 0) S << "/* Ident in file for "<<num<<" : #"<<nlab<<" */"<<Message_EndLine;
}
else if (level == 1) {
@@ -98,7 +98,7 @@ Standard_Boolean StepData_StepDumper::Dump
}
else {
Handle(Standard_Transient) anent;
// S << " -- Dumping Entity n0 " << num << " --" << endl;
// S << " -- Dumping Entity n0 " << num << " --" << std::endl;
// ... Envoi ...
TColStd_Array1OfInteger tab(0,nb); tab.Init(0);
tab.SetValue(num,1);
@@ -146,39 +146,39 @@ Standard_Boolean StepData_StepDumper::Dump
S<<" (no ident): ";
for (i = 1; i <= nb; i ++)
{ if (ids.Value(i) >= 0) continue; S<<" #"<<i; }
S<<endl;
S<<Message_EndLine;
}
if (nbq > 0) {
S<<" (ident = num): ";
for (i = 1; i <= nb; i ++) { if (ids.Value(i) == i) S<<" #"<<i; }
S<<endl;
S<<Message_EndLine;
}
if (nbi < 0) { // on n affiche plus num:#id , on envoie un petit help
Standard_Integer nbl = 0, nbr = 0, nbr0 = 0, nbc = 0;
char unid[30];
// S<<" (proper ident): #num #ident"<<endl;
S<<" (proper ident): num:#ident num:#ident ..."<<endl;
// S<<" (proper ident): #num #ident"<<std::endl;
S<<" (proper ident): num:#ident num:#ident ..."<<Message_EndLine;
for (i = 1; i <= nb; i ++) {
if (ids.Value(i) <= 0 || ids.Value(i) == i) continue;
sprintf (unid,"%d:#%d",i,ids.Value(i));
nbc = (Standard_Integer) strlen (unid); nbr = ((80-nbc) %4) +2;
nbl += nbc;
if (nbl+nbr0 > 79) { nbl = nbc; S<<endl; }
if (nbl+nbr0 > 79) { nbl = nbc; S<<Message_EndLine; }
else { nbl += nbr0; for (; nbr0 > 0; nbr0 --) S << " "; }
S<<unid;
nbr0 = nbr;
// if (nbl+nbc > 79) { S<<endl<<unid; nbl = 0; }
// if (nbl+nbc > 79) { S<<std::endl<<unid; nbl = 0; }
// else { S<<unid; }
// nbl += (nbc+nbr);
// nbr = ((80-nbc) % 4) +1;
// S<<" "<<i<<" ->#"<<ids.Value(i);
// nbl ++; if (nbl > 5) { nbl = nbr = 0; S<<endl; }
// nbl ++; if (nbl > 5) { nbl = nbr = 0; S<<std::endl; }
}
if (nbl > 0) S<<endl;
if (nbl > 0) S<<Message_EndLine;
}
if (nbi > 0) S<<"In dump, iii:#jjj means : entity rank iii has step ident #jjj"<<endl;
// S <<" -- Dumping data, entity "<<num<<" level "<<level<<" :"<<endl;
if (nbi > 0) S<<"In dump, iii:#jjj means : entity rank iii has step ident #jjj"<<Message_EndLine;
// S <<" -- Dumping data, entity "<<num<<" level "<<level<<" :"<<std::endl;
}
if (level > 0)
{

View File

@@ -119,9 +119,9 @@ void StepData_StepModel::DumpHeader
S << " " << iter.Value()->DynamicType()->Name() << "\n";
}
if (!iapro || nb == 0) return;
S << " -- -- STEP MODEL HEADER CONTENT -- --" << endl;
S << " -- -- STEP MODEL HEADER CONTENT -- --" << Message_EndLine;
S << " -- Dumped with Protocol : " << stepro->DynamicType()->Name()
<< " --"<<endl;
<< " --"<<Message_EndLine;
Standard_SStream aSStream;
Handle(StepData_StepModel) me (this);

View File

@@ -192,7 +192,7 @@ void StepData_StepReaderData::SetRecord(const Standard_Integer num,
sout << " *** Error on Record " << num << " (on " << NbRecords()
<< " -> " << num * 100 / NbRecords() << " % in File) ***";
if (prev > 0) sout << " Ident #" << theidents(prev);
sout << "\n" << errm << endl;
sout << "\n" << errm << Message_EndLine;
#endif
thecheck->AddWarning(errm.ToCString(), "Complex Type incorrect : ");
}
@@ -1563,7 +1563,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
if (letype == Interface_ParamSub) {
Standard_Integer numsub = FP.EntityNumber();
if (numsub > thelastn) {
sout << "Bad Sub.N0, Record " << num << " Param " << na << ":$" << numsub << endl;
sout << "Bad Sub.N0, Record " << num << " Param " << na << ":$" << numsub << Message_EndLine;
continue;
}
FP.SetEntityNumber(subn(numsub));
@@ -1586,7 +1586,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
// ... Et sortir message un peu plus complet
sout << "*** ERR StepReaderData *** Pour Entite #" << ident
<< "\n Type:" << RecordType(num)
<< " Param.n0 " << na << ": #" << id << " Non trouve" << endl;
<< " Param.n0 " << na << ": #" << id << " Non trouve" << Message_EndLine;
} // FIN Mapping
} // FIN Traitement Reference
} // FIN Boucle Parametres
@@ -1653,7 +1653,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
char ligne[80];
sprintf(ligne, "Ident defined SEVERAL TIMES : #%d", ident);
thecheck->AddFail(ligne, "Ident defined SEVERAL TIMES : #%d");
sout << "StepReaderData:SetEntityNumbers, " << ligne << endl;
sout << "StepReaderData:SetEntityNumbers, " << ligne << Message_EndLine;
}
if (indm(indmap) > 0) indm(indmap) = -indm(indmap); // Pas pour Map
// Cas Normal pour la Map
@@ -1846,7 +1846,7 @@ void StepData_StepReaderData::SetEntityNumbers(const Standard_Boolean withmap)
sout << "*** ERR StepReaderData *** Pour Entite " << nument
<< ", a " << (nr * 100) / nbseq << "% de DATA : #" << ident
<< "\n Type:" << RecordType(num)
<< " Param.n0 " << na << ": #" << id << " Non trouve" << endl;
<< " Param.n0 " << na << ": #" << id << " Non trouve" << Message_EndLine;
FP.SetEntityNumber(0); // -> Reference non resolue
}
}

View File

@@ -184,7 +184,7 @@ void StepData_StepReaderTool::BeginRead
Handle(Interface_Check) mch = model->GlobalCheck();
Standard_Integer nbmess = ach->NbWarnings();
sout<<nbmess<<" Warnings on Reading Header Entity N0."<<i<<":";
if (!ent.IsNull()) sout << ent->DynamicType()->Name() << endl;
if (!ent.IsNull()) sout << ent->DynamicType()->Name() << Message_EndLine;
for (Standard_Integer nf = 1; nf <= nbmess; nf ++)
sout << ach->CWarning(nf) << "\n";
}
@@ -192,7 +192,7 @@ void StepData_StepReaderTool::BeginRead
Handle(Interface_Check) mch = model->GlobalCheck();
Standard_Integer nbmess = ach->NbFails();
sout << " Errors on Reading Header Entity N0."<<i<<":";
if (!ent.IsNull()) sout << ent->DynamicType()->Name() << endl;
if (!ent.IsNull()) sout << ent->DynamicType()->Name() << Message_EndLine;
for (Standard_Integer nf = 1; nf <= nbmess; nf ++)
sout << ach->CFail(nf) << "\n";
}

View File

@@ -127,8 +127,8 @@ void StepData_StepWriter::SetScope (const Standard_Integer numscope,
}
else if (thescopenext->Value(numin) != 0) {
#ifdef OCCT_DEBUG
cout << "StepWriter : SetScope (scope : " << numscope << " entity : "
<< numin << "), Entity already in a Scope"<<endl;
std::cout << "StepWriter : SetScope (scope : " << numscope << " entity : "
<< numin << "), Entity already in a Scope"<<std::endl;
#endif
throw Interface_InterfaceMismatch("StepWriter : SetScope, already set");
}
@@ -1153,7 +1153,7 @@ Standard_Boolean StepData_StepWriter::Print (Standard_OStream& S)
for (Standard_Integer i = 1; i <= nb && isGood; i ++)
S << thefile->Value(i)->ToCString() << "\n";
S<< flush;
S<< std::flush;
isGood = (S && S.good());
return isGood;