LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
RichEntry.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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 RichEntry() = default;
31 RichEntry(uint16_t id, uint16_t build_id, uint32_t count) :
32 id_(id),
33 build_id_(build_id),
34 count_(count) {}
35
36 RichEntry(const RichEntry&) = default;
37 RichEntry& operator=(const RichEntry&) = default;
38 ~RichEntry() override = default;
39
41 uint16_t id() const {
42 return id_;
43 }
44
46 uint16_t build_id() const {
47 return build_id_;
48 }
49
51 uint32_t count() const {
52 return count_;
53 }
54
55 void id(uint16_t id) {
56 id_ = id;
57 }
58 void build_id(uint16_t build_id) {
59 build_id_ = build_id;
60 }
61 void count(uint32_t count) {
62 count_ = count;
63 }
64
65 void accept(Visitor& visitor) const override;
66
67 LIEF_API friend std::ostream& operator<<(std::ostream& os,
68 const RichEntry& rich_entry);
69
70 private:
71 uint16_t id_ = 0;
72 uint16_t build_id_ = 0;
73 uint32_t count_ = 0;
74};
75}
76}
77
78#endif
void id(uint16_t id)
Definition RichEntry.hpp:55
RichEntry(const RichEntry &)=default
void build_id(uint16_t build_id)
Definition RichEntry.hpp:58
void count(uint32_t count)
Definition RichEntry.hpp:61
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:51
RichEntry & operator=(const RichEntry &)=default
uint16_t build_id() const
Build number of the tool (if any).
Definition RichEntry.hpp:46
uint16_t id() const
Entry type.
Definition RichEntry.hpp:41
RichEntry(uint16_t id, uint16_t build_id, uint32_t count)
Definition RichEntry.hpp:31
Definition Visitor.hpp:212
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF namespace.
Definition Abstract/Binary.hpp:40
#define LIEF_API
Definition visibility.h:43