LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
ResourceStringFileInfo.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_STRING_FILE_INFO_H
17#define LIEF_PE_RESOURCE_STRING_FILE_INFO_H
18#include <ostream>
19#include <vector>
20
21#include "LIEF/visibility.h"
22
23#include "LIEF/Object.hpp"
25
26namespace LIEF {
27namespace PE {
28
30class ResourceVersion;
31struct ResourcesParser;
32class LIEF_API ResourceStringFileInfo : public Object {
39
40 friend class ResourcesManager;
41 friend class ResourceVersion;
42 friend struct ResourcesParser;
43
44 public:
46 ResourceStringFileInfo(uint16_t type, std::u16string key) :
47 type_(type),
48 key_(std::move(key))
49 {}
50 ResourceStringFileInfo(const ResourceStringFileInfo&) = default;
51 ResourceStringFileInfo& operator=(const ResourceStringFileInfo&) = default;
52 ~ResourceStringFileInfo() override = default;
53 uint16_t type() const {
58 return type_;
59 }
60 const std::u16string& key() const {
64 return key_;
65 }
66 const std::vector<LangCodeItem>& langcode_items() const {
73 return childs_;
74 }
75 std::vector<LangCodeItem>& langcode_items() {
76 return childs_;
77 }
78
79 void type(uint16_t type) {
80 type_ = type;
81 }
82
83 void key(std::u16string key) {
84 key_ = std::move(key);
85 }
86 void key(const std::string& key);
87
88 void langcode_items(std::vector<LangCodeItem> items) {
89 childs_ = std::move(items);
90 }
91
92 void accept(Visitor& visitor) const override;
93
94
95 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceStringFileInfo& string_file_info);
96
97 private:
98 uint16_t type_ = 0;
99 std::u16string key_;
100 std::vector<LangCodeItem> childs_;
101
102
103};
104
105
106
107
108}
109}
110
111
112#endif
LangCodeItem.hpp
Object.hpp
LIEF::PE::ResourceStringFileInfo
Representation of the StringFileInfo structure.
Definition ResourceStringFileInfo.hpp:38
LIEF::PE::ResourceStringFileInfo::type
void type(uint16_t type)
Definition ResourceStringFileInfo.hpp:79
LIEF::PE::ResourceStringFileInfo::key
const std::u16string & key() const
Signature of the structure: Must be the unicode string "StringFileInfo".
Definition ResourceStringFileInfo.hpp:63
LIEF::PE::ResourceStringFileInfo::ResourceStringFileInfo
ResourceStringFileInfo(uint16_t type, std::u16string key)
Definition ResourceStringFileInfo.hpp:46
LIEF::PE::ResourceStringFileInfo::key
void key(std::u16string key)
Definition ResourceStringFileInfo.hpp:83
LIEF::PE::ResourceStringFileInfo::langcode_items
const std::vector< LangCodeItem > & langcode_items() const
List of the LangCodeItem items.
Definition ResourceStringFileInfo.hpp:72
LIEF::PE::ResourceStringFileInfo::langcode_items
void langcode_items(std::vector< LangCodeItem > items)
Definition ResourceStringFileInfo.hpp:88
LIEF::PE::ResourceStringFileInfo::ResourceStringFileInfo
ResourceStringFileInfo(const ResourceStringFileInfo &)=default
LIEF::PE::ResourceStringFileInfo::operator=
ResourceStringFileInfo & operator=(const ResourceStringFileInfo &)=default
LIEF::PE::ResourceStringFileInfo::accept
void accept(Visitor &visitor) const override
LIEF::PE::ResourceStringFileInfo::key
void key(const std::string &key)
LIEF::PE::ResourceStringFileInfo::type
uint16_t type() const
The type of data in the version resource.
Definition ResourceStringFileInfo.hpp:57
LIEF::PE::ResourceStringFileInfo::ResourceStringFileInfo
ResourceStringFileInfo()
LIEF::PE::ResourceStringFileInfo::langcode_items
std::vector< LangCodeItem > & langcode_items()
Definition ResourceStringFileInfo.hpp:75
LIEF::PE::ResourceStringFileInfo::~ResourceStringFileInfo
~ResourceStringFileInfo() override=default
LIEF::PE::ResourceStringFileInfo::operator<<
friend std::ostream & operator<<(std::ostream &os, const ResourceStringFileInfo &string_file_info)
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