srecord
1.65.0
|
The srecord::input class is used to represent an abstract EPROM load file source. More...
#include <input.h>
Public Types | |
typedef std::shared_ptr< input > | pointer |
Public Member Functions | |
virtual | ~input () |
The destructor. More... | |
virtual bool | read (class record &rec)=0 |
The read method is used to read one record from the input. More... | |
virtual void | fatal_error (const char *,...) const FORMAT_PRINTF(2 |
The fatal_error method is used to report problems parsing the file. More... | |
virtual void virtual void | fatal_error_errno (const char *,...) const FORMAT_PRINTF(2 |
The fatal_error_errno method is used to report problems reading the input file. More... | |
virtual void virtual void virtual void | warning (const char *,...) const FORMAT_PRINTF(2 |
The warning method is used to report potential (but non-fatal) problems parsing the file. More... | |
virtual void virtual void virtual void virtual std::string | filename (void) const =0 |
The filename method is used to get the name of the input file being processed. More... | |
virtual std::string | filename_and_line (void) const |
The filename_and_line method is used to get the name and current line number within the file. More... | |
virtual const char * | get_file_format_name (void) const =0 |
The get_file_format_name method is used to find out the name of the file format being read. More... | |
void | set_quit (quit &) |
The set_quit method is used to set the disposition of the error messages, and the "exit" implementation. More... | |
void | reset_quit (void) |
The reset_quit method is used to cause the disposition of the error messages, and the "exit" back to the default. More... | |
virtual void | disable_checksum_validation (void)=0 |
The disable_checksum_validation method is used to have this input stream ignore checksum errors. More... | |
virtual void | command_line (srecord::arglex_tool *cmdln) |
The command_line method is used by arglex_srec::get_input when parsing the command line, to give a format or filter an opportunity to grab extra arguments off the command line. More... | |
Protected Member Functions | |
input () | |
The default constructor. More... | |
The srecord::input class is used to represent an abstract EPROM load file source.
It could be one of many file formats, or a chain of filters applied to an input file.
typedef std::shared_ptr<input> srecord::input::pointer |
|
virtual |
The destructor.
|
protected |
The default constructor.
Only derived classes may call.
|
pure virtual |
The read method is used to read one record from the input.
It returns 0 at the end of the input, and 1 if a record is read successfully.
See the srecord::record documentation (header file) for details of the various record types.
Note: there is no guarantee that a header record will appear first, or that a execution start address record will appear last.
rec | Where to put the returned data. |
Implemented in srecord::input_file_logisim, srecord::input_file_trs80, srecord::input_generator, srecord::input_filter_xor, srecord::input_filter_unsplit, srecord::input_filter_unfill, srecord::input_filter_split, srecord::input_filter_sequence, srecord::input_filter_random_fill, srecord::input_filter_or, srecord::input_filter_offset, srecord::input_filter_not, srecord::input_filter_message, srecord::input_filter_interval, srecord::input_filter_fill, srecord::input_filter_crop, srecord::input_filter_checksum, srecord::input_filter_byte_swap, srecord::input_filter_bitrev, srecord::input_filter_and, srecord::input_file_wilson, srecord::input_file_vmem, srecord::input_file_ti_txt, srecord::input_file_ti_tagged_16, srecord::input_file_ti_tagged, srecord::input_file_tektronix_extended, srecord::input_file_tektronix, srecord::input_file_stewie, srecord::input_file_spectrum, srecord::input_file_spasm, srecord::input_file_signetics, srecord::input_file_os65v, srecord::input_file_needham, srecord::input_file_msbin, srecord::input_file_motorola, srecord::input_file_mos_tech, srecord::input_file_mips_flash, srecord::input_file_mif, srecord::input_file_intel16, srecord::input_file_intel, srecord::input_file_idt, srecord::input_file_hp64k, srecord::input_file_four_packed_code, srecord::input_file_formatted_binary, srecord::input_file_fastload, srecord::input_file_fairchild, srecord::input_file_emon52, srecord::input_file_dec_binary, srecord::input_file_cosmac, srecord::input_file_brecord, srecord::input_file_binary, srecord::input_file_atmel_generic, srecord::input_file_ascii_hex, srecord::input_file_aomf, srecord::input_catenate, srecord::input_filter, srecord::input_file_ppx, srecord::input_file_ppb, and srecord::input_file_hexdump.
|
virtual |
The fatal_error method is used to report problems parsing the file.
Do not put a newline at the end of the message. Usually called from within derived class methods. This method does not return.
The file name and line number are automatically included in the message. The filename_and_line method is called to determine them.
|
virtual |
The fatal_error_errno method is used to report problems reading the input file.
Do not put a newline at the end of the message. The string equivalent of errno is appended to the error message. This method does not return.
The file name and line number are automatically included in the message. The filename_and_line method is called to determine them.
|
virtual |
The warning method is used to report potential (but non-fatal) problems parsing the file.
Do not put a newline at the end of the message. Usually called from within derived class methods.
The file name and line number are automatically included in the message. The filename_and_line method is called to determine them.
|
pure virtual |
The filename method is used to get the name of the input file being processed.
Derived classes must supply this method.
Implemented in srecord::input_file, srecord::input_generator_repeat, srecord::input_generator_random, srecord::input_generator_constant, srecord::input_filter, and srecord::input_catenate.
|
virtual |
The filename_and_line method is used to get the name and current line number within the file.
The default implementation simply calls the filename method and returns that. Text formats should be cleverer.
Reimplemented in srecord::input_file, srecord::input_filter, and srecord::input_catenate.
|
pure virtual |
The get_file_format_name method is used to find out the name of the file format being read.
Derived classes must supply this method.
Implemented in srecord::input_file_wilson, srecord::input_file_vmem, srecord::input_file_trs80, srecord::input_file_ti_txt, srecord::input_file_ti_tagged_16, srecord::input_file_ti_tagged, srecord::input_file_tektronix_extended, srecord::input_file_tektronix, srecord::input_file_stewie, srecord::input_file_spectrum, srecord::input_file_spasm, srecord::input_file_signetics, srecord::input_file_ppx, srecord::input_file_ppb, srecord::input_file_os65v, srecord::input_file_needham, srecord::input_file_msbin, srecord::input_file_motorola, srecord::input_file_mos_tech, srecord::input_file_mips_flash, srecord::input_file_mif, srecord::input_file_logisim, srecord::input_file_intel16, srecord::input_file_intel, srecord::input_file_idt, srecord::input_file_hp64k, srecord::input_file_hexdump, srecord::input_file_four_packed_code, srecord::input_file_formatted_binary, srecord::input_file_fastload, srecord::input_file_fairchild, srecord::input_file_emon52, srecord::input_file_dec_binary, srecord::input_file_cosmac, srecord::input_file_brecord, srecord::input_file_aomf, srecord::input_generator_repeat, srecord::input_generator_random, srecord::input_generator_constant, srecord::input_filter, srecord::input_file_binary, srecord::input_file_atmel_generic, srecord::input_file_ascii_hex, and srecord::input_catenate.
void srecord::input::set_quit | ( | quit & | ) |
The set_quit method is used to set the disposition of the error messages, and the "exit" implementation.
The default is to write error messages on the standard error, and to exit using the standard C exit function.
void srecord::input::reset_quit | ( | void | ) |
The reset_quit method is used to cause the disposition of the error messages, and the "exit" back to the default.
|
pure virtual |
The disable_checksum_validation method is used to have this input stream ignore checksum errors.
Implemented in srecord::input_file, srecord::input_generator, srecord::input_filter, and srecord::input_catenate.
|
virtual |
The command_line method is used by arglex_srec::get_input when parsing the command line, to give a format or filter an opportunity to grab extra arguments off the command line.
The default implementation does nothing.
cmdln | Where to obtain information about the curreent parse state of the command line. |
Reimplemented in srecord::input_filter_message_fletcher16, srecord::input_filter_message_stm32, srecord::input_filter_message_crc32, srecord::input_filter_message_crc16, srecord::input_filter_byte_swap, srecord::input_file_motorola, and srecord::input_file_hp64k.