mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-22 06:09:14 -05:00
Source: silence false positives for cmsys::fstream check
This commit is contained in:
@@ -27,7 +27,7 @@ cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
|
|||||||
cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
|
cmGeneratedFileStream::cmGeneratedFileStream(std::string const& name,
|
||||||
bool quiet, Encoding encoding)
|
bool quiet, Encoding encoding)
|
||||||
: cmGeneratedFileStreamBase(name)
|
: cmGeneratedFileStreamBase(name)
|
||||||
, Stream(this->TempName.c_str())
|
, Stream(this->TempName.c_str()) // NOLINT(cmake-use-cmsys-fstream)
|
||||||
{
|
{
|
||||||
// Check if the file opened.
|
// Check if the file opened.
|
||||||
if (!*this && !quiet) {
|
if (!*this && !quiet) {
|
||||||
@@ -67,10 +67,11 @@ cmGeneratedFileStream& cmGeneratedFileStream::Open(std::string const& name,
|
|||||||
|
|
||||||
// Open the temporary output file.
|
// Open the temporary output file.
|
||||||
if (binaryFlag) {
|
if (binaryFlag) {
|
||||||
this->Stream::open(this->TempName.c_str(),
|
this->Stream::open( // NOLINT(cmake-use-cmsys-fstream)
|
||||||
std::ios::out | std::ios::binary);
|
this->TempName.c_str(), std::ios::out | std::ios::binary);
|
||||||
} else {
|
} else {
|
||||||
this->Stream::open(this->TempName.c_str());
|
this->Stream::open( // NOLINT(cmake-use-cmsys-fstream)
|
||||||
|
this->TempName.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the file opened.
|
// Check if the file opened.
|
||||||
@@ -87,7 +88,7 @@ bool cmGeneratedFileStream::Close()
|
|||||||
this->Okay = !this->fail();
|
this->Okay = !this->fail();
|
||||||
|
|
||||||
// Close the temporary output file.
|
// Close the temporary output file.
|
||||||
this->Stream::close();
|
this->Stream::close(); // NOLINT(cmake-use-cmsys-fstream)
|
||||||
|
|
||||||
// Remove the temporary file (possibly by renaming to the real file).
|
// Remove the temporary file (possibly by renaming to the real file).
|
||||||
return this->cmGeneratedFileStreamBase::Close();
|
return this->cmGeneratedFileStreamBase::Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user