srecord 1.65.0
 
Loading...
Searching...
No Matches
srecord::input_filter_split Class Reference

The srecord::input_filter_split class is used to represent a filter which splits ints input source into piceces. More...

#include <split.h>

Inheritance diagram for srecord::input_filter_split:
Collaboration diagram for srecord::input_filter_split:

Public Member Functions

virtual ~input_filter_split ()
 The destructor.
 
- Public Member Functions inherited from srecord::input_filter
virtual ~input_filter ()
 The destructor.
 
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.
 

Static Public Member Functions

static pointer create (const input::pointer &deeper, int modulus, int offset, int width)
 The create class method is used to create new dynamically allocated instances of this class.
 

Protected Member Functions

bool read (record &record)
 The read method is used to read one record from the input.
 
- Protected Member Functions inherited from srecord::input_filter
 input_filter (input::pointer deeper)
 The constructor.
 
- Protected Member Functions inherited from srecord::input
 input ()
 The default constructor.
 

Additional Inherited Members

- Public Types inherited from srecord::input
typedef std::shared_ptr< inputpointer
 
- Protected Attributes inherited from srecord::input_filter
pointer ifp
 

Detailed Description

The srecord::input_filter_split class is used to represent a filter which splits ints input source into piceces.

The data of each swathe then has the address adjusted to fill in the gaps.

For example, this filter can be used to create each of the images for 8-bit EPROMS for systems which use a 16-bit bus.

Note that you need to invoke this filter N times when you have N swathes, once for each swathe.

          --> |    modulus    | <--
Input data:   |               |
~-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-~
  |   | X | X | 0 | 1 | X | X | 4 | 5 | X | X | 8 | 9 | X | X |   |
~-+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+-~
              |       |      /       /       /       /
              |       |     /       /      /       /
              |       |    /       /     /       /
              |       |   /       /    /       /    This diagram shows
              |       |  /       /   /       /      offset zero.  You
              |       | /       /  /       /        would need a second
Output data:  |       |/       //       /           pass with an offset
~-+---+---+---+---+---+---+---+---+---+---+---+-~   of two for the other
  |   |   |   | 0 | 1 | 4 | 5 | 8 | 9 |   |   |     half of the data.
~-+---+---+---+---+---+---+---+---+---+---+---+-~
              |       |
          --> | width | <--                                           

Definition at line 59 of file split.h.

Constructor & Destructor Documentation

◆ ~input_filter_split()

virtual srecord::input_filter_split::~input_filter_split ( )
virtual

The destructor.

Member Function Documentation

◆ create()

static pointer srecord::input_filter_split::create ( const input::pointer & deeper,
int modulus,
int offset,
int width )
static

The create class method is used to create new dynamically allocated instances of this class.

Parameters
deeperThe incoming data source to be filtered
modulusThe number of bytes wide each swathe is.
offsetThe offset within the swathe.
widthThe width of each stripe within the swathe.

◆ read()

bool srecord::input_filter_split::read ( record & rec)
protectedvirtual

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

Reimplemented from srecord::input_filter.


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