bintools/checklib/library/library.h
changeset 0 044383f39525
equal deleted inserted replaced
-1:000000000000 0:044383f39525
       
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // Class for reading libraries in Unix "ar" format.
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef LIBRARY_H
       
    19 #define LIBRARY_H
       
    20 
       
    21 #include <vector>
       
    22 #include <utility>
       
    23 
       
    24 
       
    25 class Library
       
    26 {
       
    27 public:
       
    28     Library(const char a_file_name[]);
       
    29     ~Library();
       
    30 public:
       
    31     bool contains_symbol(const char[]) const;
       
    32 
       
    33     const std::vector< std::pair<const char*, const char*> >* get_objects() const;
       
    34 private:
       
    35     const char* _eat_ar_header(const char*, const char*) const;
       
    36     const char* _eat_sym_table(const char*, const char*) const;
       
    37     const char* _eat_junk_objs(const char*, const char*) const;
       
    38 
       
    39     const char* _eat_obj_header(const char*, const char*, unsigned long*, const char* = 0) const;
       
    40 
       
    41 private:
       
    42     const char* m_mem_p;
       
    43 
       
    44     const char* m_first_p;
       
    45     const char* m_last_p;
       
    46 
       
    47     mutable std::vector<const char*> m_symbols;
       
    48     mutable std::vector< std::pair<const char*, const char*> > m_objects;
       
    49 };
       
    50 
       
    51 
       
    52 #endif
       
    53