srecord: srecord::output Class Reference

srecord 1.65.0

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

The srecord::output class is used to represent an abstract output vector. More...

`#include <output.h>`

Inheritance diagram for srecord::output:
[legend]

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

## Public Member Functions
virtual | ~output ()
| The destructor.
virtual void | write (const record &rec)=0
| The write method is used to write a recordonto an output.
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 | line_length_set (int cols)=0
| 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.
virtual void | address_length_set (int nbytes)=0
| 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.
virtual int | preferred_block_size_get (void) const =0
| The preferred_block_size_get method is used to get the proferred block size of the output fformat.
virtual bool | preferred_block_size_set (int nbytes)=0
| The preferred_block_size_set method is is to set a precific number of bytes for the preferred block size.
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.
virtual const std::string | filename (void) const =0
| The filename method is used to determine the name of the output file.
virtual const char * | format_name (void) const =0
| The format_name method is used to obtain the name of this output format.
virtual 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.
virtual 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
| output ()
| The default constructor.

## Detailed Description

The srecord::output class is used to represent an abstract output vector.

It could be a file, it could be a filter first, before it reaches a file.

Definition at line 38 of file output.h.

## Member Typedef Documentation

## ◆ pointer

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

Definition at line 41 of file output.h.

## Constructor & Destructor Documentation

## ◆ ~output()

virtual srecord::output::~output | ( |  | ) |
| virtual

The destructor.

## ◆ output()

srecord::output::output | ( |  | ) |
| protected

The default constructor.

Only derived classes may use.

References output().

Referenced by output().

## Member Function Documentation

## ◆ write()

virtual void srecord::output::write | ( | const record & | rec | ) |
| pure virtual

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

Derived classes must implement this method.

Parameters

  rec | The record to be written.

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, srecord::output_filter, and srecord::output_filter_reblock.

## ◆ write_header()

virtual void srecord::output::write_header | ( | const record * | = 0 | ) |
| virtual

The write_header method is used to write a header record to the output.

If no record is specified, a default record will be supplied. The write method will be called.

## ◆ write_data()

virtual void srecord::output::write_data | ( | unsigned long | ,
|  | const void * | ,
|  | size_t | )
| virtual

The write_data method is used to write data to the output.

A suitable data record wil be produced. The write method will be called.

## ◆ write_execution_start_address()

virtual void srecord::output::write_execution_start_address | ( | const record * | = 0 | ) |
| virtual

The write_execution_start_address method is used to write an execution start address record to the output.

If no record is specified, a default record will be supplied. The write method will be called.

## ◆ line_length_set()

virtual void srecord::output::line_length_set | ( | int | cols | ) |
| pure virtual

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.

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, srecord::output_filter, and srecord::output_filter_reblock.

## ◆ address_length_set()

virtual void srecord::output::address_length_set | ( | int | nbytes | ) |
| pure virtual

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

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, srecord::output_filter, and srecord::output_filter_reblock.

## ◆ preferred_block_size_get()

virtual int srecord::output::preferred_block_size_get | ( | void |  | ) | const
| pure virtual

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.

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, srecord::output_filter, and srecord::output_filter_reblock.

## ◆ preferred_block_size_set()

virtual bool srecord::output::preferred_block_size_set | ( | int | nbytes | ) |
| pure virtual

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.

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, srecord::output_filter, and srecord::output_filter_reblock.

## ◆ fatal_error()

virtual void srecord::output::fatal_error | ( | const char * | fmt,
|  |  | ... ) const
| virtual

The fatal_error method is used to report fatal errors.

The 'fmt' string is in the same style a standard C printf function. It calls the fatal_error_v method. This method does not return.

References FORMAT_PRINTF.

## ◆ fatal_error_v()

virtual void virtual void srecord::output::fatal_error_v | ( | const char * | fmt,
|  | va_list | ap ) const
| virtual

The fatal_error_v method is used to report fatal errors.

The 'fmt' string is in the same style a standard C vprintf function. It calls global exit. This method does not return.

References fatal_error_v().

Referenced by fatal_error_v().

## ◆ fatal_error_errno()

virtual void srecord::output::fatal_error_errno | ( | const char * | fmt,
|  |  | ... ) const
| virtual

The fatal_error_errno method is used to report fatal errors, and append the string equivalent of errno.

The 'fmt' string is in the same style a standard C printf function. It calls global exit(). This method does not return.

References fatal_error_errno(), and FORMAT_PRINTF.

Referenced by fatal_error_errno().

## ◆ fatal_error_errno_v()

virtual void virtual void srecord::output::fatal_error_errno_v | ( | const char * | fmt,
|  | va_list | ap ) const
| virtual

The fatal_error_errno_v method is used to report fatal errors.

The 'fmt' string is in the same style a standard C vprintf function. It calls the global exit function. This method does not return.

References fatal_error_errno_v().

Referenced by fatal_error_errno_v().

## ◆ warning()

virtual void srecord::output::warning | ( | const char * | fmt,
|  |  | ... ) const
| virtual

The warning method is used to likely but non-fatal errors.

The 'fmt' string is in the same style a standard C printf function. It calls the warning_v method.

References FORMAT_PRINTF, and warning().

Referenced by warning().

## ◆ warning_v()

virtual void virtual void srecord::output::warning_v | ( | const char * | fmt,
|  | va_list | ap ) const
| virtual

The warning_v method is used to report likely but non-fatal errors.

The 'fmt' string is in the same style a standard C vprintf function.

References warning_v().

Referenced by warning_v().

## ◆ filename()

virtual const std::string srecord::output::filename | ( | void |  | ) | const
| pure virtual

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.

Implemented in srecord::output_file, and srecord::output_filter.

References filename().

Referenced by filename().

## ◆ format_name()

virtual const char * srecord::output::format_name | ( | void |  | ) | const
| pure virtual

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

Implemented in srecord::output_file_aomf, srecord::output_file_ascii_hex, srecord::output_file_asm, srecord::output_file_atmel_generic, srecord::output_file_basic, srecord::output_file_binary, srecord::output_file_brecord, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_cosmac, srecord::output_file_dec_binary, srecord::output_file_emon52, srecord::output_file_fairchild, srecord::output_file_fastload, srecord::output_file_formatted_binary, srecord::output_file_forth, srecord::output_file_four_packed_code, srecord::output_file_hexdump, srecord::output_file_idt, srecord::output_file_intel16, srecord::output_file_intel, srecord::output_file_logisim, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_mips_flash, srecord::output_file_mos_tech, srecord::output_file_motorola, srecord::output_file_msbin, srecord::output_file_needham, srecord::output_file_os65v, srecord::output_file_ppb, srecord::output_file_ppx, srecord::output_file_signetics, srecord::output_file_spasm, srecord::output_file_spectrum, srecord::output_file_stewie, srecord::output_file_tektronix, srecord::output_file_tektronix_extended, srecord::output_file_ti_tagged, srecord::output_file_ti_tagged_16, srecord::output_file_ti_txt, srecord::output_file_trs80, srecord::output_file_vhdl, srecord::output_file_vmem, srecord::output_file_wilson, and srecord::output_filter.

References format_name().

Referenced by format_name().

## ◆ notify_upper_bound()

virtual void srecord::output::notify_upper_bound | ( | unsigned long | addr | ) |
| virtual

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 in srecord::output_file_coe, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_msbin, and srecord::output_filter.

References notify_upper_bound().

Referenced by notify_upper_bound().

## ◆ command_line()

virtual void srecord::output::command_line | ( | arglex_tool * | cmdln | ) |
| virtual

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 in srecord::output_file_asm, srecord::output_file_c, srecord::output_file_coe, srecord::output_file_forth, srecord::output_file_hexdump, srecord::output_file_mem, srecord::output_file_mif, srecord::output_file_motorola, srecord::output_file_vhdl, srecord::output_file_vmem, and srecord::output_filter.

References command_line().

Referenced by command_line().

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

- output.h