From 867c3a763e3183ef2c2f32e6c930ea49ae34a5f1 Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 11 Jan 2006 19:06:54 -0500 Subject: ENH: Add support for binary --- Source/cmGeneratedFileStream.cxx | 4 ++-- Source/cmGeneratedFileStream.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index c48620e..2a9b228 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -62,13 +62,13 @@ cmGeneratedFileStream::~cmGeneratedFileStream() //---------------------------------------------------------------------------- cmGeneratedFileStream& -cmGeneratedFileStream::Open(const char* name, bool quiet) +cmGeneratedFileStream::Open(const char* name, bool quiet, bool binary) { // Store the file name and construct the temporary file name. this->cmGeneratedFileStreamBase::Open(name); // Open the temporary output file. - this->Stream::open(m_TempName.c_str()); + this->Stream::open(m_TempName.c_str(), std::ios::out | (binary ? std::ios::binary : 0)); // Check if the file opened. if(!*this && !quiet) diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index 6d0637c..4783cb6 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -114,7 +114,7 @@ public: * temporary file. If the file cannot be opened an error message is * produced unless the second argument is set to true. */ - cmGeneratedFileStream& Open(const char* name, bool quiet=false); + cmGeneratedFileStream& Open(const char* name, bool quiet=false, bool binary=false); /** * Close the output file. This should be used only with an open -- cgit v0.12