1//===- BinaryReader.h -----------------------------------------------------===// 2// 3// The MCLinker Project 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9#ifndef MCLD_Binary_READER_H 10#define MCLD_Binary_READER_H 11#ifdef ENABLE_UNITTEST 12#include <gtest.h> 13#endif 14#include "mcld/LD/LDReader.h" 15#include <llvm/Support/system_error.h> 16 17namespace mcld { 18 19class Module; 20class Input; 21 22/** \class BinaryReader 23 * \brief BinaryReader provides an common interface for different Binary 24 * formats. 25 */ 26class BinaryReader : public LDReader 27{ 28protected: 29 BinaryReader() 30 { } 31 32public: 33 virtual ~BinaryReader() 34 { } 35 36 virtual bool isMyFormat(Input& pInput) const 37 { return true; } 38 39 virtual bool readBinary(Input& pFile) = 0; 40}; 41 42} // namespace of mcld 43 44#endif 45 46