libkeepass 0.2.0
KeePass key database importer/exporter library
Loading...
Searching...
No Matches
keepass::detail::BinarySource Class Referenceabstract

Read-only source for an attachment payload. More...

#include <binary_source.hh>

Inheritance diagram for keepass::detail::BinarySource:
keepass::detail::BufferBinarySource

Public Member Functions

virtual std::size_t size () const noexcept=0
 Returns the payload size in bytes.
 
virtual void Read (std::size_t offset, void *dst, std::size_t size) const =0
 Copies size bytes starting at offset into dst.
 
virtual void WriteTo (std::ostream &dst) const =0
 Writes the whole payload to dst without materializing a copy.
 

Detailed Description

Read-only source for an attachment payload.

A source owns or shares the (already decrypted) bytes and exposes them without forcing the object model to materialize a per-attachment copy. The KDBX 4 importer stores all inner-header binaries in one shared, zeroized buffer and creates a small source view for each attachment.

Member Function Documentation

◆ Read()

virtual void keepass::detail::BinarySource::Read ( std::size_t  offset,
void *  dst,
std::size_t  size 
) const
pure virtual

Copies size bytes starting at offset into dst.

Exceptions
IoErrorif the requested range is outside the source.

Implemented in keepass::detail::BufferBinarySource.

◆ size()

virtual std::size_t keepass::detail::BinarySource::size ( ) const
pure virtualnoexcept

Returns the payload size in bytes.

Implemented in keepass::detail::BufferBinarySource.

◆ WriteTo()

virtual void keepass::detail::BinarySource::WriteTo ( std::ostream &  dst) const
pure virtual

Writes the whole payload to dst without materializing a copy.

Exceptions
IoErroron write failure.

Implemented in keepass::detail::BufferBinarySource.


The documentation for this class was generated from the following file: