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