1 //===- ArchiveReader.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_ARCHIVEREADER_H_ 10 #define MCLD_LD_ARCHIVEREADER_H_ 11 #include "mcld/LD/LDReader.h" 12 13 namespace mcld { 14 15 class Archive; 16 class LinkerConfig; 17 18 /** \class ArchiveReader 19 * \brief ArchiveReader provides an common interface for all archive readers. 20 * 21 * ArchiveReader also reads the target-independent parts of an archive file. 22 * There are some property on all the archive formats. 23 * 1. All archive elements star on an even boundary, new line padded; 24 * 2. All archive headers are char *; 25 * 3. All archive headers are the same size. 26 */ 27 28 class ArchiveReader : public LDReader { 29 public: 30 ArchiveReader(); 31 virtual ~ArchiveReader(); 32 33 virtual bool readArchive(const LinkerConfig& pConfig, Archive& pArchive) = 0; 34 }; 35 36 } // namespace mcld 37 38 #endif // MCLD_LD_ARCHIVEREADER_H_ 39