diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-02 12:52:54 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2006-01-02 12:52:54 (GMT) |
commit | b7ba65ed684a663be0085ae96dca3768ebdd3325 (patch) | |
tree | ad4f4c9c3653f275e851cc838b77aa9b82ea2a9e /Source | |
parent | f379128fa3264c41594381e910f8d5c6b2afefea (diff) | |
download | CMake-b7ba65ed684a663be0085ae96dca3768ebdd3325.zip CMake-b7ba65ed684a663be0085ae96dca3768ebdd3325.tar.gz CMake-b7ba65ed684a663be0085ae96dca3768ebdd3325.tar.bz2 |
ENH: Add a way to overwrite compression extension
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGeneratedFileStream.cxx | 14 | ||||
-rw-r--r-- | Source/cmGeneratedFileStream.h | 8 |
2 files changed, 19 insertions, 3 deletions
diff --git a/Source/cmGeneratedFileStream.cxx b/Source/cmGeneratedFileStream.cxx index d0f2cc0..63a0384 100644 --- a/Source/cmGeneratedFileStream.cxx +++ b/Source/cmGeneratedFileStream.cxx @@ -108,12 +108,19 @@ void cmGeneratedFileStream::SetCompression(bool compression) } //---------------------------------------------------------------------------- +void cmGeneratedFileStream::SetCompressionExtraExtension(bool ext) +{ + m_CompressExtraExtension = ext; +} + +//---------------------------------------------------------------------------- cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(): m_Name(), m_TempName(), m_CopyIfDifferent(false), m_Okay(false), - m_Compress(false) + m_Compress(false), + m_CompressExtraExtension(true) { } @@ -123,7 +130,8 @@ cmGeneratedFileStreamBase::cmGeneratedFileStreamBase(const char* name): m_TempName(), m_CopyIfDifferent(false), m_Okay(false), - m_Compress(false) + m_Compress(false), + m_CompressExtraExtension(true) { this->Open(name); } @@ -155,7 +163,7 @@ void cmGeneratedFileStreamBase::Open(const char* name) void cmGeneratedFileStreamBase::Close() { std::string resname = m_Name; - if ( m_Compress ) + if ( m_CompressExtraExtension ) { resname += ".gz"; } diff --git a/Source/cmGeneratedFileStream.h b/Source/cmGeneratedFileStream.h index cb81d1d..6d0637c 100644 --- a/Source/cmGeneratedFileStream.h +++ b/Source/cmGeneratedFileStream.h @@ -66,6 +66,9 @@ protected: // Whether the destionation file is compressed bool m_Compress; + + // Whether the destionation file is compressed + bool m_CompressExtraExtension; }; /** \class cmGeneratedFileStream @@ -132,6 +135,11 @@ public: void SetCompression(bool compression); /** + * Set whether compression has extra extension + */ + void SetCompressionExtraExtension(bool ext); + + /** * Set name of the file that will hold the actual output. This method allows * the output file to be changed during the use of cmGeneratedFileStream. */ |