nis-util
1.0.D108
|
#include <arglex.h>
The arglex class is used to represent the current parse state of the command line, and perform lexical analysis on each command line argument.
typedef std::list<arglex_source::pointer> arglex::sources_t [private] |
typedef std::list<const table_t *> arglex::tables_t [private] |
anonymous enum |
arglex::~arglex | ( | ) | [virtual] |
arglex::arglex | ( | int | argc, |
char ** | argv | ||
) |
arglex::arglex | ( | ) | [private] |
The default constructor. Do not use.
arglex::arglex | ( | const arglex & | rhs | ) | [private] |
The copy constructor. Do not use.
rhs | The right hand side of the initialisation. |
void arglex::bad_argument | ( | void | ) | const |
void arglex::check_stdin_references | ( | void | ) |
void arglex::check_stdout_references | ( | void | ) |
bool arglex::compare | ( | const char * | formal, |
const char * | actual | ||
) | [static] |
The compare class method is used to compare an argument name pattern with an actual argument.
formal | The argument name pattern. Upper case letters are mandatory, lower case letters are optional. |
actual | The string to be checked. |
void arglex::generic_argument | ( | void | ) |
The generic_argument method is used to process all command line arguments not specific to any particular command. Usually this will result in a terminal error message.
Definition at line 26 of file generic_argument.cc.
rcstring arglex::get_filename_or_stdin | ( | void | ) |
void arglex::get_filename_or_stdin | ( | rcstring & | fnvar | ) |
rcstring arglex::get_filename_or_stdout | ( | void | ) |
void arglex::get_filename_or_stdout | ( | rcstring & | fnvar | ) |
long arglex::get_integer_value | ( | void | ) | const [inline] |
const source_location & arglex::get_source_location | ( | void | ) | const |
The get_source_location method is used to obtain the source location of the most recent token returned by the token_next method. Usually this will be the command line, but not always.
rcstring arglex::get_string_value | ( | void | ) | const [inline] |
The get_string_value method is used to obtain the string value of the current token.
void arglex::help | ( | const char * | name = 0 | ) | const [private] |
The help method is called from the token_first method to print the help message (man page) of the command.
void arglex::license | ( | void | ) | const [private] |
The license method is called from the token_first method to print the license message of the command.
The assignment operator. Do not use.
rhs | The right hand side of the assignment. |
void arglex::push_arg_back | ( | const char * | text | ) | [private] |
The push_arg_back method is used to "return" a string to the input source. It uses token_locn for its location.
text | The text of the argument to be "returned" to the input. |
void arglex::table_set | ( | const table_t * | tp | ) | [protected] |
The table_set method may be used by derived classes to add another set of option patterns and values. This is used to specialize the command line processing for individual programs.
This is usually called from within a derived class's constructor.
tp | Pointer to array of comamnd line options, terminated by an entry with a NULL name pointer. Use ARGLEX_END_MARKER as the last row of your table. |
int arglex::token_cur | ( | void | ) | const [inline] |
int arglex::token_first | ( | void | ) |
The token_first method is called to obtain the first argument from the command line. It automatically processed the --help and --version options, and does not return if it sees them. It calls the token_next method to obtain the first token.
const char * arglex::token_name | ( | int | num | ) | const |
int arglex::token_next | ( | void | ) |
The token_next methpod is used to advance to the next token from the command line. Usually this will be the next argument, but in the case of --name=value style options, this will be represented as two separate tokens.
void arglex::usage | ( | void | ) | const |
const char * arglex::usage_tail_get | ( | void | ) | const [private] |
void arglex::usage_tail_set | ( | const char * | text | ) | [protected] |
The usage_tail_set method is used to set the trailing portion of a command line usage methd. The default is empty, meaning the commands only accept options, and do not accept trailing file names.
This method is usually called from within a derived class's constructor.
void arglex::version | ( | void | ) | const [private] |
The version method is called from the token_first method to print the version message of the command.
int arglex::number_of_stdin_references [private] |
int arglex::number_of_stdout_references [private] |
sources_t arglex::sources [private] |
tables_t arglex::tables [private] |
int arglex::token [private] |
The token instance variable is used to remember the token number of the current token. This instance variable is maintained by the token_next method.
source_location arglex::token_locn [private] |
The token_locn instance variable is used to remember the source (file) location of the most recent token, as returned by the token_next method.
const char* arglex::usage_tail_ [private] |
The usage_tail_ instance variable is used to remember the right hand end of the command's usage method. This is set using the usage_tail_set method, and obtained using the usage_tail_get method.
long arglex::value_number [private] |
The value_number instance variable is used to remember the value of the current token, if that token is a number. This instance variable is maintained by the token_next method.
rcstring arglex::value_string [private] |
The value_string instance variable is used to remember the text of the current token. This instance variable is maintained by the token_next method.