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
public
:
37
using
access_flags_list_t
= std::vector<ACCESS_FLAGS>;
38
39
public
:
40
Field
();
41
Field
(std::string
name
,
Class
* parent =
nullptr
);
42
43
Field
(
const
Field
&);
44
Field
&
operator=
(
const
Field
&);
45
47
const
std::string&
name
()
const
;
48
51
bool
has_class
()
const
;
52
54
const
Class
*
cls
()
const
;
55
Class
*
cls
();
56
58
size_t
index
()
const
;
59
61
bool
is_static
()
const
;
62
64
const
Type
*
type
()
const
;
65
Type
*
type
();
66
67
void
accept
(
Visitor
& visitor)
const override
;
68
70
bool
has
(
ACCESS_FLAGS
f)
const
;
71
73
access_flags_list_t
access_flags
()
const
;
74
75
76
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
const
Field
& mtd);
77
78
~Field
()
override
;
79
80
private
:
81
void
set_static(
bool
v);
82
83
private
:
84
std::string name_;
85
Class
* parent_ =
nullptr
;
86
Type
* type_ =
nullptr
;
87
uint32_t access_flags_ = 0;
88
uint32_t original_index_ = UINT_MAX;
89
bool
is_static_ =
false
;
90
};
91
92
}
// Namespace DEX
93
}
// Namespace LIEF
94
#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:37
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:33
LIEF::Object::Object
Object()
LIEF::Visitor
Definition
Visitor.hpp:210
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:41
Generated by
1.17.0