LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
runtime
android
runtime/android/Property.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 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_RUNTIME_ANDROID_PROPERTY_H
17
#define LIEF_RUNTIME_ANDROID_PROPERTY_H
18
#include <ostream>
19
#include <cstdint>
20
#include <string>
21
22
#include <
LIEF/compiler_attributes.hpp
>
23
#include <
LIEF/visibility.h
>
24
25
// Forward definition from include/sys/system_properties.h
26
typedef
struct
prop_info
prop_info
;
// NOLINT
27
28
namespace
LIEF
{
29
namespace
runtime {
30
namespace
android {
31
33
class
LIEF_API
Property
{
34
public
:
35
Property
() =
default
;
36
Property
(std::string
name
, std::string
value
, uint32_t
serial
) :
37
name_(std::move(
name
)),
38
value_(std::move(
value
)),
39
serial_(
serial
) {}
40
41
static
Property
create_from
(
const
prop_info
& pi);
42
43
Property
(
const
Property
&) =
default
;
44
Property
&
operator=
(
const
Property
&) =
default
;
45
46
Property
(
Property
&&) noexcept = default;
47
Property
& operator=(
Property
&&) noexcept = default;
48
49
~
Property
() = default;
50
52
const std::
string
&
name
() const
LIEF_LIFETIMEBOUND
{
53
return
name_;
54
}
55
57
const
std::string&
value
() const
LIEF_LIFETIMEBOUND
{
58
return
value_;
59
}
60
65
uint32_t
serial
()
const
{
66
return
serial_;
67
}
68
70
std::string
to_string
()
const
;
71
72
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
73
const
Property
& prop) {
74
os << prop.
to_string
();
75
return
os;
76
}
77
78
private
:
79
std::string name_;
80
std::string value_;
81
uint32_t serial_ = 0;
82
};
83
}
84
}
85
}
86
#endif
LIEF::runtime::android::Property::operator<<
friend std::ostream & operator<<(std::ostream &os, const Property &prop)
Definition
runtime/android/Property.hpp:72
LIEF::runtime::android::Property::create_from
static Property create_from(const prop_info &pi)
LIEF::runtime::android::Property::Property
Property()=default
LIEF::runtime::android::Property::value
const std::string & value() const
Value associated with the property.
Definition
runtime/android/Property.hpp:57
LIEF::runtime::android::Property::Property
Property(const Property &)=default
LIEF::runtime::android::Property::name
const std::string & name() const
Name of the property (e.g. ro.boot.hardware).
Definition
runtime/android/Property.hpp:52
LIEF::runtime::android::Property::Property
Property(std::string name, std::string value, uint32_t serial)
Definition
runtime/android/Property.hpp:36
LIEF::runtime::android::Property::to_string
std::string to_string() const
Pretty representation of the property.
LIEF::runtime::android::Property::Property
Property(Property &&) noexcept=default
LIEF::runtime::android::Property::operator=
Property & operator=(const Property &)=default
LIEF::runtime::android::Property::serial
uint32_t serial() const
Serial number of the property.
Definition
runtime/android/Property.hpp:65
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
prop_info
struct prop_info prop_info
Definition
runtime/android/Property.hpp:26
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0