#include #include class HexReader { public: HexReader(const char* filename); ~HexReader(); bool eof() { return m_EndOfFile; } unsigned long getByte(); unsigned long getAddress(); void dump(); private: // Read some hex digits from the current line unsigned long getHex(int length); // PreFetch Next Byte void PreFetch(); unsigned long m_PreFetchByte; // Running Check Sum Count unsigned long m_CheckSumCalc; // Input file pointer FILE* m_InputFile; // Address info unsigned long m_ExtendedAddress; unsigned long m_Address; // Current Line and a strstream to parse it char m_CurrentLine[256]; istrstream* m_Parser; // Record of where in the file you are bool m_EndOfFile; bool m_LineStarted; unsigned long m_BytesToEndOfLine; };