LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
ResourceAccelerator.hpp
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 Quarkslab
3 * Copyright 2017 - 2021 K. Nakagawa
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_RESOURCE_ACCELERATOR_H
18#define LIEF_PE_RESOURCE_ACCELERATOR_H
19
20#include <string>
21#include <set>
22#include <ostream>
23
24#include "LIEF/visibility.h"
25
26#include "LIEF/Object.hpp"
27
28#include "LIEF/PE/enums.hpp"
29
30namespace LIEF {
31namespace PE {
32class ResourcesManager;
33
34namespace details {
35struct pe_resource_acceltableentry;
36}
37
38class LIEF_API ResourceAccelerator : public Object {
39
40 friend class ResourcesManager;
41
42 public:
43 ResourceAccelerator() = default;
44 explicit ResourceAccelerator(const details::pe_resource_acceltableentry&);
45
47 ResourceAccelerator& operator=(const ResourceAccelerator&) = default;
48
49 ~ResourceAccelerator() override = default;
50
51 std::set<ACCELERATOR_FLAGS> flags_list() const;
52 std::string ansi_str() const;
53
55 int16_t flags() const {
56 return flags_;
57 }
58
60 int16_t ansi() const {
61 return ansi_;
62 }
63
65 uint16_t id() const {
66 return id_;
67 }
68
70 int16_t padding() const {
71 return padding_;
72 }
73
74 void accept(Visitor& visitor) const override;
75
76
77 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceAccelerator& acc);
78
79 private:
80 int16_t flags_ = 0;
81 int16_t ansi_ = 0;
82 uint16_t id_ = 0;
83 int16_t padding_ = 0;
84
85};
86
87}
88}
89
90#endif
Definition Object.hpp:25
Definition ResourceAccelerator.hpp:38
int16_t ansi() const
An ANSI character value or a virtual-key code that identifies the accelerator key.
Definition ResourceAccelerator.hpp:60
uint16_t id() const
An identifier for the keyboard accelerator.
Definition ResourceAccelerator.hpp:65
int16_t flags() const
Describe the keyboard accelerator characteristics.
Definition ResourceAccelerator.hpp:55
int16_t padding() const
The number of bytes inserted to ensure that the structure is aligned on a DWORD boundary.
Definition ResourceAccelerator.hpp:70
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Definition Visitor.hpp:221
LIEF namespace.
Definition Abstract/Binary.hpp:31