blob: 829d96ac08c4cc8c9bb0ba518d3d39b4b170c813 (
plain)
1 // Copyright (C) 2016 James Buren
2 //
3 // This file is part of revdep.
4 //
5 // revdep is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // revdep is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with revdep. If not, see <http://www.gnu.org/licenses/>.
17
18 #pragma once
19
20 #include "elf.h"
21 #include "pkg.h"
22 #include <unordered_map>
23
24 typedef std::unordered_map <std::string, Elf *> ElfMap;
25
26 class ElfCache {
27 private:
28 ElfMap _data;
29 bool findLibraryByDirs(const Elf *elf, const std::string &lib, const StringVector &dirs);
30 bool findLibraryByPath(const Elf *elf, const std::string &lib);
31
32 public:
33 ~ElfCache();
34 const Elf *LookUp(const std::string &path);
35 bool FindLibrary(const Elf *elf, const Package &pkg, const std::string &lib, const StringVector &dirs);
36 };
|