LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
ResourceStringFileInfo.hpp
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 <sstream>
20
21#include "LIEF/visibility.h"
22
23#include "LIEF/Object.hpp"
24#include "LIEF/PE/resources/LangCodeItem.hpp"
25
26namespace LIEF {
27namespace PE {
28
29class ResourcesManager;
30class ResourceVersion;
31struct ResourcesParser;
32
38class 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);
49 ~ResourceStringFileInfo() override;
50
54 uint16_t type() const;
55
58 const std::u16string& key() const;
59
65 const std::vector<LangCodeItem>& langcode_items() const;
66 std::vector<LangCodeItem>& langcode_items();
67
68 void type(uint16_t type);
69
70 void key(const std::u16string& key);
71 void key(const std::string& key);
72 void langcode_items(const std::vector<LangCodeItem>& items);
73
74 void accept(Visitor& visitor) const override;
75
76
77 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceStringFileInfo& string_file_info);
78
79 private:
80 uint16_t type_ = 0;
81 std::u16string key_;
82 std::vector<LangCodeItem> childs_;
83
84
85};
86
87
88
89
90}
91}
92
93
94#endif
Definition Object.hpp:25
Representation of the StringFileInfo structure.
Definition ResourceStringFileInfo.hpp:38
const std::u16string & key() const
Signature of the structure: Must be the unicode string "StringFileInfo".
const std::vector< LangCodeItem > & langcode_items() const
List of the LangCodeItem items.
uint16_t type() const
The type of data in the version resource.
Representation of the data associated with the RT_VERSION entry.
Definition ResourceVersion.hpp:38
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