Skip to content
Snippets Groups Projects
Commit b7ba65ed authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

ENH: Add a way to overwrite compression extension

parent f379128f
No related branches found
No related tags found
No related merge requests found
......@@ -107,13 +107,20 @@ void cmGeneratedFileStream::SetCompression(bool compression)
m_Compress = 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";
}
......
......@@ -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
......@@ -131,6 +134,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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment