#pragma once #include #include #include #include #include #include #include namespace EightBit { class IntelHexFile { public: IntelHexFile(std::string path); [[nodiscard]] std::map> parse(); private: [[nodiscard]] std::optional>> parse(std::string line); [[nodiscard]] std::vector parseDataRecord(std::string line, uint8_t count); template T fromHex(std::string input) { std::istringstream converter(input); unsigned output; converter >> std::hex >> output; return static_cast(output); } std::ifstream m_file; bool m_eof; }; }