srecord
1.65.0
|
The srecord::arglex_tool is used to parse command line with srec-specific arguments. More...
#include <tool.h>
Public Member Functions | |
virtual | ~arglex_tool () |
The destructor. More... | |
arglex_tool (int argc, char **argv) | |
The constructor. More... | |
input::pointer | get_input (void) |
The get_input method is used to parse an input specification (filename, file format, filters, everything) from the command line. More... | |
output::pointer | get_output (void) |
The get_output method is used to parse an output specification (filename and file format) from the command line. More... | |
unsigned long | get_number (const char *caption) |
The get_number method is used to parse a numeric value from the command line. More... | |
unsigned long | get_number (const char *caption, long min, long max) |
The get_number method is used to parse a numeric value from the command line, and check it agains a specified range. More... | |
bool | can_get_number (void) const |
The can_get_number method is used to determine if it is possible to parse a number from the next token on the command line. More... | |
interval | get_interval (const char *err_msg_caption) |
The get_interval method is used to parse an interval set form the command line. More... | |
interval | get_interval_small (const char *err_msg_caption) |
The get_interval_small method may be used to parse an interval set form the command line. More... | |
std::string | get_string (const char *caption) |
The get_string method may be used to get a string from the command line, or issue a fatal error if one is not available. More... | |
void | default_command_line_processing (void) |
The default_command_line_processing method is used to process command line arguments not handled by the derived class. More... | |
defcon_t | get_redundant_bytes (void) const |
defcon_t | get_contradictory_bytes (void) const |
![]() | |
virtual | ~arglex () |
The destructor. More... | |
void | fatal_error (const char *fmt,...) FORMAT_PRINTF(2 |
The fatal_error method may be used to print a fatal error message, and then exit via the usage() method. More... | |
void | test_ambiguous (void) const |
The test_ambiguous method is for debugging. More... | |
arglex () | |
The default constructor. More... | |
arglex (arglex &) | |
The copy constructor. More... | |
arglex (int argc, char **argv) | |
The normal constructor. More... | |
int | token_cur () const |
The token_cur method is used to get the type of the current token. More... | |
int | token_next (void) |
The token_next method is used to advance to the next command line option and determine what type of token it is. More... | |
int | token_first (void) |
The token_first method is used to fetch the fisrt command like token (rather than use the token_next method). More... | |
const std::string & | value_string () const |
The value_string method is used to get the string value of the current token. More... | |
long | value_number () const |
The value_number method is used to get the numeric value of the current token. More... | |
const char * | token_name (int tok) const |
The token_name method is used to turn a token type number into an equivalent string. More... | |
const char * | token_name () const |
The token_name method is used to obtain the name of the current token. More... | |
void | usage () const |
The usage method is used to print a usage summary. More... | |
void | help (const char *=0) const |
The help method is used to print a help message. More... | |
void | version () const |
The version method is used to print a version message. More... | |
void | license () const |
The license method is used to print the license conditions of the program. More... | |
void | bad_argument () const |
The bad_argument method is used to print an error message when the current token is inappropriate, then it calls usage, which exits. More... | |
void | usage_tail_set (const char *) |
The usage_tail_set method is used to set the end of the command line to be printed as part of the usage method. More... | |
Additional Inherited Members | |
![]() | |
void static bool | compare (const char *formal, const char *actual) |
The compare class method is used to compare a command line string with a formal spec of the option, to see if they compare equal. More... | |
static std::string | abbreviate (const char *text) |
The abbreviate class method is used to take an option's long name, and turn it into the minimum possible string for that option. More... | |
![]() | |
void | table_set (const table_ty *) |
The table_set method is used to append more command line token tables to the list of tables to be scanned. More... | |
void | deprecated_option (const std::string &formal_name) |
The deprecated_option method is used to nominate option patterns that are deprected. More... | |
The srecord::arglex_tool is used to parse command line with srec-specific arguments.
anonymous enum |
|
virtual |
The destructor.
srecord::arglex_tool::arglex_tool | ( | int | argc, |
char ** | argv | ||
) |
The constructor.
Pass the argc and argv as given to main; there is not need to change the values at all.
input::pointer srecord::arglex_tool::get_input | ( | void | ) |
The get_input method is used to parse an input specification (filename, file format, filters, everything) from the command line.
If the parse is unsuccessful (is not present on command line) a fatal error will be issued and the method call will not return.
output::pointer srecord::arglex_tool::get_output | ( | void | ) |
The get_output method is used to parse an output specification (filename and file format) from the command line.
If the parse is unsuccessful (is not present on command line) a fatal error will be issued and the method call will not return.
unsigned long srecord::arglex_tool::get_number | ( | const char * | caption | ) |
The get_number method is used to parse a numeric value from the command line.
unsigned long srecord::arglex_tool::get_number | ( | const char * | caption, |
long | min, | ||
long | max | ||
) |
The get_number method is used to parse a numeric value from the command line, and check it agains a specified range.
caption | for the error message, if necessary |
min | The minimum acceptable value (inclusive) |
max | The maximum acceptable value (inclusive) |
bool srecord::arglex_tool::can_get_number | ( | void | ) | const |
The can_get_number method is used to determine if it is possible to parse a number from the next token on the command line.
interval srecord::arglex_tool::get_interval | ( | const char * | err_msg_caption | ) |
The get_interval method is used to parse an interval set form the command line.
It consists of as many get_interval_inner()s as possible.
Used by the get_input method to parse the address intervals used by various filters. It is the lowest precedence level, and handsles set union (the implicit operator) and set difference (the - operator).
If the parse is unsuccessful (is not present on command line) a fatal error will be issued and the method call will not return.
interval srecord::arglex_tool::get_interval_small | ( | const char * | err_msg_caption | ) |
The get_interval_small method may be used to parse an interval set form the command line.
It checks that the interval is <=1GB, and errors if it is not, with a –big override. Commonly used to sanity check things like –fill.
std::string srecord::arglex_tool::get_string | ( | const char * | caption | ) |
The get_string method may be used to get a string from the command line, or issue a fatal error if one is not available.
caption | The text for the error message. |
|
virtual |
The default_command_line_processing method is used to process command line arguments not handled by the derived class.
Reimplemented from srecord::arglex.
|
inline |
|
inline |