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:
44 explicit ResourceAccelerator(const details::pe_resource_acceltableentry&);
45
48
49 ~ResourceAccelerator() override;
50
51 std::set<ACCELERATOR_FLAGS> flags_list() const;
52 std::string ansi_str() const;
53
55 int16_t flags() const;
56
58 int16_t ansi() const;
59
61 uint16_t id() const;
62
64 int16_t padding() const;
65
66 void accept(Visitor& visitor) const override;
67
68
69 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceAccelerator& acc);
70
71 private:
72 int16_t flags_;
73 int16_t ansi_;
74 uint16_t id_;
75 int16_t padding_;
76
77};
78
79}
80}
81
82#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.
uint16_t id() const
An identifier for the keyboard accelerator.
int16_t flags() const
Describe the keyboard accelerator characteristics.
int16_t padding() const
The number of bytes inserted to ensure that the structure is aligned on a DWORD boundary.
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32