Public Types | |
enum | WantArg { wantArg_never, wantArg_optional, wantArg_always } |
Public Member Functions | |
Options (bool treatNegativeNumbersAsOptions=false, Logger *logger=Logger::get()) | |
~Options () | |
template<typename T, typename D> | |
void | addConfig (string shortName, string longName, T &var, T val, string description, WantArg wantArg, D domainChecker) throw (DefinitionException) |
Add a configuration parameter that can be used both as a command line switch and in a configuration file. | |
template<typename T> | |
void | addConfig (string shortName, string longName, T &var, T val, string description, WantArg wantArg=wantArg_never) throw (DefinitionException) |
Same as template<typename T, typename D> addConfig(string, string, T &, T, string, WantArg, D) except that the domain checker is defaulted to Unrestricted<T>. | |
template<typename T, typename D> | |
void | addSwitch (string shortName, string longName, T &var, T val, string description, WantArg wantArg, D domainChecker) throw (DefinitionException) |
Add an option that can be used only as a command line switch. | |
template<typename T> | |
void | addSwitch (string shortName, string longName, T &var, T val, string description, WantArg wantArg=wantArg_never) throw (DefinitionException) |
Add an option that can be used only as a command line switch. | |
bool | processCommandLine (int &argc, const char *argv[], bool switchesOnly=false) |
Apply the effects of the switches on the command line. | |
bool | processConfigFile (string path) throw (FileAccessException) |
Apply the effects of a configuration file. | |
void | saveConfigFile (string path) throw (FileAccessException) |
Save all the options and their values into the specified file in a format that is readable by processConfigFile. | |
string | list (unsigned width=Term::getWidth()) |
Print a description of the switches. | |
Static Public Member Functions | |
template<typename T> | |
static Range< T > | range (T from, T to) |
Classes | |
struct | Def |
struct | DefinitionException |
struct | DefVar |
struct | DefVarBase |
struct | FileAccessException |
struct | IntByInt |
Utility type for grouping two integers. More... | |
struct | Parser |
struct | Range |
Domain checker for a range. More... | |
struct | Unrestricted |
Domain checker for an unrestricted domain. More... |
Definition at line 36 of file options.H.
|
Same as template<typename T, typename D> addConfig(string, string, T &, T, string, WantArg, D) except that the domain checker is defaulted to Unrestricted<T>.
|
|
Add a configuration parameter that can be used both as a command line switch and in a configuration file.
Definition at line 135 of file options.H. Referenced by Archon::Render::Test::main(), Archon::Display::Test::main(), Archon::SaiTestApps::Textviewer::main(), Archon::SaiTestApps::Spot::main(), Archon::SaiTestApps::Simple::main(), Archon::SaiTestApps::Molecule::main(), Archon::SaiTestApps::Filebrowser::main(), Archon::SaiTestApps::Cylinders::main(), Archon::SaiTestApps::Clock::main(), and Archon::Console3d::main(). |
|
Add an option that can be used only as a command line switch. The meaning of the parameters are the same as for addConfig.
|
|
Add an option that can be used only as a command line switch. The meaning of the parameters are the same as for addConfig.
Definition at line 171 of file options.H. Referenced by Archon::Render::Test::main(), Archon::Display::Test::main(), Archon::SaiTestApps::Textviewer::main(), Archon::SaiTestApps::Spot::main(), Archon::SaiTestApps::Simple::main(), Archon::SaiTestApps::Molecule::main(), Archon::SaiTestApps::Filebrowser::main(), Archon::SaiTestApps::Cylinders::main(), Archon::SaiTestApps::Clock::main(), and Archon::Console3d::main(). |
|
Apply the effects of the switches on the command line. 'argc' and 'argv' are adjusted so that all processed switches are filtered out.
Definition at line 253 of file options.C. References Archon::Utilities::Logger::log(). Referenced by Archon::Render::Test::main(), Archon::Display::Test::main(), Archon::SaiTestApps::Textviewer::main(), Archon::SaiTestApps::Spot::main(), Archon::SaiTestApps::Simple::main(), Archon::SaiTestApps::Molecule::main(), Archon::SaiTestApps::Filebrowser::main(), Archon::SaiTestApps::Cylinders::main(), Archon::SaiTestApps::Clock::main(), and Archon::Console3d::main(). |
|
Apply the effects of a configuration file.
Definition at line 520 of file options.C. References Archon::Utilities::logger, Archon::Utilities::Stream::makeFileReader(), Archon::SaiTestApps::Filebrowser::path, and Archon::Utilities::Text::toString(). Referenced by Archon::Console3d::main(). |
|
Save all the options and their values into the specified file in a format that is readable by processConfigFile. Options that are added with addSwitch and options without a long name are not included. Definition at line 620 of file options.C. References Archon::Utilities::Stream::makeFileWriter(), and Archon::SaiTestApps::Filebrowser::path. Referenced by Archon::Console3d::main(). |