added close_output method

This commit is contained in:
Chris Brunner 2009-11-09 22:50:11 +00:00
parent 7da51c899f
commit 367cb1a1ff
2 changed files with 20 additions and 0 deletions

View File

@ -106,6 +106,25 @@ get_output() {
return *_output_ptr;
}
////////////////////////////////////////////////////////////////////
// Function: WithOutputFile::close_output
// Access: Public
// Description: Closes the output stream previously opened by
// get_output(). A subsequent call to get_output() will
// open a new stream.
////////////////////////////////////////////////////////////////////
void WithOutputFile::
close_output() {
if (_owns_output_ptr) {
delete _output_ptr;
_owns_output_ptr = false;
}
_output_ptr = NULL;
_output_stream.close();
}
////////////////////////////////////////////////////////////////////
// Function: WithOutputFile::has_output_filename
// Access: Public

View File

@ -37,6 +37,7 @@ public:
virtual ~WithOutputFile();
ostream &get_output();
void close_output();
bool has_output_filename() const;
Filename get_output_filename() const;