| AVR Z-LINKŪ |

# HEXFile Class Reference

`#include <hexfile.h>`

## Detailed Description

This class contains all records of a HEX file.

Definition at line 95 of file hexfile.h.

## Public Member Functions
void | Add (const HEXRecord &record, size_t copies)
void | Add (const HEXRecord &record)
| HEXFile ()
void | Print (std::ostream &os) const
| ~HEXFile ()
## Private Attributes
unsigned long | m_nextAddress
std::vector< HEXRecord > | m_records

## Constructor & Destructor Documentation

HEXFile::HEXFile | ( |  | ) | `[inline]`

Default ctor.

Definition at line 103 of file hexfile.h.

    00103 : m_nextAddress( 0 ) {}

HEXFile::~HEXFile | ( |  | ) | `[inline]`

Definition at line 104 of file hexfile.h.

    00104 {}

## Member Function Documentation

void HEXFile::Add | ( | const HEXRecord & | record,
|  | size_t | copies |
| ) |  |  | `[inline]`

Add several records to the end of the file.

Definition at line 113 of file hexfile.h.

References Add().

    00113                                                             {
    00114                 while( copies-- ) {
    00115                         Add( record );
    00116                 }
    00117         }

Here is the call graph for this function:

void HEXFile::Add | ( | const HEXRecord & | record | ) | `[inline]`

Add one record to the end of the file.

Definition at line 107 of file hexfile.h.

References HEXRecord::GetByteCount(), m_nextAddress, and m_records.

Referenced by Add(), and operator<<().

    00107                                              {
    00108                 m_records.push_back( record );
    00109                 m_records.back().SetAddress( m_nextAddress );
    00110                 m_nextAddress += record.GetByteCount();
    00111         }

Here is the call graph for this function:

void HEXFile::Print | ( | std::ostream & | os | ) | const

Print whole file to an output stream.

Definition at line 139 of file hexfile.cpp.

References m_records.

Referenced by operator<<().

    00140 {
    00141         for( size_t idx = 0; idx < m_records.size(); ++idx ) {
    00142                 os << m_records.at( idx );
    00143         }
    00144         os << ":00000001ff" << std::endl;
    00145 }

## Field Documentation

unsigned long HEXFile::m_nextAddress`[private]`

Start address to be used for the next added record.

Definition at line 99 of file hexfile.h.

Referenced by Add().

std::vector< HEXRecord > HEXFile::m_records`[private]`

Container for the records.

Definition at line 98 of file hexfile.h.

Referenced by Add(), and Print().

@DOC_TITLE@