srecord: srecord::input Class Reference

srecord 1.65.0

Loading...
Searching...
No Matches
srecord::input Class Referenceabstract

The srecord::input class is used to represent an abstract EPROM load file source. More...

`#include <input.h>`

Inheritance diagram for srecord::input:
[legend]

## Public Types
typedef std::shared_ptr< input > | pointer

## Public Member Functions
virtual | ~input ()
| The destructor.
virtual bool | read (class record &rec)=0
| The read method is used to read one record from the input.
virtual void | fatal_error (const char *,...) const FORMAT_PRINTF(2
| The fatal_error method is used to report problems parsing the file.
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.
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.
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.
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.
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.
void | set_quit (quit &)
| The set_quit method is used to set the disposition of the error messages, and the "exit" implementation.
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.
virtual void | disable_checksum_validation (void)=0
| The disable_checksum_validation method is used to have this input stream ignore checksum errors.
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.

## Protected Member Functions
| input ()
| The default constructor.

## Detailed Description

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.

Definition at line 38 of file input.h.

## Member Typedef Documentation

## ◆ pointer

typedef std::shared_ptr<input> srecord::input::pointer

Definition at line 41 of file input.h.

## Constructor & Destructor Documentation

## ◆ ~input()

virtual srecord::input::~input | ( |  | ) |
| virtual

The destructor.

## ◆ input()

srecord::input::input | ( |  | ) |
| protected

The default constructor.

Only derived classes may call.

References input().

Referenced by input().

## Member Function Documentation

## ◆ read()

virtual bool srecord::input::read | ( | class record & | rec | ) |
| 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.

Parameters

  rec | Where to put the returned data.

Returns
  bool; true if data was read, false if at end-of-file

Implemented in srecord::input_catenate, srecord::input_file_aomf, srecord::input_file_ascii_hex, srecord::input_file_atmel_generic, srecord::input_file_binary, srecord::input_file_brecord, srecord::input_file_cosmac, srecord::input_file_dec_binary, srecord::input_file_emon52, srecord::input_file_fairchild, srecord::input_file_fastload, srecord::input_file_formatted_binary, srecord::input_file_four_packed_code, srecord::input_file_hexdump, srecord::input_file_hp64k, srecord::input_file_idt, srecord::input_file_intel16, srecord::input_file_intel, srecord::input_file_logisim, srecord::input_file_mif, srecord::input_file_mips_flash, srecord::input_file_mos_tech, srecord::input_file_motorola, srecord::input_file_msbin, srecord::input_file_needham, srecord::input_file_os65v, srecord::input_file_ppb, srecord::input_file_ppx, srecord::input_file_signetics, srecord::input_file_spasm, srecord::input_file_spectrum, srecord::input_file_stewie, srecord::input_file_tektronix, srecord::input_file_tektronix_extended, srecord::input_file_ti_tagged, srecord::input_file_ti_tagged_16, srecord::input_file_ti_txt, srecord::input_file_trs80, srecord::input_file_vmem, srecord::input_file_wilson, srecord::input_filter, srecord::input_filter_and, srecord::input_filter_bitrev, srecord::input_filter_byte_swap, srecord::input_filter_checksum, srecord::input_filter_crop, srecord::input_filter_fill, srecord::input_filter_interval, srecord::input_filter_message, srecord::input_filter_not, srecord::input_filter_offset, srecord::input_filter_or, srecord::input_filter_random_fill, srecord::input_filter_sequence, srecord::input_filter_split, srecord::input_filter_unfill, srecord::input_filter_unsplit, srecord::input_filter_xor, and srecord::input_generator.

## ◆ fatal_error()

virtual void srecord::input::fatal_error | ( | const char * | ,
|  |  | ... ) const
| 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.

References FORMAT_PRINTF.

## ◆ fatal_error_errno()

virtual void virtual void srecord::input::fatal_error_errno | ( | const char * | ,
|  |  | ... ) const
| 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.

References fatal_error_errno(), and FORMAT_PRINTF.

Referenced by fatal_error_errno().

## ◆ warning()

virtual void virtual void virtual void srecord::input::warning | ( | const char * | ,
|  |  | ... ) const
| 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.

References FORMAT_PRINTF, and warning().

Referenced by warning().

## ◆ filename()

virtual void virtual void virtual void virtual std::string srecord::input::filename | ( | void |  | ) | const
| 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_catenate, srecord::input_file, srecord::input_filter, srecord::input_generator_constant, srecord::input_generator_random, and srecord::input_generator_repeat.

References filename().

Referenced by filename().

## ◆ filename_and_line()

virtual std::string srecord::input::filename_and_line | ( | void |  | ) | const
| 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_catenate, srecord::input_file, and srecord::input_filter.

References filename_and_line().

Referenced by filename_and_line().

## ◆ get_file_format_name()

virtual const char * srecord::input::get_file_format_name | ( | void |  | ) | const
| 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_catenate, srecord::input_file_aomf, srecord::input_file_ascii_hex, srecord::input_file_atmel_generic, srecord::input_file_binary, srecord::input_file_brecord, srecord::input_file_cosmac, srecord::input_file_dec_binary, srecord::input_file_emon52, srecord::input_file_fairchild, srecord::input_file_fastload, srecord::input_file_formatted_binary, srecord::input_file_four_packed_code, srecord::input_file_hexdump, srecord::input_file_hp64k, srecord::input_file_idt, srecord::input_file_intel16, srecord::input_file_intel, srecord::input_file_logisim, srecord::input_file_mif, srecord::input_file_mips_flash, srecord::input_file_mos_tech, srecord::input_file_motorola, srecord::input_file_msbin, srecord::input_file_needham, srecord::input_file_os65v, srecord::input_file_ppb, srecord::input_file_ppx, srecord::input_file_signetics, srecord::input_file_spasm, srecord::input_file_spectrum, srecord::input_file_stewie, srecord::input_file_tektronix, srecord::input_file_tektronix_extended, srecord::input_file_ti_tagged, srecord::input_file_ti_tagged_16, srecord::input_file_ti_txt, srecord::input_file_trs80, srecord::input_file_vmem, srecord::input_file_wilson, srecord::input_filter, srecord::input_generator_constant, srecord::input_generator_random, and srecord::input_generator_repeat.

References get_file_format_name().

Referenced by get_file_format_name().

## ◆ set_quit()

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.

References set_quit().

Referenced by set_quit().

## ◆ reset_quit()

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.

References reset_quit().

Referenced by reset_quit().

## ◆ disable_checksum_validation()

virtual void srecord::input::disable_checksum_validation | ( | void |  | ) |
| pure virtual

The disable_checksum_validation method is used to have this input stream ignore checksum errors.

Implemented in srecord::input_catenate, srecord::input_file, srecord::input_filter, and srecord::input_generator.

References disable_checksum_validation().

Referenced by disable_checksum_validation().

## ◆ command_line()

virtual void srecord::input::command_line | ( | srecord::arglex_tool * | cmdln | ) |
| 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.

Parameters

  cmdln | Where to obtain information about the curreent parse state of the command line.

Reimplemented in srecord::input_file_hp64k, srecord::input_file_motorola, srecord::input_filter_byte_swap, srecord::input_filter_message_crc16, srecord::input_filter_message_crc32, srecord::input_filter_message_fletcher16, and srecord::input_filter_message_stm32.

References command_line().

Referenced by command_line().

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

- input.h