BUG: Rearranged cable config file open to do open in construction of m_OutputFile. Fixes problem on SGI with opening the file.

This commit is contained in:
Brad King 2001-03-16 11:04:35 -05:00
parent df8a7ecafd
commit 2d26d0be68
2 changed files with 15 additions and 10 deletions

View File

@ -28,9 +28,11 @@ cmCableData::cmCableData(const cmCableCommand* owner,
m_Indentation(0), m_Indentation(0),
m_Package(NULL), m_Package(NULL),
m_PackageNamespaceDepth(0), m_PackageNamespaceDepth(0),
m_PackageClassIndex(-1) m_PackageClassIndex(-1),
m_OutputFileName(configurationFile),
m_OutputFile(m_OutputFileName.c_str())
{ {
this->OpenOutputFile(configurationFile); this->InitializeOutputFile();
} }
@ -48,20 +50,18 @@ cmCableData::~cmCableData()
/** /**
* Open the configuration output file with the given name. This * Write the configuration header to the output file.
* writes the configuration header.
*/ */
void cmCableData::OpenOutputFile(const std::string& name) void cmCableData::InitializeOutputFile()
{ {
m_OutputFile.open(name.c_str());
if(m_OutputFile) if(m_OutputFile)
{ {
this->WriteConfigurationHeader(); this->WriteConfigurationHeader();
} }
else else
{ {
cmSystemTools::Error("Unable to open CABLE config file: ", name.c_str()); cmSystemTools::Error("Unable to open CABLE config file: ",
m_OutputFileName.c_str());
} }
} }

View File

@ -41,7 +41,7 @@ public:
std::ostream& GetOutputStream() std::ostream& GetOutputStream()
{ return m_OutputFile; } { return m_OutputFile; }
void OpenOutputFile(const std::string&); void InitializeOutputFile();
void CloseOutputFile(); void CloseOutputFile();
void WriteConfigurationHeader(); void WriteConfigurationHeader();
@ -85,6 +85,11 @@ private:
*/ */
Indentation m_Indentation; Indentation m_Indentation;
/**
* The name of the output file opened as m_OutputFile.
*/
std::string m_OutputFileName;
/** /**
* The output file to which the configuration is written. * The output file to which the configuration is written.
*/ */