LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
runtime
android
runtime/android/Property.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 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_RUNTIME_ANDROID_PROPERTY_H
16
#define LIEF_RUNTIME_ANDROID_PROPERTY_H
17
#include <string_view>
18
#include <cstdint>
19
#include <ostream>
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
29
namespace
LIEF::runtime::android
{
30
32
class
LIEF_API
Property
{
33
public
:
34
Property
() =
default
;
35
Property
(std::string
name
, std::string
value
, uint32_t
serial
) :
36
name_(std::move(
name
)),
37
value_(std::move(
value
)),
38
serial_(
serial
) {}
39
40
static
Property
create_from
(
const
prop_info
& pi);
41
42
Property
(
const
Property
&) =
default
;
43
Property
&
operator=
(
const
Property
&) =
default
;
44
45
Property
(
Property
&&) noexcept = default;
46
Property
& operator=(
Property
&&) noexcept = default;
47
48
~
Property
() = default;
49
51
std::string_view
name
() const
LIEF_LIFETIMEBOUND
{
52
return
name_;
53
}
54
56
std::string_view
value
() const
LIEF_LIFETIMEBOUND
{
57
return
value_;
58
}
59
64
uint32_t
serial
()
const
{
65
return
serial_;
66
}
67
69
std::string
to_string
()
const
;
70
71
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
72
const
Property
& prop) {
73
os << prop.
to_string
();
74
return
os;
75
}
76
77
private
:
78
std::string name_;
79
std::string value_;
80
uint32_t serial_ = 0;
81
};
82
}
83
84
85
#endif
LIEF::runtime::android::Property::value
std::string_view value() const
Value associated with the property.
Definition
runtime/android/Property.hpp:56
LIEF::runtime::android::Property::operator<<
friend std::ostream & operator<<(std::ostream &os, const Property &prop)
Definition
runtime/android/Property.hpp:71
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::Property
Property(const Property &)=default
LIEF::runtime::android::Property::Property
Property(std::string name, std::string value, uint32_t serial)
Definition
runtime/android/Property.hpp:35
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::name
std::string_view name() const
Name of the property (e.g. ro.boot.hardware).
Definition
runtime/android/Property.hpp:51
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:64
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::runtime::android
Definition
android/Host.hpp:23
prop_info
struct prop_info prop_info
Definition
runtime/android/Property.hpp:26
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0