LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
ResourceVarFileInfo.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_PE_RESOURCE_VAR_FILE_INFO_H
17#define LIEF_PE_RESOURCE_VAR_FILE_INFO_H
18#include <ostream>
19#include <cstdint>
20#include <vector>
21
22#include "LIEF/visibility.h"
23
24#include "LIEF/Object.hpp"
25
26namespace LIEF {
27namespace PE {
28
30class ResourceVersion;
31struct ResourcesParser;
32class LIEF_API ResourceVarFileInfo : public Object {
37
38 friend class ResourcesManager;
39 friend class ResourceVersion;
40 friend struct ResourcesParser;
41
42 public:
44 ResourceVarFileInfo(uint16_t type, std::u16string key);
45 ResourceVarFileInfo(const ResourceVarFileInfo&) = default;
46 ResourceVarFileInfo& operator=(const ResourceVarFileInfo&) = default;
47 ~ResourceVarFileInfo() override = default;
48 uint16_t type() const {
53 return type_;
54 }
55 const std::u16string& key() const {
59 return key_;
60 }
61 const std::vector<uint32_t>& translations() const {
68 return translations_;
69 }
70
71 std::vector<uint32_t>& translations() {
72 return translations_;
73 }
74
75 void type(uint16_t type) {
76 type_ = type;
77 }
78
79 void key(std::u16string key) {
80 key_ = std::move(key);
81 }
82
83 void key(const std::string& key);
84
85 void translations(std::vector<uint32_t> translations) {
86 translations_ = std::move(translations);
87 }
88
89 void accept(Visitor& visitor) const override;
90
91
92 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceVarFileInfo& entry);
93
94 private:
95 uint16_t type_ = 0;
96 std::u16string key_;
97 std::vector<uint32_t> translations_;
98
99};
100}
101}
102
103#endif
Object.hpp
LIEF::PE::ResourceVarFileInfo
This object describes information about languages supported by the application.
Definition ResourceVarFileInfo.hpp:36
LIEF::PE::ResourceVarFileInfo::operator<<
friend std::ostream & operator<<(std::ostream &os, const ResourceVarFileInfo &entry)
LIEF::PE::ResourceVarFileInfo::key
const std::u16string & key() const
Signature of the structure: Must be the unicode string "VarFileInfo".
Definition ResourceVarFileInfo.hpp:58
LIEF::PE::ResourceVarFileInfo::type
uint16_t type() const
The type of data in the version resource.
Definition ResourceVarFileInfo.hpp:52
LIEF::PE::ResourceVarFileInfo::translations
void translations(std::vector< uint32_t > translations)
Definition ResourceVarFileInfo.hpp:85
LIEF::PE::ResourceVarFileInfo::ResourceVarFileInfo
ResourceVarFileInfo()
LIEF::PE::ResourceVarFileInfo::accept
void accept(Visitor &visitor) const override
LIEF::PE::ResourceVarFileInfo::translations
const std::vector< uint32_t > & translations() const
List of languages that the application supports.
Definition ResourceVarFileInfo.hpp:67
LIEF::PE::ResourceVarFileInfo::ResourceVarFileInfo
ResourceVarFileInfo(uint16_t type, std::u16string key)
LIEF::PE::ResourceVarFileInfo::operator=
ResourceVarFileInfo & operator=(const ResourceVarFileInfo &)=default
LIEF::PE::ResourceVarFileInfo::type
void type(uint16_t type)
Definition ResourceVarFileInfo.hpp:75
LIEF::PE::ResourceVarFileInfo::key
void key(std::u16string key)
Definition ResourceVarFileInfo.hpp:79
LIEF::PE::ResourceVarFileInfo::~ResourceVarFileInfo
~ResourceVarFileInfo() override=default
LIEF::PE::ResourceVarFileInfo::translations
std::vector< uint32_t > & translations()
Definition ResourceVarFileInfo.hpp:71
LIEF::PE::ResourceVarFileInfo::key
void key(const std::string &key)
LIEF::PE::ResourceVarFileInfo::ResourceVarFileInfo
ResourceVarFileInfo(const ResourceVarFileInfo &)=default
LIEF::PE::ResourceVersion
Representation of the data associated with the RT_VERSION entry.
Definition ResourceVersion.hpp:38
LIEF::PE::ResourcesManager
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41