LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
ResourceStringTable.hpp
Go to the documentation of this file.
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_STRING_TABLE_H
18#define LIEF_PE_RESOURCE_STRING_TABLE_H
19#include <string>
20
21#include "LIEF/visibility.h"
22#include "LIEF/Object.hpp"
23
24namespace LIEF {
25namespace PE {
27
28class LIEF_API ResourceStringTable : public Object {
29
30 friend class ResourcesManager;
31 public:
33
34 ResourceStringTable(int16_t length, std::u16string name) :
35 name_(std::move(name)),
36 length_(length)
37 {}
38
39 ResourceStringTable(const ResourceStringTable&) = default;
40 ResourceStringTable& operator=(const ResourceStringTable&) = default;
41
42 ~ResourceStringTable() override = default;
43
44 void accept(Visitor& visitor) const override;
45 int16_t length() const {
48 return length_;
49 }
50 const std::u16string& name() const {
53 return name_;
54 }
55
56 LIEF_API friend std::ostream& operator<<(std::ostream& os, const ResourceStringTable& string_table);
57
58 private:
59 std::u16string name_;
60 int16_t length_ = 0;
61};
62
63}
64}
65
66#endif
Definition ResourceStringTable.hpp:28
ResourceStringTable()=default
int16_t length() const
The size of the string, not including length field itself.
Definition ResourceStringTable.hpp:47
ResourceStringTable(int16_t length, std::u16string name)
Definition ResourceStringTable.hpp:34
ResourceStringTable & operator=(const ResourceStringTable &)=default
ResourceStringTable(const ResourceStringTable &)=default
~ResourceStringTable() override=default
const std::u16string & name() const
The variable-length Unicode string data, word-aligned.
Definition ResourceStringTable.hpp:52
friend std::ostream & operator<<(std::ostream &os, const ResourceStringTable &string_table)
void accept(Visitor &visitor) const override
The Resource Manager provides an enhanced API to manipulate the resource tree.
Definition ResourcesManager.hpp:38
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41