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

@@ -73,7 +73,7 @@ Standard_Boolean DDocStd::GetDocument (Standard_CString& Name,
{
Handle(DDocStd_DrawDocument) DD = Handle(DDocStd_DrawDocument)::DownCast (Draw::GetExisting (Name));
if (DD.IsNull()) {
if (Complain) cout << Name << " is not a Document" << endl;
if (Complain) std::cout << Name << " is not a Document" << std::endl;
return Standard_False;
}
Handle(TDocStd_Document) STDDOC = DD->GetDocument();
@@ -81,7 +81,7 @@ Standard_Boolean DDocStd::GetDocument (Standard_CString& Name,
DOC = STDDOC;
return Standard_True;
}
if (Complain) cout << Name << " is not a CAF Document" << endl;
if (Complain) std::cout << Name << " is not a CAF Document" << std::endl;
return Standard_False;
}
@@ -98,7 +98,7 @@ Standard_Boolean DDocStd::Find (const Handle(TDocStd_Document)& D,
{
Label.Nullify();
TDF_Tool::Label(D->GetData(),Entry,Label,Standard_False);
if (Label.IsNull() && Complain) cout<<"No label for entry "<<Entry<<endl;
if (Label.IsNull() && Complain) std::cout<<"No label for entry "<<Entry<<std::endl;
return !Label.IsNull();
}
@@ -116,7 +116,7 @@ Standard_Boolean DDocStd::Find (const Handle(TDocStd_Document)& D,
TDF_Label L;
if (Find(D,Entry,L,Complain)) {
if (L.FindAttribute(ID,A)) return Standard_True;
if (Complain) cout <<"attribute not found for entry : "<< Entry <<endl;
if (Complain) std::cout <<"attribute not found for entry : "<< Entry <<std::endl;
}
return Standard_False;
}

View File

@@ -66,8 +66,8 @@ static Standard_Integer DDocStd_ListDocuments (Draw_Interpretor& di,
if (D->IsSaved()) {
TCollection_AsciiString GetNameAsciiString(D->GetName().ToExtString(),'?');
TCollection_AsciiString GetPathAsciiString(D->GetPath().ToExtString(),'?');
//cout << " name : " << D->GetName();
//cout << " path : " << D->GetPath();
//std::cout << " name : " << D->GetName();
//std::cout << " path : " << D->GetPath();
di << " name : " << GetNameAsciiString.ToCString();
di << " path : " << GetPathAsciiString.ToCString();
}
@@ -411,10 +411,10 @@ static Standard_Integer DDocStd_Path (Draw_Interpretor& di,
{
if (nb == 2) {
TDocStd_PathParser path (a[1]);
//cout << "Trek : " << path.Trek() << endl;
//cout << "Name : " << path.Name() << endl;
//cout << "Extension : " << path.Extension() << endl;
//cout << "Path : " << path.Path() << endl;
//std::cout << "Trek : " << path.Trek() << std::endl;
//std::cout << "Name : " << path.Name() << std::endl;
//std::cout << "Extension : " << path.Extension() << std::endl;
//std::cout << "Path : " << path.Path() << std::endl;
TCollection_AsciiString TrekAsciiString(path.Trek().ToExtString(),'?');
TCollection_AsciiString NameAsciiString(path.Name().ToExtString(),'?');
TCollection_AsciiString ExtensionAsciiString(path.Extension().ToExtString(),'?');
@@ -467,7 +467,7 @@ static Standard_Integer DDocStd_PrintComments (Draw_Interpretor& di,
for (int i = 1; i <= comments.Length(); i++)
{
//cout << comments(i) << endl;
//std::cout << comments(i) << std::endl;
TCollection_AsciiString commentAsciiString(comments(i).ToExtString(),'?');
di << commentAsciiString.ToCString() << "\n";
}

View File

@@ -79,7 +79,7 @@ static Standard_Integer DDocStd_Format (Draw_Interpretor& di,Standard_Integer n,
Handle(TDocStd_Document) D;
if (n == 2) {
if (!DDocStd::GetDocument(a[1],D)) return 1;
//cout << "FORMAT : " << D->StorageFormat() << endl;
//std::cout << "FORMAT : " << D->StorageFormat() << std::endl;
di << "FORMAT : ";
Standard_SStream aStream;
D->StorageFormat().Print(aStream);
@@ -316,7 +316,7 @@ static Standard_Integer DDocStd_DumpDocument (Draw_Interpretor& di,
di << "DOCUMENT : not saved";
di << "\n";
// format
//cout << "FORMAT : " << D->StorageFormat();
//std::cout << "FORMAT : " << D->StorageFormat();
di << "FORMAT : ";
Standard_SStream aStream;
D->StorageFormat().Print(aStream);
@@ -332,11 +332,11 @@ static Standard_Integer DDocStd_DumpDocument (Draw_Interpretor& di,
di << " undos :" << D->GetAvailableUndos() << " ";
di << " redos :" << D->GetAvailableRedos();
di << "\n";
// cout << "CURRENT :";
// std::cout << "CURRENT :";
// TCollection_AsciiString string;
// TDF_Tool::Entry(D->CurrentLabel(),string);
// cout << string;
// cout << endl;
// std::cout << string;
// std::cout << std::endl;
// modified
di << "MODIFIED : ";
if (D->IsModified()) di << "true";
@@ -392,12 +392,12 @@ static Standard_Integer DDocStd_Propagate (Draw_Interpretor& di,Standard_Integer
// Handle(TDocStd_Document) D;
// if (!DDocStd::GetDocument(a[1],D)) return 1;
// if (D->IsValid()) {
// cout << "the document is valid" << endl;
// std::cout << "the document is valid" << std::endl;
// return 0;
// }
// Handle(TDesign_Function) F;
// if (!D->Main().FindAttribute(TDesign_Function::GetID(),F)) {
// cout << "no function found at main" << endl;
// std::cout << "no function found at main" << std::endl;
// return 0;
// }
// TFunction_Logbook mdf (Standard_True);

View File

@@ -89,7 +89,7 @@ void DDocStd_DrawDocument::Dump (Standard_OStream& S) const
DDF_Data::Dump(S);
}
else {
S << myDocument->DynamicType()->Name() << " is not a CAF document" << endl;
S << myDocument->DynamicType()->Name() << " is not a CAF document" << std::endl;
}
}

View File

@@ -142,7 +142,7 @@ static int mtmDump (Draw_Interpretor& di, int /*n*/, const char** /*a*/)
return 1;
}
di << "*** Dump of MTM ***\n";
//sMultiTransactionManager->DumpTransaction(cout);
//sMultiTransactionManager->DumpTransaction(std::cout);
Standard_SStream aStream;
sMultiTransactionManager->DumpTransaction(aStream);
di << aStream;