BinaryReader.h revision 87f34658dec9097d987d254a990ea7f311bfc95f
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_LD_BINARYREADER_H 10#define MCLD_LD_BINARYREADER_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{ 28public: 29 virtual ~BinaryReader() = 0; 30 31 virtual bool isMyFormat(Input& pInput, bool &pContinue) const 32 { pContinue = true; return false; } 33 34 virtual bool readBinary(Input& pFile) = 0; 35}; 36 37} // namespace of mcld 38 39#endif 40 41