LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
DEX
Field.hpp
Go to the documentation of this file.
1
/* Copyright 2021 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_DEX_FIELD_H
16
#define LIEF_DEX_FIELD_H
17
18
#include <climits>
19
#include <cstdint>
20
21
#include "
LIEF/DEX/enums.hpp
"
22
23
#include "
LIEF/visibility.h
"
24
#include "
LIEF/Object.hpp
"
25
26
#include "
LIEF/DEX/Type.hpp
"
27
28
namespace
LIEF
{
29
namespace
DEX
{
30
class
Parser
;
31
class
Class
;
32
34
class
LIEF_API
Field
:
public
Object
{
35
friend
class
Parser
;
36
37
public
:
38
using
access_flags_list_t
= std::vector<ACCESS_FLAGS>;
39
40
public
:
41
Field
();
42
Field
(std::string
name
,
Class
* parent =
nullptr
);
43
44
Field
(
const
Field
&);
45
Field
&
operator=
(
const
Field
&);
46
48
const
std::string&
name
()
const
;
49
52
bool
has_class
()
const
;
53
55
const
Class
*
cls
()
const
;
56
Class
*
cls
();
57
59
size_t
index
()
const
;
60
62
bool
is_static
()
const
;
63
65
const
Type
*
type
()
const
;
66
Type
*
type
();
67
68
void
accept
(
Visitor
& visitor)
const override
;
69
71
bool
has
(
ACCESS_FLAGS
f)
const
;
72
74
access_flags_list_t
access_flags
()
const
;
75
76
77
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
Field
& mtd);
78
79
~Field
()
override
;
80
81
private
:
82
void
set_static(
bool
v);
83
84
private
:
85
std::string name_;
86
Class
* parent_ =
nullptr
;
87
Type
* type_ =
nullptr
;
88
uint32_t access_flags_ = 0;
89
uint32_t original_index_ = UINT_MAX;
90
bool
is_static_ =
false
;
91
};
92
93
}
// Namespace DEX
94
}
// Namespace LIEF
95
#endif
Type.hpp
enums.hpp
Object.hpp
LIEF::DEX::Class
Class which represents a DEX Class (i.e. a Java/Kotlin class).
Definition
DEX/Class.hpp:36
LIEF::DEX::Field::has
bool has(ACCESS_FLAGS f) const
Check if the field has the given ACCESS_FLAGS.
LIEF::DEX::Field::cls
const Class * cls() const
Class associated with this Field.
LIEF::DEX::Field::access_flags
access_flags_list_t access_flags() const
ACCESS_FLAGS as a list.
LIEF::DEX::Field::Field
Field(std::string name, Class *parent=nullptr)
LIEF::DEX::Field::~Field
~Field() override
LIEF::DEX::Field::is_static
bool is_static() const
True if this field is a static one.
LIEF::DEX::Field::has_class
bool has_class() const
True if a class is associated with this field (which should be the case).
LIEF::DEX::Field::index
size_t index() const
Index in the DEX Fields pool.
LIEF::DEX::Field::Field
Field(const Field &)
LIEF::DEX::Field::operator=
Field & operator=(const Field &)
LIEF::DEX::Field::access_flags_list_t
std::vector< ACCESS_FLAGS > access_flags_list_t
Definition
Field.hpp:38
LIEF::DEX::Field::accept
void accept(Visitor &visitor) const override
LIEF::DEX::Field::Parser
friend class Parser
Definition
Field.hpp:35
LIEF::DEX::Field::type
Type * type()
LIEF::DEX::Field::Field
Field()
LIEF::DEX::Field::name
const std::string & name() const
Name of the Field.
LIEF::DEX::Field::operator<<
friend std::ostream & operator<<(std::ostream &os, const Field &mtd)
LIEF::DEX::Field::type
const Type * type() const
Field's prototype.
LIEF::DEX::Field::cls
Class * cls()
LIEF::DEX::Parser
Class which parses a DEX file to produce a DEX::File object.
Definition
DEX/Parser.hpp:38
LIEF::DEX::Type
Class which represents a DEX type as described in the format specifications: https://source....
Definition
DEX/Type.hpp:34
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF::DEX
Definition
DEX/Class.hpp:30
LIEF::DEX::ACCESS_FLAGS
ACCESS_FLAGS
Definition
DEX/enums.hpp:22
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:43
Generated by
1.17.0