LIEF: Library to Instrument Executable Formats Version 0.16.0
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 {
26class 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 uint16_t id() const {
44 return id_;
45 }
46 uint16_t build_id() const {
49 return build_id_;
50 }
51 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
Object.hpp
LIEF::PE::RichEntry
Class which represents an entry associated to the RichHeader.
Definition RichEntry.hpp:28
LIEF::PE::RichEntry::id
void id(uint16_t id)
Definition RichEntry.hpp:57
LIEF::PE::RichEntry::RichEntry
RichEntry(const RichEntry &)=default
LIEF::PE::RichEntry::build_id
void build_id(uint16_t build_id)
Definition RichEntry.hpp:60
LIEF::PE::RichEntry::count
void count(uint32_t count)
Definition RichEntry.hpp:63
LIEF::PE::RichEntry::operator<<
friend std::ostream & operator<<(std::ostream &os, const RichEntry &rich_entry)
LIEF::PE::RichEntry::accept
void accept(Visitor &visitor) const override
LIEF::PE::RichEntry::~RichEntry
~RichEntry() override=default
LIEF::PE::RichEntry::count
uint32_t count() const
Occurrence count.
Definition RichEntry.hpp:53
LIEF::PE::RichEntry::operator=
RichEntry & operator=(const RichEntry &)=default
LIEF::PE::RichEntry::build_id
uint16_t build_id() const
Build number of the tool (if any)
Definition RichEntry.hpp:48
LIEF::PE::RichEntry::id
uint16_t id() const
Entry type.
Definition RichEntry.hpp:43
LIEF::PE::RichEntry::RichEntry
RichEntry(uint16_t id, uint16_t build_id, uint32_t count)
Definition RichEntry.hpp:32
LIEF::PE::RichEntry::RichEntry
RichEntry()=default
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