srecord  1.65.0
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:

Public Types

typedef std::shared_ptr< inputpointer
 

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...
 

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.

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
recWhere to put the returned data.
Returns
bool; true if data was read, false if at end-of-file

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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_file, srecord::input_generator_repeat, srecord::input_generator_random, srecord::input_generator_constant, srecord::input_filter, and srecord::input_catenate.

◆ 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_file, srecord::input_filter, and srecord::input_catenate.

◆ get_file_format_name()

virtual const char* srecord::input::get_file_format_name ( void  ) const
pure virtual

◆ 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.

◆ 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.

◆ 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_file, srecord::input_generator, srecord::input_filter, and srecord::input_catenate.

◆ 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
cmdlnWhere 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.


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