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:

## 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...
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. 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 29 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 105 of file withOutputFile.cxx.

## ◆ get_output()

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.

Referenced by DXFPoints::done_entity(), and 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 130 of file withOutputFile.cxx.

Referenced by 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 121 of file withOutputFile.cxx.

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

- pandatool/src/progbase/withOutputFile.h
- pandatool/src/progbase/withOutputFile.cxx
- pandatool/src/progbase/withOutputFile.I