LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
RichEntry.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_RICH_ENTRY_H
17#define LIEF_PE_RICH_ENTRY_H
18#include <cstdint>
19#include <ostream>
20
21#include "LIEF/Object.hpp"
22#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace PE {
26
28class LIEF_API RichEntry : public Object {
29 public:
30
31 RichEntry() = default;
32 RichEntry(uint16_t id, uint16_t build_id, uint32_t count) :
33 id_(id),
34 build_id_(build_id),
35 count_(count)
36 {}
37
38 RichEntry(const RichEntry&) = default;
39 RichEntry& operator=(const RichEntry&) = default;
40 ~RichEntry() override = default;
41
43 uint16_t id() const {
44 return id_;
45 }
46
48 uint16_t build_id() const {
49 return build_id_;
50 }
51
53 uint32_t count() const {
54 return count_;
55 }
56
57 void id(uint16_t id) {
58 id_ = id;
59 }
60 void build_id(uint16_t build_id) {
61 build_id_ = build_id;
62 }
63 void count(uint32_t count) {
64 count_ = count;
65 }
66
67 void accept(Visitor& visitor) const override;
68
69 LIEF_API friend std::ostream& operator<<(std::ostream& os, const RichEntry& rich_entry);
70
71 private:
72 uint16_t id_ = 0;
73 uint16_t build_id_ = 0;
74 uint32_t count_ = 0;
75
76};
77}
78}
79
80#endif
81
Definition Object.hpp:25
Class which represents an entry associated to the RichHeader.
Definition RichEntry.hpp:28
void id(uint16_t id)
Definition RichEntry.hpp:57
RichEntry(const RichEntry &)=default
void build_id(uint16_t build_id)
Definition RichEntry.hpp:60
void count(uint32_t count)
Definition RichEntry.hpp:63
friend std::ostream & operator<<(std::ostream &os, const RichEntry &rich_entry)
void accept(Visitor &visitor) const override
~RichEntry() override=default
uint32_t count() const
Occurrence count.
Definition RichEntry.hpp:53
RichEntry & operator=(const RichEntry &)=default
uint16_t build_id() const
Build number of the tool (if any)
Definition RichEntry.hpp:48
uint16_t id() const
Entry type.
Definition RichEntry.hpp:43
RichEntry(uint16_t id, uint16_t build_id, uint32_t count)
Definition RichEntry.hpp:32
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41