Panda3D
|
This is the base class for a program that generates an egg file output, but doesn't read any for input. More...
#include "eggWriter.h"
Public Member Functions | |
EggWriter (bool allow_last_param=false, bool allow_stdout=true) | |
Egg-writing type programs may specify their output file using either the last-filename convention, the. | |
virtual EggWriter * | as_writer () |
Returns this object as an EggWriter pointer, if it is in fact an EggWriter, or NULL if it is not. | |
virtual void | post_process_egg_file () |
Performs any processing of the egg file that is appropriate before writing it out. | |
void | write_egg_file () |
Writes out the egg file as the normal result of the program. | |
Protected Member Functions | |
virtual bool | handle_args (Args &args) |
Does something with the additional arguments on the command line (after all the -options have been parsed). | |
virtual bool | post_command_line () |
This is called after the command line has been completely processed, and it gives the program a chance to do some last-minute processing and validation of the options and arguments. |
This is the base class for a program that generates an egg file output, but doesn't read any for input.
Definition at line 30 of file eggWriter.h.
EggWriter::EggWriter | ( | bool | allow_last_param = false , |
bool | allow_stdout = true |
||
) |
Egg-writing type programs may specify their output file using either the last-filename convention, the.
-o convention, and/or implicitly writing the result to standard output. Not all interfaces are appropriate for all applications; some may be confusing or dangerous.
The calling application should pass allow_last_param true to allow the user to specify the output filename as the last parameter on the command line (the most dangerous, but convenient, method), and allow_stdout true to allow the user to omit the output filename altogether and have the output implicitly go to standard output (not terribly dangerous, but inappropriate when writing binary file formats).
Definition at line 41 of file eggWriter.cxx.
References ProgramBase::add_option(), ProgramBase::add_runline(), ProgramBase::clear_runlines(), ProgramBase::dispatch_filename(), and ProgramBase::redescribe_option().
EggWriter * EggWriter::as_writer | ( | ) | [virtual] |
Returns this object as an EggWriter pointer, if it is in fact an EggWriter, or NULL if it is not.
This is intended to work around the C++ limitation that prevents downcasts past virtual inheritance. Since both EggReader and EggWriter inherit virtually from EggSingleBase, we need functions like this to downcast to the appropriate pointer.
Reimplemented from EggSingleBase.
Definition at line 108 of file eggWriter.cxx.
bool EggWriter::handle_args | ( | ProgramBase::Args & | args | ) | [protected, virtual] |
Does something with the additional arguments on the command line (after all the -options have been parsed).
Returns true if the arguments are good, false otherwise.
Reimplemented from ProgramBase.
Reimplemented in EggMakeFont, SomethingToEgg, EggToBam, EggToSomething, EggTextureCards, EggQtess, and EggFilter.
Definition at line 207 of file eggWriter.cxx.
References WithOutputFile::check_last_arg(), and Filename::get_dirname().
bool EggWriter::post_command_line | ( | ) | [protected, virtual] |
This is called after the command line has been completely processed, and it gives the program a chance to do some last-minute processing and validation of the options and arguments.
It should return true if everything is fine, false if there is an error.
Reimplemented from EggSingleBase.
Reimplemented in SomethingToEgg, EggFilter, and EggCrop.
Definition at line 236 of file eggWriter.cxx.
References EggBase::append_command_comment().
void EggWriter::post_process_egg_file | ( | ) | [virtual] |
Performs any processing of the egg file that is appropriate before writing it out.
This includes any normal adjustments the user requested via -np, etc.
Normally, you should not need to call this function directly; write_egg_file() calls it for you. You should call this only if you do not use write_egg_file() to write out the resulting egg file.
Reimplemented in SomethingToEgg.
Definition at line 125 of file eggWriter.cxx.
Referenced by write_egg_file().
void EggWriter::write_egg_file | ( | ) |
Writes out the egg file as the normal result of the program.
This calls post_process_egg_file() to perform any last minute processing (like normal computation) and then writes out the file to the output stream returned by get_output().
Definition at line 193 of file eggWriter.cxx.
References WithOutputFile::get_output(), and post_process_egg_file().