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

@@ -76,29 +76,29 @@ Storage_Error FSD_CmpFile::Open(const TCollection_AsciiString& aName, const Stor
}
case Storage_VSRead:
{
// ios::nocreate is not portable
// std::ios::nocreate is not portable
#if !defined(IRIX) && !defined(DECOSF1)
anOpenMode = ios::in | ios::binary;
anOpenMode = std::ios::in | std::ios::binary;
#else
anOpenMode = ios::in;
anOpenMode = std::ios::in;
#endif
break;
}
case Storage_VSWrite:
{
#if !defined(IRIX) && !defined(DECOSF1)
anOpenMode = ios::out | ios::binary;
anOpenMode = std::ios::out | std::ios::binary;
#else
anOpenMode = ios::out;
anOpenMode = std::ios::out;
#endif
break;
}
case Storage_VSReadWrite:
{
#if !defined(IRIX) && !defined(DECOSF1)
anOpenMode = ios::in | ios::out | ios::binary;
anOpenMode = std::ios::in | std::ios::out | std::ios::binary;
#else
anOpenMode = ios::in | ios::out;
anOpenMode = std::ios::in | std::ios::out;
#endif
break;
}
@@ -348,7 +348,7 @@ void FSD_CmpFile::ReadPersistentObjectHeader(Standard_Integer& aRef,
}
if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
// std::cout << "REF:" << aRef << " TYPE:"<< aType << std::endl;
}
//=======================================================================
@@ -358,7 +358,7 @@ void FSD_CmpFile::ReadPersistentObjectHeader(Standard_Integer& aRef,
void FSD_CmpFile::BeginReadPersistentObjectData()
{
//cout << "BeginReadPersistentObjectData" << endl;
//std::cout << "BeginReadPersistentObjectData" << std::endl;
}
//=======================================================================
@@ -368,7 +368,7 @@ void FSD_CmpFile::BeginReadPersistentObjectData()
void FSD_CmpFile::BeginReadObjectData()
{
// cout << "BeginReadObjectData" << endl;
// std::cout << "BeginReadObjectData" << std::endl;
}
//=======================================================================
@@ -378,7 +378,7 @@ void FSD_CmpFile::BeginReadObjectData()
void FSD_CmpFile::EndReadObjectData()
{
// cout << "EndReadObjectData" << endl;
// std::cout << "EndReadObjectData" << std::endl;
}
//=======================================================================
@@ -400,5 +400,5 @@ void FSD_CmpFile::EndReadPersistentObjectData()
if (c == '\r') {
myStream.get(c);
}
// cout << "EndReadPersistentObjectData" << endl;
// std::cout << "EndReadPersistentObjectData" << std::endl;
}

View File

@@ -18,6 +18,6 @@
#include <stdio.h>
#include <Standard_Stream.hxx>
typedef fstream FSD_FStream;
typedef std::fstream FSD_FStream;
#endif

View File

@@ -91,18 +91,18 @@ Storage_Error FSD_File::Open(const TCollection_AsciiString& aName,const Storage_
}
case Storage_VSRead:
{
// ios::nocreate is not portable
anOpenMode = ios::in;
// std::ios::nocreate is not portable
anOpenMode = std::ios::in;
break;
}
case Storage_VSWrite:
{
anOpenMode = ios::out;
anOpenMode = std::ios::out;
break;
}
case Storage_VSReadWrite:
{
anOpenMode = ios::in | ios::out;
anOpenMode = std::ios::in | std::ios::out;
break;
}
}
@@ -511,10 +511,10 @@ Storage_BaseDriver& FSD_File::GetCharacter(Standard_Character& aValue)
unsigned short i = 0;
if (!(myStream >> i)) {
// SGI : donne une erreur mais a une bonne valeur pour les caracteres ecrits
// signes (-80 fait ios::badbit, mais la variable i est initialisee)
// signes (-80 fait std::ios::badbit, mais la variable i est initialisee)
//
if (i == 0) throw Storage_StreamTypeMismatchError();
myStream.clear(ios::goodbit); // .clear(0) is not portable
myStream.clear(std::ios::goodbit); // .clear(0) is not portable
}
aValue = (char)i;
@@ -1267,7 +1267,7 @@ void FSD_File::ReadPersistentObjectHeader(Standard_Integer& aRef,
}
if (!(myStream >> aType)) throw Storage_StreamTypeMismatchError();
// cout << "REF:" << aRef << " TYPE:"<< aType << endl;
// std::cout << "REF:" << aRef << " TYPE:"<< aType << std::endl;
}
//=======================================================================
@@ -1286,7 +1286,7 @@ void FSD_File::BeginReadPersistentObjectData()
myStream.get(c);
}
//cout << "BeginReadPersistentObjectData" << endl;
//std::cout << "BeginReadPersistentObjectData" << std::endl;
}
//=======================================================================
@@ -1305,7 +1305,7 @@ void FSD_File::BeginReadObjectData()
myStream.get(c);
}
// cout << "BeginReadObjectData" << endl;
// std::cout << "BeginReadObjectData" << std::endl;
}
//=======================================================================
@@ -1324,7 +1324,7 @@ void FSD_File::EndReadObjectData()
myStream.get(c);
}
// cout << "EndReadObjectData" << endl;
// std::cout << "EndReadObjectData" << std::endl;
}
//=======================================================================
@@ -1351,7 +1351,7 @@ void FSD_File::EndReadPersistentObjectData()
}
myStream.get(c);
}
// cout << "EndReadPersistentObjectData" << endl;
// std::cout << "EndReadPersistentObjectData" << std::endl;
}
//=======================================================================