srecord  1.65.0
srecord::output_file_hexdump Class Reference

The srecord::output_file_hexdump class is used to represent an output file which emits a hexadecimal dump (including ASCII) of the data. More...

#include <hexdump.h>

Inheritance diagram for srecord::output_file_hexdump:
Collaboration diagram for srecord::output_file_hexdump:

Public Member Functions

virtual ~output_file_hexdump ()
 The destructor. More...
 
- Public Member Functions inherited from srecord::output_file
virtual ~output_file ()
 The destructor. More...
 
 output_file ()
 The default constructor. More...
 
 output_file (const std::string &file_name)
 The constructor. More...
 
virtual const std::string filename (void) const
 The filename method is used to determine the name of the output file. More...
 
- Public Member Functions inherited from srecord::output
virtual ~output ()
 The destructor. More...
 
virtual void write_header (const record *=0)
 The write_header method is used to write a header record to the output. More...
 
virtual void write_data (unsigned long, const void *, size_t)
 The write_data method is used to write data to the output. More...
 
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. More...
 
virtual void fatal_error (const char *fmt,...) const FORMAT_PRINTF(2
 The fatal_error method is used to report fatal errors. More...
 
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. More...
 
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. More...
 
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. More...
 
virtual void warning (const char *fmt,...) const FORMAT_PRINTF(2
 The warning method is used to likely but non-fatal errors. More...
 
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. More...
 
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. More...
 

Static Public Member Functions

static pointer create (const std::string &file_name)
 The create class method is used to create new dynamically allocated instances of this class. More...
 
- Static Public Member Functions inherited from srecord::output_file
static void enable_header (bool yesno)
 The enable_header class method is used to enable or disable the writing of header records into output file, if the format supports optional header records. More...
 
static void enable_data_count (bool yesno)
 The enable_data_count class method is used to enable or disable the writing of data record count records into output file, if the format supports optional data record count records. More...
 
static void enable_goto_addr (bool yesno)
 The enable_goto_addr class method is used to enable or disable the writing of execution start address records into output file, if the format supports optional execution start address records. More...
 
static void enable_footer (bool yesno)
 The enable_footer class method is used to enable or disable the writing of footer records into output file, if the format supports optional footer records. More...
 
static bool enable_by_name (const std::string &name, bool yesno)
 The enable_by_name class method is used to enable or disable the writing of various records into output file. More...
 
static bool line_termination_by_name (const std::string &name)
 The line_termination_by_name method is used to force line termination to a particular style, rather than the current operating system's native text format. More...
 

Protected Member Functions

void write (const record &)
 The write method is used to write a recordonto an output. More...
 
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. More...
 
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. More...
 
int preferred_block_size_get (void) const
 The preferred_block_size_get method is used to get the proferred block size of the output fformat. More...
 
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. More...
 
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. More...
 
const char * format_name (void) const
 The format_name method is used to obtain the name of this output format. More...
 
- Protected Member Functions inherited from srecord::output_file
virtual void put_char (int c)
 The put_char method is used to send a character to the output. More...
 
void put_nibble (int value)
 The put_nibble method is used to send a hexadecimal digit (0..9, A..F) to the output. More...
 
virtual void put_byte (unsigned char value)
 The put_byte method is used to send a byte value to the output. More...
 
virtual void put_word_be (int value)
 The put_word_be method is used to send a 16-bit value to the output. More...
 
virtual void put_word_le (int value)
 The put_word_le method is used to send a 16-bit value to the output. More...
 
virtual void put_3bytes_be (unsigned long value)
 The put_3bytes_be method is used to send a 24-bit value to the output. More...
 
virtual void put_3bytes_le (unsigned long value)
 The put_3bytes_le method is used to send a 24-bit value to the output. More...
 
virtual void put_4bytes_be (unsigned long value)
 The put_4bytes_be method is used to send a 32-bit value to the output. More...
 
virtual void put_4bytes_le (unsigned long value)
 The put_4bytes_le method is used to send a 32-bit value to the output. More...
 
void checksum_reset (void)
 The checksum_reset method is used to set the running checksum to zero. More...
 
virtual void checksum_add (unsigned char n)
 The checksum_add method is used to add another 8-bit value to the running checksum. More...
 
int checksum_get (void)
 The checksum_get method is used to get the current value of the running checksum (added to by the checksum_add method, usually called by the put_byte method). More...
 
int checksum_get16 (void)
 The checksum_get16 method is used to get the current value of the running checksum (added to by the checksum_add method, usually called by the put_byte method). More...
 
void seek_to (unsigned long)
 The seek_to method is used to move the output position to the specified location in the output file. More...
 
void put_string (const char *text)
 The put_string method is used to send a nul-terminated C string to the output. More...
 
void put_string (const std::string &text)
 The put_string method is used to send C++ string to the output. More...
 
void put_stringf (const char *,...) FORMAT_PRINTF(2
 The put_stringf method is used to send a formatted string to the output. More...
 
void fatal_alignment_error (int alignment)
 The fatal_alignment_error method is used to report problems with unaligned data in formats that require aligned data. More...
 
void fatal_hole_error (unsigned long lo, unsigned long hi)
 The fatal_hole_error method is used to report problems with holes in the data, for formats that cannot cope with them. More...
 
void data_address_too_large (const record &record, unsigned nbits) const
 The data_address_too_large method is used to report fatal problems with data records, in the case where some or all of the address span of a record falls outside the format's ability to represent addresses. More...
 
- Protected Member Functions inherited from srecord::output
 output ()
 The default constructor. More...
 

Additional Inherited Members

- Public Types inherited from srecord::output
typedef std::shared_ptr< outputpointer
 
- Protected Types inherited from srecord::output_file
enum  line_termination_t {
  line_termination_native , line_termination_crlf , line_termination_nl , line_termination_binary = line_termination_nl ,
  line_termination_cr , line_termination_primos
}
 
- Static Protected Member Functions inherited from srecord::output_file
static void enable_optional_address (bool yesno)
 The enable_footer class method is used to enable or disable emitting optional address records. More...
 
static line_termination_t line_termination_guess (void)
 The line_termination_guess class method is used to figure out the line termination style of the host environment. More...
 
- Protected Attributes inherited from srecord::output_file
int checksum
 The checksum instance variable is used record the running checksum. More...
 
- Static Protected Attributes inherited from srecord::output_file
void static bool enable_header_flag
 The enable_header_flag class variable is set by the enable_header method, to remember whether or not header records are to be emitted (if the format supports optional header records). More...
 
static bool enable_data_count_flag
 The enable_data_count_flag class variable is set by the enable_data_count method, to remember whether or not data record count records are to be emitted (if the format supports optional data record count records). More...
 
static bool enable_goto_addr_flag
 The enable_goto_addr_flag class variable is set by the enable_goto_addr method, to remember whether or not execution start address records are to be emitted (if the format supports optional execution start address records). More...
 
static bool enable_footer_flag
 The enable_footer_flag class variable is set by the enable_footer method, to remember whether or not footer records (end-of-file record) are to be emitted (if the format supports optional footer records). More...
 
static bool enable_optional_address_flag
 The enable_optional_address_records class variable is used to remember whether or not to emit optional address records. More...
 
static line_termination_t line_termination
 The line_termination class variable is used to remember the desired line termination style. More...
 

Detailed Description

The srecord::output_file_hexdump class is used to represent an output file which emits a hexadecimal dump (including ASCII) of the data.

Definition at line 32 of file hexdump.h.

Constructor & Destructor Documentation

◆ ~output_file_hexdump()

virtual srecord::output_file_hexdump::~output_file_hexdump ( )
virtual

The destructor.

Member Function Documentation

◆ create()

static pointer srecord::output_file_hexdump::create ( const std::string &  file_name)
static

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

Parameters
file_nameThe name of the file to be written.

◆ write()

void srecord::output_file_hexdump::write ( const record rec)
protectedvirtual

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

Derived classes must implement this method.

Parameters
recThe record to be written.

Implements srecord::output.

◆ line_length_set()

void srecord::output_file_hexdump::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
colsThe page width in fixed width text columns.

Implements srecord::output.

◆ address_length_set()

void srecord::output_file_hexdump::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
nbytesThe number of byte to use for the address (2..4).

Implements srecord::output.

◆ preferred_block_size_get()

int srecord::output_file_hexdump::preferred_block_size_get ( void  ) 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.

◆ preferred_block_size_set()

bool srecord::output_file_hexdump::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
nbytesThe 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.

◆ command_line()

void srecord::output_file_hexdump::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
cmdlnWhere to obtain information about the curreent parse stat of the command line.

Reimplemented from srecord::output.

◆ format_name()

const char* srecord::output_file_hexdump::format_name ( void  ) const
protectedvirtual

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

Implements srecord::output.


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