48 virtual std::size_t
size() const noexcept = 0;
54 virtual
void Read(std::
size_t offset,
void* dst, std::
size_t size) const = 0;
60 virtual
void WriteTo(std::ostream& dst) const = 0;
77 std::size_t
size() const noexcept
override {
return size_; }
79 void Read(std::size_t offset,
void* dst, std::size_t size)
const override;
80 void WriteTo(std::ostream& dst)
const override;
83 std::shared_ptr<const SecureBytes> buffer_;
84 std::size_t offset_ = 0;
85 std::size_t size_ = 0;
Read-only source for an attachment payload.
Definition binary_source.hh:43
virtual std::size_t size() const noexcept=0
Returns the payload size in bytes.
Binary source backed by a shared secure byte buffer.
Definition binary_source.hh:66
void Read(std::size_t offset, void *dst, std::size_t size) const override
Copies size bytes starting at offset into dst.
std::size_t size() const noexcept override
Returns the payload size in bytes.
Definition binary_source.hh:77
void WriteTo(std::ostream &dst) const override
Writes the whole payload to dst without materializing a copy.
BufferBinarySource(std::shared_ptr< const SecureBytes > buffer, std::size_t offset, std::size_t size)
Visibility/export macro for the shared library.
#define LIBKEEPASS_API
Marks a class, function or variable as part of the public ABI.
Definition export.hh:43
Secure memory handling: zeroization, locked allocations and sensitive value containers.