| AVR Z-LINKŪ |

# hexfile.cpp File Reference

## Detailed Description

Source file for a simple Intel HEX file writer.

- File: hexfile.cpp
- Compiler: Any PC C++ Compiler
- AppNote: AVR414 - User's Guide - ATAVRRZ502 - Accessory Kit

Author:
  Atmel Corporation: http://www.atmel.com
  Support email: avr@atmel.com

Name
  RELEASE_1_7

Revision
  1.3

Date
  2006/10/09 08:36:07

Copyright (c) 2006, Atmel Corporation All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. The name of ATMEL may not be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file hexfile.cpp.

`#include "hexfile.h"`
`#include <iomanip>`
`#include <stdexcept>`

Include dependency graph for hexfile.cpp:

Go to the source code of this file.

## Defines
#define | HEXDATARECORDTYPE ( (byte) 0x00 )
#define | HEXEOFRECORDTYPE ( (byte) 0x01 )
## Functions
std::ostream & | operator<< (std::ostream &os, const HEXFile &file)
HEXFile & | operator<< (HEXFile &file, const HEXRecord &record)
std::ostream & | operator<< (std::ostream &os, const HEXRecord &record)
HEXRecord & | operator<< (HEXRecord &record, std::vector< byte > data)
HEXRecord & | operator<< (HEXRecord &record, byte data)

## Define Documentation

#define HEXDATARECORDTYPE ( (byte) 0x00 )

HEX file record type ID for ordinary data records.

Definition at line 51 of file hexfile.cpp.

Referenced by HEXRecord::Print().

#define HEXEOFRECORDTYPE ( (byte) 0x01 )

HEX file record type ID for End-of-File records.

Definition at line 53 of file hexfile.cpp.

## Function Documentation

std::ostream& operator<< | ( | std::ostream & | os,
|  | const HEXFile & | file |
| ) |  |  |

Overloaded insertion operator to print a HEX file to an output stream.

Definition at line 157 of file hexfile.cpp.

References HEXFile::Print().

    00158 {
    00159         file.Print( os );
    00160         return os;
    00161 }

Here is the call graph for this function:

HEXFile& operator<< | ( | HEXFile & | file,
|  | const HEXRecord & | record |
| ) |  |  |

Overloaded insertion operator to add one record to a HEX file.

Definition at line 149 of file hexfile.cpp.

    00150 {
    00151         file.Add( record );
    00152         return file;
    00153 }

std::ostream& operator<< | ( | std::ostream & | os,
|  | const HEXRecord & | record |
| ) |  |  |

Overloaded insertion operator to print a record to an output stream.

Definition at line 131 of file hexfile.cpp.

    00132 {
    00133         record.Print( os );
    00134         return os;
    00135 }

HEXRecord& operator<< | ( | HEXRecord & | record,
|  | std::vector< byte > | data |
| ) |  |  |

Overloaded insertion operator to add a set of data bytes to a record.

Definition at line 123 of file hexfile.cpp.

    00124 {
    00125         record.Add( data );
    00126         return record;
    00127 }

HEXRecord& operator<< | ( | HEXRecord & | record,
|  | byte | data |
| ) |  |  |

Overloaded insertion operator to add one data byte to a record.

Definition at line 115 of file hexfile.cpp.

    00116 {
    00117         record.Add( data );
    00118         return record;
    00119 }

@DOC_TITLE@