srecord: srecord::arglex_tool Class Reference

srecord 1.65.0

Loading...
Searching...
No Matches
srecord::arglex_tool Class Reference

The srecord::arglex_tool is used to parse command line with srec-specific arguments. More...

`#include <tool.h>`

Inheritance diagram for srecord::arglex_tool:
[legend]
Collaboration diagram for srecord::arglex_tool:
[legend]

## Public Types
enum | { token_a430 = arglex::token_MAX , token_adler16_be , token_adler16_le , token_adler32_be , token_adler32_le , token_and , token_aomf , token_ascii_hex , token_assembler , token_atmel_generic_be , token_atmel_generic_le , token_basic_data , token_big , token_binary , token_bitrev , token_brecord , token_byte_swap , token_c_array , token_c_compressed , token_checksum_be_bitnot , token_checksum_be_negative , token_checksum_be_positive , token_checksum_le_bitnot , token_checksum_le_negative , token_checksum_le_positive , token_cl430 , token_constant , token_constant_be , token_constant_le , token_constant_not , token_contradictory_bytes , token_cosmac , token_crc16_augment , token_crc16_augment_not , token_crc16_be , token_crc16_broken , token_crc16_ccitt , token_crc16_le , token_crc16_least_to_most , token_crc16_most_to_least , token_crc16_xmodem , token_crc32_be , token_crc32_le , token_crop , token_dec_binary , token_eeprom , token_emon52 , token_exclude , token_exclusive_length , token_exclusive_length_be , token_exclusive_length_le , token_exclusive_maximum , token_exclusive_maximum_be , token_exclusive_maximum_le , token_exclusive_minimum , token_exclusive_minimum_be , token_exclusive_minimum_le , token_fairchild , token_fast_load , token_fill , token_fletcher16_be , token_fletcher16_le , token_fletcher32_be , token_fletcher32_le , token_formatted_binary , token_forth , token_four_packed_code , token_gcrypt , token_generator , token_guess , token_haval , token_hexdump , token_hp64k , token_idt , token_ignore_checksums , token_lattice_memory_initialization_format , token_logisim , token_include , token_include_not , token_intel , token_intel16 , token_intersection , token_length , token_length_be , token_length_le , token_maximum_address , token_maximum_be , token_maximum_le , token_md2 , token_md5 , token_memory_initialization_file , token_minimum_address , token_minimum_be , token_minimum_le , token_minus , token_mips_flash_be , token_mips_flash_le , token_mos_tech , token_motorola , token_msbin , token_multiple , token_needham_hex , token_not , token_offset , token_ohio_scientific , token_or , token_output , token_output_word , token_over , token_paren_begin , token_paren_end , token_polynomial , token_postfix , token_ppb , token_ppx , token_prefix , token_ram , token_random , token_random_fill , token_range_padding , token_redundant_bytes , token_repeat_data , token_repeat_string , token_rmd160 , token_round_down , token_round_nearest , token_round_up , token_sequence_warnings_disable , token_sequence_warnings_enable , token_sha1 , token_sha224 , token_sha256 , token_sha384 , token_sha512 , token_signetics , token_spasm_be , token_spasm_le , token_spectrum , token_split , token_stewie , token_stm32_crc_be , token_stm32_crc_le , token_style_dot , token_style_hexadecimal , token_style_hexadecimal_not , token_style_section , token_tektronix , token_tektronix_extended , token_tiger , token_ti_tagged , token_ti_tagged_16 , token_ti_txt , token_trs80 , token_unfill , token_union , token_unsplit , token_vhdl , token_vmem , token_whirlpool , token_wilson , token_within , token_xilinx_coefficient_file , token_xor , token_MAX }
Public Types inherited from srecord::arglex
enum | { token_eoln , token_help , token_license , token_number , token_option , token_page_width , token_page_length , token_stdio , token_string , token_tracing , token_verbose , token_version , token_MAX }
| The "normal" command line tokens common to all programs. More...

## Public Member Functions
virtual | ~arglex_tool ()
| The destructor.
| arglex_tool (int argc, char **argv)
| The constructor.
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.
output::pointer | get_output (void)
| The get_output method is used to parse an output specification (filename and file format) from the command line.
unsigned long | get_number (const char *caption)
| The get_number method is used to parse a numeric value from the command line.
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.
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.
interval | get_interval (const char *err_msg_caption)
| The get_interval method is used to parse an interval set form the command line.
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.
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.
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.
defcon_t | get_redundant_bytes (void) const
defcon_t | get_contradictory_bytes (void) const
Public Member Functions inherited from srecord::arglex
virtual | ~arglex ()
| The destructor.
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.
void | test_ambiguous (void) const
| The test_ambiguous method is for debugging.
| arglex ()
| The default constructor.
| arglex (arglex &)
| The copy constructor.
| arglex (int argc, char **argv)
| The normal constructor.
int | token_cur () const
| The token_cur method is used to get the type of the current token.
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.
int | token_first (void)
| The token_first method is used to fetch the fisrt command like token (rather than use the token_next method).
const std::string & | value_string () const
| The value_string method is used to get the string value of the current token.
long | value_number () const
| The value_number method is used to get the numeric value of the current token.
const char * | token_name (int tok) const
| The token_name method is used to turn a token type number into an equivalent string.
const char * | token_name () const
| The token_name method is used to obtain the name of the current token.
void | usage () const
| The usage method is used to print a usage summary.
void | help (const char *=0) const
| The help method is used to print a help message.
void | version () const
| The version method is used to print a version message.
void | license () const
| The license method is used to print the license conditions of the program.
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.
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.

## Additional Inherited Members
Static Public Member Functions inherited from srecord::arglex
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.
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.
Protected Member Functions inherited from srecord::arglex
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.
void | deprecated_option (const std::string &formal_name)
| The deprecated_option method is used to nominate option patterns that are deprected.

## Detailed Description

The srecord::arglex_tool is used to parse command line with srec-specific arguments.

Definition at line 39 of file tool.h.

## Member Enumeration Documentation

## ◆ anonymous enum

anonymous enum

Enumerator
token_a430 |
token_adler16_be |
token_adler16_le |
token_adler32_be |
token_adler32_le |
token_and |
token_aomf |
token_ascii_hex |
token_assembler |
token_atmel_generic_be |
token_atmel_generic_le |
token_basic_data |
token_big |
token_binary |
token_bitrev |
token_brecord |
token_byte_swap |
token_c_array |
token_c_compressed |
token_checksum_be_bitnot |
token_checksum_be_negative |
token_checksum_be_positive |
token_checksum_le_bitnot |
token_checksum_le_negative |
token_checksum_le_positive |
token_cl430 |
token_constant |
token_constant_be |
token_constant_le |
token_constant_not |
token_contradictory_bytes |
token_cosmac |
token_crc16_augment |
token_crc16_augment_not |
token_crc16_be |
token_crc16_broken |
token_crc16_ccitt |
token_crc16_le |
token_crc16_least_to_most |
token_crc16_most_to_least |
token_crc16_xmodem |
token_crc32_be |
token_crc32_le |
token_crop |
token_dec_binary |
token_eeprom |
token_emon52 |
token_exclude |
token_exclusive_length |
token_exclusive_length_be |
token_exclusive_length_le |
token_exclusive_maximum |
token_exclusive_maximum_be |
token_exclusive_maximum_le |
token_exclusive_minimum |
token_exclusive_minimum_be |
token_exclusive_minimum_le |
token_fairchild |
token_fast_load |
token_fill |
token_fletcher16_be |
token_fletcher16_le |
token_fletcher32_be |
token_fletcher32_le |
token_formatted_binary |
token_forth |
token_four_packed_code |
token_gcrypt |
token_generator |
token_guess |
token_haval |
token_hexdump |
token_hp64k |
token_idt |
token_ignore_checksums |
token_lattice_memory_initialization_format |
token_logisim |
token_include |
token_include_not |
token_intel |
token_intel16 |
token_intersection |
token_length |
token_length_be |
token_length_le |
token_maximum_address |
token_maximum_be |
token_maximum_le |
token_md2 |
token_md5 |
token_memory_initialization_file |
token_minimum_address |
token_minimum_be |
token_minimum_le |
token_minus |
token_mips_flash_be |
token_mips_flash_le |
token_mos_tech |
token_motorola |
token_msbin |
token_multiple |
token_needham_hex |
token_not |
token_offset |
token_ohio_scientific |
token_or |
token_output |
token_output_word |
token_over |
token_paren_begin |
token_paren_end |
token_polynomial |
token_postfix |
token_ppb |
token_ppx |
token_prefix |
token_ram |
token_random |
token_random_fill |
token_range_padding |
token_redundant_bytes |
token_repeat_data |
token_repeat_string |
token_rmd160 |
token_round_down |
token_round_nearest |
token_round_up |
token_sequence_warnings_disable |
token_sequence_warnings_enable |
token_sha1 |
token_sha224 |
token_sha256 |
token_sha384 |
token_sha512 |
token_signetics |
token_spasm_be |
token_spasm_le |
token_spectrum |
token_split |
token_stewie |
token_stm32_crc_be |
token_stm32_crc_le |
token_style_dot |
token_style_hexadecimal |
token_style_hexadecimal_not |
token_style_section |
token_tektronix |
token_tektronix_extended |
token_tiger |
token_ti_tagged |
token_ti_tagged_16 |
token_ti_txt |
token_trs80 |
token_unfill |
token_union |
token_unsplit |
token_vhdl |
token_vmem |
token_whirlpool |
token_wilson |
token_within |
token_xilinx_coefficient_file |
token_xor |
token_MAX |

Definition at line 43 of file tool.h.

## Constructor & Destructor Documentation

## ◆ ~arglex_tool()

virtual srecord::arglex_tool::~arglex_tool | ( |  | ) |
| virtual

The destructor.

## ◆ arglex_tool()

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.

## Member Function Documentation

## ◆ get_input()

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.

## ◆ get_output()

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.

## ◆ get_number() [1/2]

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.

## ◆ get_number() [2/2]

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.

Parameters

  caption | for the error message, if necessary
  min | The minimum acceptable value (inclusive)
  max | The maximum acceptable value (inclusive)

## ◆ can_get_number()

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.

## ◆ get_interval()

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.

## ◆ get_interval_small()

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.

## ◆ get_string()

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.

Parameters

  caption | The text for the error message.

## ◆ default_command_line_processing()

void srecord::arglex_tool::default_command_line_processing | ( | void |  | ) |
| virtual

The default_command_line_processing method is used to process command line arguments not handled by the derived class.

Reimplemented from srecord::arglex.

## ◆ get_redundant_bytes()

defcon_t srecord::arglex_tool::get_redundant_bytes | ( | void |  | ) | const
| inline

Definition at line 304 of file tool.h.

## ◆ get_contradictory_bytes()

defcon_t srecord::arglex_tool::get_contradictory_bytes | ( | void |  | ) | const
| inline

Definition at line 305 of file tool.h.

The documentation for this class was generated from the following file:

- arglex/tool.h