LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
MapList.hpp
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16#ifndef LIEF_MAP_LIST_H
17#define LIEF_MAP_LIST_H
18#include <map>
19#include <vector>
20
21#include "LIEF/visibility.h"
22#include "LIEF/iterators.hpp"
23#include "LIEF/Object.hpp"
24
25#include "LIEF/DEX/MapItem.hpp"
26
27namespace LIEF {
28namespace DEX {
29class Parser;
30class Class;
31
37class LIEF_API MapList : public Object {
38 friend class Parser;
39
40 public:
41 using items_t = std::map<MapItem::TYPES, MapItem>;
44
45 public:
46 MapList();
47
48 MapList(const MapList&);
49 MapList& operator=(const MapList&);
50
53 it_const_items_t items() const;
54
56 bool has(MapItem::TYPES type) const;
57
59 const MapItem& get(MapItem::TYPES type) const;
60
62 MapItem& get(MapItem::TYPES type);
63
65 const MapItem& operator[](MapItem::TYPES type) const;
66
68 MapItem& operator[](MapItem::TYPES type);
69
70 void accept(Visitor& visitor) const override;
71
72
73 LIEF_API friend std::ostream& operator<<(std::ostream& os, const MapList& mtd);
74
75 ~MapList() override;
76
77 private:
78 items_t items_;
79
80};
81
82} // Namespace DEX
83} // Namespace LIEF
84#endif
Class which represents an element of the MapList object.
Definition MapItem.hpp:31
Class which represents the map_list structure that follows the main DEX header.
Definition MapList.hpp:37
const MapItem & operator[](MapItem::TYPES type) const
Return the LIEF::DEX::MapItem associated with the given type.
const MapItem & get(MapItem::TYPES type) const
Return the LIEF::DEX::MapItem associated with the given type.
it_items_t items()
Iterator over LIEF::DEX::MapItem.
MapItem & get(MapItem::TYPES type)
Return the LIEF::DEX::MapItem associated with the given type.
MapItem & operator[](MapItem::TYPES type)
Return the LIEF::DEX::MapItem associated with the given type.
bool has(MapItem::TYPES type) const
Check if the given type exists.
Class which parses a DEX file to produce a DEX::File object.
Definition DEX/Parser.hpp:38
Definition Object.hpp:25
Definition Visitor.hpp:219
Iterator which returns reference on container's values.
Definition iterators.hpp:48
LIEF namespace.
Definition Abstract/Binary.hpp:32