srecord: srecord::output_filter Class Reference

srecord 1.65.0

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

The output_filter class is used to represent a generic output manipulation. More...

`#include <filter.h>`

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

## Public Member Functions
virtual | ~output_filter ()
| The destructor.
Public Member Functions inherited from srecord::output
virtual | ~output ()
| The destructor.
virtual void | write_header (const record *=0)
| The write_header method is used to write a header record to the output.
virtual void | write_data (unsigned long, const void *, size_t)
| The write_data method is used to write data to the output.
virtual void | write_execution_start_address (const record *=0)
| The write_execution_start_address method is used to write an execution start address record to the output.
virtual void | fatal_error (const char *fmt,...) const FORMAT_PRINTF(2
| The fatal_error method is used to report fatal errors.
virtual void virtual void | fatal_error_v (const char *fmt, va_list ap) const
| The fatal_error_v method is used to report fatal errors.
virtual void | fatal_error_errno (const char *fmt,...) const FORMAT_PRINTF(2
| The fatal_error_errno method is used to report fatal errors, and append the string equivalent of errno.
virtual void virtual void | fatal_error_errno_v (const char *fmt, va_list ap) const
| The fatal_error_errno_v method is used to report fatal errors.
virtual void | warning (const char *fmt,...) const FORMAT_PRINTF(2
| The warning method is used to likely but non-fatal errors.
virtual void virtual void | warning_v (const char *fmt, va_list ap) const
| The warning_v method is used to report likely but non-fatal errors.

## Protected Member Functions
| output_filter (const output::pointer &deeper)
| The constructor.
void | write (const record &r)
| The write method is used to write a recordonto an output.
void | line_length_set (int)
| The set_line_length method is used to set the maximum length of an output line, for those formats for which this is a meaningful concept, and the line length is at all controllable.
void | address_length_set (int)
| The address_length_set method is used to set the minimum number of bytes to be written for addresses in the output, for those formats for which this is a meaningful concept, and the address length is at all controllable.
int | preferred_block_size_get () const
| The preferred_block_size_get method is used to get the proferred block size of the output fformat.
bool | preferred_block_size_set (int nbytes)
| The preferred_block_size_set method is is to set a precific number of bytes for the preferred block size.
const std::string | filename () const
| The filename method is used to determine the name of the output file.
const char * | format_name () const
| The format_name method is used to obtain the name of this output format.
void | notify_upper_bound (unsigned long addr)
| The notify_upper_bound method is used to notify the output class of the upper bound (highest address plus one) of the output to come.
void | command_line (arglex_tool *cmdln)
| The command_line method is used by arglex_srec::get_output when parsing the command line, to give the format an opportunity to grab extra arguments off the command line.
Protected Member Functions inherited from srecord::output
| output ()
| The default constructor.

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

## Detailed Description

The output_filter class is used to represent a generic output manipulation.

Usually the major manipulations are done on input, these filters are output-specific.

Definition at line 31 of file filter.h.

## Constructor & Destructor Documentation

## ◆ ~output_filter()

virtual srecord::output_filter::~output_filter | ( |  | ) |
| virtual

The destructor.

## ◆ output_filter()

srecord::output_filter::output_filter | ( | const output::pointer & | deeper | ) |
| protected

The constructor.

For use by derived classes only.

Parameters

  deeper | Where to send our filtered output.

Referenced by command_line().

## Member Function Documentation

## ◆ write()

void srecord::output_filter::write | ( | const record & | rec | ) |
| protectedvirtual

The write method is used to write a recordonto an output.

Derived classes must implement this method.

Parameters

  rec | The record to be written.

Implements srecord::output.

Reimplemented in srecord::output_filter_reblock.

## ◆ line_length_set()

void srecord::output_filter::line_length_set | ( | int | cols | ) |
| protectedvirtual

The set_line_length method is used to set the maximum length of an output line, for those formats for which this is a meaningful concept, and the line length is at all controllable.

Derived classes must implement this method.

Parameters

  cols | The page width in fixed width text columns.

Implements srecord::output.

Reimplemented in srecord::output_filter_reblock.

## ◆ address_length_set()

void srecord::output_filter::address_length_set | ( | int | nbytes | ) |
| protectedvirtual

The address_length_set method is used to set the minimum number of bytes to be written for addresses in the output, for those formats for which this is a meaningful concept, and the address length is at all controllable.

Derived classes must implement this method.

Parameters

  nbytes | The number of byte to use for the address (2..4).

Implements srecord::output.

Reimplemented in srecord::output_filter_reblock.

## ◆ preferred_block_size_get()

int srecord::output_filter::preferred_block_size_get | ( |  | ) | const
| protectedvirtual

The preferred_block_size_get method is used to get the proferred block size of the output fformat.

Often, but not always, influenced by the line_lebgth_set method. Derived classes must implement this method.

Implements srecord::output.

Reimplemented in srecord::output_filter_reblock.

## ◆ preferred_block_size_set()

bool srecord::output_filter::preferred_block_size_set | ( | int | nbytes | ) |
| protectedvirtual

The preferred_block_size_set method is is to set a precific number of bytes for the preferred block size.

Parameters

  nbytes | The exact number of bytes to be returned by the preferred_block_size_get method.

Returns
  There are format-specific limitations on block sizes, this method will return true if the setting was acceptable, false if the format is incapable of using the specified block size.

Implements srecord::output.

Reimplemented in srecord::output_filter_reblock.

## ◆ filename()

const std::string srecord::output_filter::filename | ( |  | ) | const
| protectedvirtual

The filename method is used to determine the name of the output file.

It is used for the various error messages. Derived classes must implement this method.

Implements srecord::output.

## ◆ format_name()

const char * srecord::output_filter::format_name | ( |  | ) | const
| protectedvirtual

The format_name method is used to obtain the name of this output format.

Implements srecord::output.

## ◆ notify_upper_bound()

void srecord::output_filter::notify_upper_bound | ( | unsigned long | addr | ) |
| protectedvirtual

The notify_upper_bound method is used to notify the output class of the upper bound (highest address plus one) of the output to come.

Shall be called before the head or any data records are written.

Parameters

  addr | One past the highest used memory byte.

Reimplemented from srecord::output.

## ◆ command_line()

void srecord::output_filter::command_line | ( | arglex_tool * | cmdln | ) |
| protectedvirtual

The command_line method is used by arglex_srec::get_output when parsing the command line, to give the format 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 stat of the command line.

Reimplemented from srecord::output.

References output_filter().

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

- output/filter.h