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

Binary source backed by a shared secure byte buffer. More...

#include <binary_source.hh>

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

Public Member Functions

 BufferBinarySource (std::shared_ptr< const SecureBytes > buffer, std::size_t offset, std::size_t size)
 
std::size_t size () const noexcept override
 Returns the payload size in bytes.
 
void Read (std::size_t offset, void *dst, std::size_t size) const override
 Copies size bytes starting at offset into dst.
 
void WriteTo (std::ostream &dst) const override
 Writes the whole payload to dst without materializing a copy.
 

Detailed Description

Binary source backed by a shared secure byte buffer.

Constructor & Destructor Documentation

◆ BufferBinarySource()

keepass::detail::BufferBinarySource::BufferBinarySource ( std::shared_ptr< const SecureBytes >  buffer,
std::size_t  offset,
std::size_t  size 
)
Parameters
bufferShared buffer holding the payload (and possibly other binaries).
offsetOffset of this payload inside buffer.
sizePayload size in bytes.

Member Function Documentation

◆ Read()

void keepass::detail::BufferBinarySource::Read ( std::size_t  offset,
void *  dst,
std::size_t  size 
) const
overridevirtual

Copies size bytes starting at offset into dst.

Exceptions
IoErrorif the requested range is outside the source.

Implements keepass::detail::BinarySource.

◆ size()

std::size_t keepass::detail::BufferBinarySource::size ( ) const
inlineoverridevirtualnoexcept

Returns the payload size in bytes.

Implements keepass::detail::BinarySource.

◆ WriteTo()

void keepass::detail::BufferBinarySource::WriteTo ( std::ostream &  dst) const
overridevirtual

Writes the whole payload to dst without materializing a copy.

Exceptions
IoErroron write failure.

Implements keepass::detail::BinarySource.


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