LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
Prototype.hpp
Go to the documentation of this file.
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_DEX_PROTOTYPE_H
17#define LIEF_DEX_PROTOTYPE_H
18
19#include "LIEF/visibility.h"
20#include "LIEF/Object.hpp"
21#include "LIEF/iterators.hpp"
22
23namespace LIEF {
24namespace DEX {
25class Parser;
26class Type;
27class LIEF_API Prototype : public Object {
30 friend class Parser;
31
32 public:
33 using parameters_type_t = std::vector<Type*>;
34 using it_params = ref_iterator<parameters_type_t>;
35 using it_const_params = const_ref_iterator<const parameters_type_t>;
36
37 public:
39 Prototype(const Prototype& other);
40 const Type* return_type() const;
43 Type* return_type();
44 it_const_params parameters_type() const;
47 it_params parameters_type();
48
49 void accept(Visitor& visitor) const override;
50
51
52 LIEF_API friend std::ostream& operator<<(std::ostream& os, const Prototype& type);
53
54 ~Prototype() override;
55
56 private:
57 Type* return_type_ = nullptr;
58 parameters_type_t params_;
59
60};
61
62} // Namespace DEX
63} // Namespace LIEF
64#endif
Class which parses a DEX file to produce a DEX::File object.
Definition DEX/Parser.hpp:38
Class which represents a DEX method prototype.
Definition Prototype.hpp:29
const Type * return_type() const
Type returned or a nullptr if not resolved.
Prototype(const Prototype &other)
friend std::ostream & operator<<(std::ostream &os, const Prototype &type)
it_const_params parameters_type() const
Types of the parameters.
it_params parameters_type()
void accept(Visitor &visitor) const override
Class which represents a DEX type as described in the format specifications: https://source....
Definition DEX/Type.hpp:33
Definition DEX/Class.hpp:30
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41