Botan 3.9.0
Crypto and TLS for C&
|
#include <data_src.h>
Public Member Functions | |
virtual bool | check_available (size_t n)=0 |
DataSource ()=default | |
DataSource (const DataSource &)=delete | |
DataSource (DataSource &&)=default | |
size_t | discard_next (size_t N) |
virtual bool | end_of_data () const =0 |
virtual size_t | get_bytes_read () const =0 |
virtual std::string | id () const |
DataSource & | operator= (const DataSource &)=delete |
DataSource & | operator= (DataSource &&)=default |
virtual size_t | peek (uint8_t out[], size_t length, size_t peek_offset) const =0 |
size_t | peek_byte (uint8_t &out) const |
virtual size_t | read (uint8_t out[], size_t length)=0 |
std::optional< uint8_t > | read_byte () |
size_t | read_byte (uint8_t &out) |
virtual | ~DataSource ()=default |
This class represents an abstract data source object.
Definition at line 25 of file data_src.h.
|
default |
Referenced by DataSource(), DataSource(), operator=(), operator=(), Botan::Pipe::process_msg(), and Botan::Pipe::write().
|
virtualdefault |
|
delete |
References DataSource().
|
default |
References DataSource().
|
pure virtual |
Implemented in Botan::DataSource_Memory, Botan::DataSource_Stream, Botan::Pipe, and Botan::SecureQueue.
size_t Botan::DataSource::discard_next | ( | size_t | N | ) |
Discard the next N bytes of the data
N | the number of bytes to discard |
Definition at line 53 of file data_src.cpp.
References read().
|
pure virtual |
Test whether the source still has data that can be read.
Implemented in Botan::DataSource_Memory, Botan::DataSource_Stream, Botan::Pipe, and Botan::SecureQueue.
Referenced by Botan::Pipe::write().
|
pure virtual |
Implemented in Botan::DataSource_Memory, Botan::DataSource_Stream, Botan::Pipe, and Botan::SecureQueue.
|
inlinevirtual |
return the id of this data source
Reimplemented in Botan::DataSource_Stream.
Definition at line 63 of file data_src.h.
|
delete |
References DataSource().
|
default |
References DataSource().
|
nodiscardpure virtual |
Read from the source but do not modify the internal offset. Consecutive calls to peek() will return portions of the source starting at the same position.
out | the byte array to write the output to |
length | the length of the byte array out |
peek_offset | the offset into the stream to read at |
Implemented in Botan::DataSource_Memory, Botan::DataSource_Stream, Botan::Pipe, and Botan::SecureQueue.
Referenced by Botan::PEM_Code::matches(), and peek_byte().
size_t Botan::DataSource::peek_byte | ( | uint8_t & | out | ) | const |
Peek at one byte.
out | an output byte |
Definition at line 46 of file data_src.cpp.
References peek().
Referenced by Botan::ASN1::maybe_BER().
|
nodiscardpure virtual |
Read from the source. Moves the internal offset so that every call to read will return a new portion of the source.
out | the byte array to write the result to |
length | the length of the byte array out |
Implemented in Botan::DataSource_Memory, Botan::DataSource_Stream, Botan::Pipe, and Botan::SecureQueue.
Referenced by discard_next(), read_byte(), read_byte(), and Botan::Pipe::write().
std::optional< uint8_t > Botan::DataSource::read_byte | ( | ) |
Read one byte.
Returns nullopt if no further bytes are available
Definition at line 34 of file data_src.cpp.
References read().
size_t Botan::DataSource::read_byte | ( | uint8_t & | out | ) |
Read one byte.
out | the byte to read to |
Definition at line 27 of file data_src.cpp.
References read().
Referenced by Botan::PEM_Code::decode(), and Botan::ASN1::maybe_BER().