15#ifndef LIEF_PE_CONTENT_INFO_H
16#define LIEF_PE_CONTENT_INFO_H
88 type_(std::move(oid)) {}
94 virtual std::unique_ptr<Content>
clone()
const = 0;
95 virtual void print(std::ostream& os)
const = 0;
105 static_assert(std::is_base_of_v<Content, T>,
106 "Require ContentInfo inheritance");
107 if (T::classof(
this)) {
108 return static_cast<const T*
>(
this);
115 return const_cast<T*
>(
static_cast<const Content*
>(
this)->cast<
T>());
133 return value_->content_type();
159 std::unique_ptr<Content> value_;
Definition ContentInfo.hpp:85
~Content() override=default
const oid_t & content_type() const
Definition ContentInfo.hpp:90
Content(oid_t oid)
Definition ContentInfo.hpp:87
virtual std::unique_ptr< Content > clone() const =0
virtual void print(std::ostream &os) const =0
T * cast()
Definition ContentInfo.hpp:114
const T * cast() const
Definition ContentInfo.hpp:104
friend std::ostream & operator<<(std::ostream &os, const Content &content)
Definition ContentInfo.hpp:97
std::vector< uint8_t > digest() const
Return the digest (authentihash) if the underlying content type is SPC_INDIRECT_DATA_OBJID Otherwise,...
ALGORITHMS digest_algorithm() const
Return the digest used to hash the file.
void accept(Visitor &visitor) const override
ContentInfo(ContentInfo &&other) noexcept=default
ContentInfo(const ContentInfo &other)
const Content & value() const
Definition ContentInfo.hpp:140
oid_t content_type() const
Return the OID that describes the content wrapped by this object. It should match SPC_INDIRECT_DATA_O...
Definition ContentInfo.hpp:132
~ContentInfo() override=default
friend class SignatureParser
Definition ContentInfo.hpp:82
Content & value()
Definition ContentInfo.hpp:136
friend class Parser
Definition ContentInfo.hpp:81
void swap(ContentInfo &other) noexcept
ContentInfo & operator=(ContentInfo other)
friend std::ostream & operator<<(std::ostream &os, const ContentInfo &content_info)
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:53
Definition SignatureParser.hpp:37
Definition Visitor.hpp:211
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:31
ALGORITHMS
Cryptography algorithms.
Definition PE/enums.hpp:28
std::string oid_t
Definition PE/signature/types.hpp:22
@ T
Definition AcceleratorCodes.hpp:96
#define LIEF_API
Definition visibility.h:44