Browse Source

ENH: Add support for binary

Andy Cedilnik 20 năm trước cách đây
mục cha
commit
867c3a763e
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 2 2
      Source/cmGeneratedFileStream.cxx
  2. 1 1
      Source/cmGeneratedFileStream.h

+ 2 - 2
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)

+ 1 - 1
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