srecord: srecord::input_filter Class Reference

srecord 1.65.0

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

The srecord::input_filter class is an abstract interface for all of the various filters that can be applied to an incoming EPROM file. More...

`#include <filter.h>`

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

## Public Member Functions
virtual | ~input_filter ()
| The destructor.
bool | read (class record &record)
| The read method is used to read one record from the input.
std::string | filename () const
| The filename method is used to get the name of the input file being processed.
std::string | filename_and_line () const
| The filename_and_line method is used to get the name and current line number within the file.
const char * | get_file_format_name () const
| The get_file_format_name method is used to find out the name of the file format being read.
void | disable_checksum_validation ()
| The disable_checksum_validation method is used to have this input stream ignore checksum errors.
Public Member Functions inherited from srecord::input
virtual | ~input ()
| The destructor.
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.
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 | 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_filter (input::pointer deeper)
| The constructor.
Protected Member Functions inherited from srecord::input
| input ()
| The default constructor.

## Protected Attributes
pointer | ifp

## Additional Inherited Members
Public Types inherited from srecord::input
typedef std::shared_ptr< input > | pointer

## Detailed Description

The srecord::input_filter class is an abstract interface for all of the various filters that can be applied to an incoming EPROM file.

Each filter is-a input, but each also has-a deeper input, from which is obtained the data to be filtered.

Definition at line 35 of file filter.h.

## Constructor & Destructor Documentation

## ◆ ~input_filter()

virtual srecord::input_filter::~input_filter | ( |  | ) |
| virtual

The destructor.

## ◆ input_filter()

srecord::input_filter::input_filter | ( | input::pointer | deeper | ) |
| protected

The constructor.

Only derived classes may call.

Parameters

  deeper | The deeper input to be filtered.

## Member Function Documentation

## ◆ read()

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

Implements srecord::input.

Reimplemented in 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, and srecord::input_filter_xor.

## ◆ filename()

std::string srecord::input_filter::filename | ( |  | ) | const
| virtual

The filename method is used to get the name of the input file being processed.

Derived classes must supply this method.

Implements srecord::input.

## ◆ filename_and_line()

std::string srecord::input_filter::filename_and_line | ( |  | ) | 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 from srecord::input.

## ◆ get_file_format_name()

const char * srecord::input_filter::get_file_format_name | ( |  | ) | const
| 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.

Implements srecord::input.

## ◆ disable_checksum_validation()

void srecord::input_filter::disable_checksum_validation | ( |  | ) |
| virtual

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

Implements srecord::input.

## Member Data Documentation

## ◆ ifp

pointer srecord::input_filter::ifp
| protected

Definition at line 73 of file filter.h.

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

- input/filter.h