#include <programBase.h>
Inheritance diagram for ProgramBase:
Public Types | |
typedef pdeque< string > | Args |
Public Member Functions | |
ProgramBase () | |
virtual | ~ProgramBase () |
void | show_description () |
void | show_usage () |
void | show_options () |
INLINE void | show_text (const string &text) |
void | show_text (const string &prefix, int indent_width, string text) |
virtual void | parse_command_line (int argc, char *argv[]) |
string | get_exec_command () const |
Public Attributes | |
Filename | _program_name |
Args | _program_args |
Protected Types | |
typedef bool(* | OptionDispatchFunction )(const string &opt, const string &parm, void *data) |
typedef bool(* | OptionDispatchMethod )(ProgramBase *self, const string &opt, const string &parm, void *data) |
Protected Member Functions | |
virtual bool | handle_args (Args &args) |
virtual bool | post_command_line () |
void | set_program_description (const string &description) |
void | clear_runlines () |
void | add_runline (const string &runline) |
void | clear_options () |
void | add_option (const string &option, const string &parm_name, int index_group, const string &description, OptionDispatchFunction option_function, bool *bool_var=(bool *) NULL, void *option_data=(void *) NULL) |
void | add_option (const string &option, const string &parm_name, int index_group, const string &description, OptionDispatchMethod option_method, bool *bool_var=(bool *) NULL, void *option_data=(void *) NULL) |
bool | redescribe_option (const string &option, const string &description) |
bool | remove_option (const string &option) |
void | add_path_replace_options () |
void | add_path_store_options () |
PT (PathReplace) _path_replace | |
Static Protected Member Functions | |
bool | dispatch_none (const string &opt, const string &arg, void *) |
bool | dispatch_true (const string &opt, const string &arg, void *var) |
bool | dispatch_false (const string &opt, const string &arg, void *var) |
bool | dispatch_count (const string &opt, const string &arg, void *var) |
bool | dispatch_int (const string &opt, const string &arg, void *var) |
bool | dispatch_int_pair (const string &opt, const string &arg, void *var) |
bool | dispatch_double (const string &opt, const string &arg, void *var) |
bool | dispatch_double_pair (const string &opt, const string &arg, void *var) |
bool | dispatch_double_triple (const string &opt, const string &arg, void *var) |
bool | dispatch_double_quad (const string &opt, const string &arg, void *var) |
bool | dispatch_color (const string &opt, const string &arg, void *var) |
bool | dispatch_string (const string &opt, const string &arg, void *var) |
bool | dispatch_filename (const string &opt, const string &arg, void *var) |
bool | dispatch_search_path (const string &opt, const string &arg, void *var) |
bool | dispatch_coordinate_system (const string &opt, const string &arg, void *var) |
bool | dispatch_units (const string &opt, const string &arg, void *var) |
bool | dispatch_image_type (const string &opt, const string &arg, void *var) |
bool | dispatch_path_replace (const string &opt, const string &arg, void *var) |
bool | dispatch_path_store (const string &opt, const string &arg, void *var) |
bool | handle_help_option (const string &opt, const string &arg, void *) |
void | format_text (ostream &out, bool &last_newline, const string &prefix, int indent_width, const string &text, int line_width) |
Protected Attributes | |
bool | _got_path_store |
bool | _got_path_directory |
Private Types | |
typedef vector_string | Runlines |
typedef pmap< string, Option > | OptionsByName |
typedef pvector< const Option * > | OptionsByIndex |
typedef pmap< string, string > | GotOptions |
Private Member Functions | |
void | sort_options () |
void | get_terminal_width () |
Private Attributes | |
string | _description |
Runlines | _runlines |
OptionsByName | _options_by_name |
OptionsByIndex | _options_by_index |
int | _next_sequence |
bool | _sorted_options |
GotOptions | _got_options |
bool | _last_newline |
int | _terminal_width |
bool | _got_terminal_width |
int | _option_indent |
bool | _got_option_indent |
|
Definition at line 57 of file programBase.h. |
|
Definition at line 152 of file programBase.h. |
|
Definition at line 62 of file programBase.h. |
|
Definition at line 63 of file programBase.h. |
|
Definition at line 146 of file programBase.h. |
|
Definition at line 145 of file programBase.h. |
|
Definition at line 142 of file programBase.h. |
|
|
Definition at line 131 of file programBase.cxx. References NULL, Notify::ptr(), and Notify::set_ostream_ptr(). |
|
|
|
Definition at line 639 of file programBase.cxx. References add_option(), dispatch_path_replace(), dispatch_search_path(), and NULL. Referenced by BamToEgg::BamToEgg(), EggToBam::EggToBam(), EggTrans::EggTrans(), FltCopy::FltCopy(), FltToEgg::FltToEgg(), FltTrans::FltTrans(), LwoToEgg::LwoToEgg(), MayaCopy::MayaCopy(), and MayaToEgg::MayaToEgg(). |
|
Definition at line 680 of file programBase.cxx. References _got_path_directory, _got_path_store, add_option(), dispatch_filename(), dispatch_path_store(), and PS_relative. Referenced by BamToEgg::BamToEgg(), EggToBam::EggToBam(), EggTrans::EggTrans(), FltToEgg::FltToEgg(), FltTrans::FltTrans(), LwoToEgg::LwoToEgg(), and MayaToEgg::MayaToEgg(). |
|
|
Definition at line 498 of file programBase.cxx. References _options_by_name. |
|
|
Definition at line 951 of file programBase.cxx. References nout, string_to_float(), tokenize(), and vector_string. Referenced by EggMakeFont::EggMakeFont(), and EggTextureCards::EggTextureCards(). |
|
Definition at line 1049 of file programBase.cxx. References CoordinateSystem, CS_invalid, nout, and parse_coordinate_system_string(). Referenced by EggBase::EggBase(), and EggMultiBase::EggMultiBase(). |
|
Definition at line 772 of file programBase.cxx. Referenced by MayaToEgg::MayaToEgg(), and TestProgram::TestProgram(). |
|
Definition at line 837 of file programBase.cxx. References nout, and string_to_double(). Referenced by SomethingToEgg::add_animation_options(), EggReader::add_delod_options(), EggMakeFont::EggMakeFont(), FltTrans::FltTrans(), ImageResize::ImageResize(), and MayaToEgg::MayaToEgg(). |
|
Definition at line 857 of file programBase.cxx. References nout, string_to_double(), tokenize(), and vector_string. Referenced by EggTextureCards::EggTextureCards(). |
|
Definition at line 918 of file programBase.cxx. References nout, string_to_double(), tokenize(), and vector_string. Referenced by EggTextureCards::EggTextureCards(). |
|
Definition at line 887 of file programBase.cxx. References nout, string_to_double(), tokenize(), and vector_string. Referenced by EggCrop::EggCrop(). |
|
Definition at line 756 of file programBase.cxx. Referenced by EggTopstrip::EggTopstrip(). |
|
Definition at line 1005 of file programBase.cxx. References Filename::from_os_specific(), and nout. Referenced by add_path_store_options(), EggReader::add_texture_options(), CVSCopy::CVSCopy(), EggMakeFont::EggMakeFont(), EggMultiFilter::EggMultiFilter(), EggPalettize::EggPalettize(), EggTopstrip::EggTopstrip(), EggWriter::EggWriter(), FltTrans::FltTrans(), and ImageWriter::ImageWriter(). |
|
Definition at line 1094 of file programBase.cxx. References PNMFileTypeRegistry::get_ptr(), PNMFileTypeRegistry::get_type_from_extension(), nout, NULL, and PNMFileTypeRegistry::write_types(). Referenced by EggReader::add_texture_options(). |
|
Definition at line 787 of file programBase.cxx. References nout, and string_to_int(). Referenced by EggMakeFont::EggMakeFont(), EggToBam::EggToBam(), GtkStats::GtkStats(), TestProgram::TestProgram(), and TextStats::TextStats(). |
|
Definition at line 807 of file programBase.cxx. References nout, string_to_int(), tokenize(), and vector_string. |
|
|
Definition at line 1120 of file programBase.cxx. References PathReplace::add_pattern(), nout, and size_t. Referenced by add_path_replace_options(). |
|
Definition at line 1142 of file programBase.cxx. References nout, PathStore, PS_invalid, and string_path_store(). Referenced by add_path_store_options(). |
|
Definition at line 1028 of file programBase.cxx. References DSearchPath::append_directory(), Filename::from_os_specific(), and nout. Referenced by add_path_replace_options(). |
|
Definition at line 990 of file programBase.cxx. Referenced by SomethingToEgg::add_animation_options(), EggReader::add_texture_options(), CVSCopy::CVSCopy(), EggMakeFont::EggMakeFont(), EggPalettize::EggPalettize(), EggTopstrip::EggTopstrip(), and SoftCVS::SoftCVS(). |
|
Definition at line 738 of file programBase.cxx. Referenced by EggTopstrip::EggTopstrip(). |
|
Definition at line 1072 of file programBase.cxx. References DistanceUnit, DU_invalid, nout, and string_distance_unit(). Referenced by SomethingToEgg::add_units_options(). |
|
Definition at line 1198 of file programBase.cxx. References indent(), p, q, and size_t. Referenced by show_text(). |
|
Definition at line 364 of file programBase.cxx. References _program_args, _program_name, and Filename::get_basename_wo_extension(). Referenced by EggMultiBase::append_command_comment(), EggBase::append_command_comment(), EggToC::run(), and EggPalettize::run(). |
|
Definition at line 1344 of file programBase.cxx. References _got_option_indent, _got_terminal_width, and _terminal_width. Referenced by show_options(), and show_text(). |
|
Reimplemented in BamInfo, EggToBam, EggMakeFont, EggPalettize, EggFilter, EggMultiFilter, EggReader, EggToSomething, EggWriter, EggTextureCards, FltInfo, FltTrans, ImageFilter, ImageReader, ImageWriter, ImageInfo, and LwoScan. Definition at line 416 of file programBase.cxx. References nout. Referenced by parse_command_line(). |
|
Definition at line 1163 of file programBase.cxx. References data, show_description(), show_options(), and show_usage(). Referenced by ProgramBase(). |
|
Reimplemented in GtkBase. Definition at line 214 of file programBase.cxx. References ProgramBase::Option::_bool_var, ProgramBase::Option::_option, ProgramBase::Option::_option_data, ProgramBase::Option::_option_function, ProgramBase::Option::_option_method, _options_by_name, ProgramBase::Option::_parm_name, _program_args, _program_name, argv, option::flag, Filename::from_os_specific(), getopt_long_only, handle_args(), option::has_arg, index, long_options, option::name, no_argument, nout, NULL, optarg, options, post_command_line(), required_argument, show_usage(), and option::val. Referenced by main(), and GtkBase::parse_command_line(). |
|
Reimplemented in CVSCopy, EggBase, EggFilter, EggMultiFilter, EggReader, EggWriter, SomethingToEgg, EggCharacterFilter, EggCrop, and ImageBase. Definition at line 441 of file programBase.cxx. Referenced by parse_command_line(), ImageBase::post_command_line(), EggMultiFilter::post_command_line(), and EggBase::post_command_line(). |
|
|
Definition at line 604 of file programBase.cxx. References _options_by_name. Referenced by BamToEgg::BamToEgg(), EggFilter::EggFilter(), EggReader::EggReader(), EggToBam::EggToBam(), EggToSomething::EggToSomething(), EggWriter::EggWriter(), FltToEgg::FltToEgg(), LwoToEgg::LwoToEgg(), SomethingToEgg::SomethingToEgg(), and XFileToEgg::XFileToEgg(). |
|
Definition at line 620 of file programBase.cxx. References _options_by_name, and _sorted_options. Referenced by EggPalettize::EggPalettize(), EggToBam::EggToBam(), EggToC::EggToC(), EggToX::EggToX(), and SomethingToEgg::SomethingToEgg(). |
|
|
Definition at line 143 of file programBase.cxx. References _description, and nout. Referenced by handle_help_option(). |
|
Definition at line 170 of file programBase.cxx. References ProgramBase::Option::_description, _got_option_indent, ProgramBase::Option::_option, _option_indent, _options_by_index, ProgramBase::Option::_parm_name, _terminal_width, get_terminal_width(), nout, show_text(), and sort_options(). Referenced by handle_help_option(). |
|
Definition at line 194 of file programBase.cxx. References _last_newline, _terminal_width, format_text(), and get_terminal_width(). |
|
Referenced by EggPalettize::describe_input_file(), WordWrapStreamBuf::flush_data(), show_options(), and show_usage(). |
|
Definition at line 153 of file programBase.cxx. References _program_name, _runlines, Filename::get_basename_wo_extension(), nout, and show_text(). Referenced by handle_help_option(), and parse_command_line(). |
|
Definition at line 1322 of file programBase.cxx. References _options_by_index, _options_by_name, and _sorted_options. Referenced by show_options(). |
|
Definition at line 141 of file programBase.h. Referenced by set_program_description(), and show_description(). |
|
Definition at line 159 of file programBase.h. Referenced by get_terminal_width(), ProgramBase(), and show_options(). |
|
Definition at line 153 of file programBase.h. |
|
Definition at line 116 of file programBase.h. Referenced by add_path_store_options(), EggWriter::handle_args(), EggMultiFilter::handle_args(), EggFilter::handle_args(), and ProgramBase(). |
|
Definition at line 115 of file programBase.h. Referenced by add_path_store_options(), and ProgramBase(). |
|
Definition at line 157 of file programBase.h. Referenced by get_terminal_width(), and ProgramBase(). |
|
Definition at line 155 of file programBase.h. Referenced by ProgramBase(), and show_text(). |
|
Definition at line 149 of file programBase.h. Referenced by add_option(), and ProgramBase(). |
|
Definition at line 158 of file programBase.h. Referenced by show_options(). |
|
Definition at line 148 of file programBase.h. Referenced by show_options(), and sort_options(). |
|
Definition at line 147 of file programBase.h. Referenced by add_option(), clear_options(), parse_command_line(), redescribe_option(), remove_option(), and sort_options(). |
|
Definition at line 59 of file programBase.h. Referenced by get_exec_command(), and parse_command_line(). |
|
Definition at line 58 of file programBase.h. Referenced by get_exec_command(), parse_command_line(), MayaToEgg::run(), MayaCopy::run(), and show_usage(). |
|
Definition at line 143 of file programBase.h. Referenced by add_runline(), clear_runlines(), and show_usage(). |
|
Definition at line 150 of file programBase.h. Referenced by add_option(), ProgramBase(), remove_option(), and sort_options(). |
|
Definition at line 156 of file programBase.h. Referenced by get_terminal_width(), show_options(), and show_text(). |