Panda3D
Public Member Functions | List of all members
WithOutputFile Class Reference

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"

Inheritance diagram for WithOutputFile:
BinToC DXFPoints EggWriter FltTrans ImageWriter PtsToBam VRMLTrans XFileTrans

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(). More...
 
ostream & get_output ()
 Returns an output stream that corresponds to the user's intended egg file output–either stdout, or the named output file. More...
 
Filename get_output_filename () const
 If has_output_filename() returns true, this is the filename that the user specified. More...
 
bool has_output_filename () const
 Returns true if the user specified an output filename, false otherwise (e.g. More...
 

Detailed Description

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 33 of file withOutputFile.h.

Member Function Documentation

◆ close_output()

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 117 of file withOutputFile.cxx.

References has_output_filename().

Referenced by get_output().

◆ get_output()

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 58 of file withOutputFile.cxx.

References close_output(), Filename::get_extension(), Filename::make_dir(), Filename::open_write(), Filename::set_binary(), and Filename::set_text().

Referenced by EggWriter::write_egg_file().

◆ get_output_filename()

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 148 of file withOutputFile.cxx.

References Filename::exists(), Filename::from_os_specific(), and Filename::get_extension().

Referenced by has_output_filename(), and ImageWriter::write_image().

◆ has_output_filename()

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 136 of file withOutputFile.cxx.

References get_output_filename().

Referenced by close_output().


The documentation for this class was generated from the following files: