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