cmGeneratedFileStream: Drop unused WriteRaw method

It has been superseded by `WriteAltEncoding`.
This commit is contained in:
Brad King
2022-10-28 20:22:46 -04:00
parent 2e5af30ce0
commit a0d4e3bf34
2 changed files with 1 additions and 23 deletions

View File

@@ -14,11 +14,10 @@
#endif
cmGeneratedFileStream::cmGeneratedFileStream(Encoding encoding)
: OriginalLocale(this->getloc())
{
#ifndef CMAKE_BOOTSTRAP
if (encoding != codecvt::None) {
this->imbue(std::locale(this->OriginalLocale, new codecvt(encoding)));
this->imbue(std::locale(this->getloc(), new codecvt(encoding)));
}
#else
static_cast<void>(encoding);
@@ -252,14 +251,3 @@ void cmGeneratedFileStream::WriteAltEncoding(std::string const& data,
this->write(data.data(), data.size());
#endif
}
void cmGeneratedFileStream::WriteRaw(std::string const& data)
{
#ifndef CMAKE_BOOTSTRAP
std::locale activeLocale = this->imbue(this->OriginalLocale);
this->write(data.data(), data.size());
this->imbue(activeLocale);
#else
this->write(data.data(), data.size());
#endif
}

View File

@@ -152,14 +152,4 @@ public:
* Afterward, the original encoding is restored.
*/
void WriteAltEncoding(std::string const& data, Encoding encoding);
/**
* Writes the given string directly to the file without changing the
* encoding.
*/
void WriteRaw(std::string const& data);
private:
// The original locale of the stream (performs no encoding conversion).
std::locale OriginalLocale;
};