Panda3D
|
This is the bare functionality (intended to be inherited from along with ProgramBase or some derivative) for a program that might generate an output file. More...
#include "withOutputFile.h"
Public Member Functions | |
WithOutputFile (bool allow_last_param, bool allow_stdout, bool binary_output) | |
void | close_output () |
Closes the output stream previously opened by get_output(). | |
std::ostream & | get_output () |
Returns an output stream that corresponds to the user's intended egg file output–either stdout, or the named output file. | |
Filename | get_output_filename () const |
If has_output_filename() returns true, this is the filename that the user specified. | |
bool | has_output_filename () const |
Returns true if the user specified an output filename, false otherwise (e.g. | |
This is the bare functionality (intended to be inherited from along with ProgramBase or some derivative) for a program that might generate an output file.
This provides the has_output_filename() and get_output_filename() methods.
Definition at line 29 of file withOutputFile.h.
WithOutputFile::WithOutputFile | ( | bool | allow_last_param, |
bool | allow_stdout, | ||
bool | binary_output ) |
Definition at line 23 of file withOutputFile.cxx.
|
virtual |
Definition at line 37 of file withOutputFile.cxx.
void WithOutputFile::close_output | ( | ) |
Closes the output stream previously opened by get_output().
A subsequent call to get_output() will open a new stream.
Definition at line 105 of file withOutputFile.cxx.
std::ostream & WithOutputFile::get_output | ( | ) |
Returns an output stream that corresponds to the user's intended egg file output–either stdout, or the named output file.
Definition at line 49 of file withOutputFile.cxx.
References Filename::get_extension(), Filename::make_dir(), Filename::open_write(), Filename::set_binary(), and Filename::set_text().
Referenced by DXFPoints::done_entity(), and EggWriter::write_egg_file().
Filename WithOutputFile::get_output_filename | ( | ) | const |
If has_output_filename() returns true, this is the filename that the user specified.
Otherwise, it returns the empty string.
Definition at line 130 of file withOutputFile.cxx.
Referenced by ImageWriter::write_image().
bool WithOutputFile::has_output_filename | ( | ) | const |
Returns true if the user specified an output filename, false otherwise (e.g.
the output file is implicitly stdout).
Definition at line 121 of file withOutputFile.cxx.