Botan 3.6.1
Crypto and TLS for C&
|
#include <data_src.h>
Public Member Functions | |
bool | check_available (size_t n) override |
DataSource_Stream (const DataSource_Stream &)=delete | |
DataSource_Stream (std::istream &, std::string_view id="<std::istream>") | |
size_t | discard_next (size_t N) |
bool | end_of_data () const override |
size_t | get_bytes_read () const override |
std::string | id () const override |
DataSource_Stream & | operator= (const DataSource_Stream &)=delete |
size_t | peek (uint8_t[], size_t, size_t) const override |
size_t | peek_byte (uint8_t &out) const |
size_t | read (uint8_t[], size_t) override |
size_t | read_byte (uint8_t &out) |
~DataSource_Stream () override | |
This class represents a Stream-Based DataSource.
Definition at line 148 of file data_src.h.
Botan::DataSource_Stream::DataSource_Stream | ( | std::istream & | in, |
std::string_view | id = "<std::istream>" ) |
Definition at line 189 of file data_src.cpp.
|
delete |
|
overridedefault |
|
overridevirtual |
Implements Botan::DataSource.
Definition at line 112 of file data_src.cpp.
|
inherited |
Discard the next N bytes of the data
N | the number of bytes to discard |
Definition at line 40 of file data_src.cpp.
References Botan::DataSource::read().
|
overridevirtual |
Test whether the source still has data that can be read.
Implements Botan::DataSource.
Definition at line 158 of file data_src.cpp.
Referenced by peek().
|
inlineoverridevirtual |
Implements Botan::DataSource.
Definition at line 173 of file data_src.h.
|
overridevirtual |
return the id of this data source
Reimplemented from Botan::DataSource.
Definition at line 165 of file data_src.cpp.
|
delete |
|
overridevirtual |
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 |
Implements Botan::DataSource.
Definition at line 123 of file data_src.cpp.
References Botan::cast_uint8_ptr_to_char(), and end_of_data().
|
inherited |
Peek at one byte.
out | an output byte |
Definition at line 33 of file data_src.cpp.
References Botan::DataSource::peek().
Referenced by Botan::ASN1::maybe_BER().
|
overridevirtual |
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 |
Implements Botan::DataSource.
Definition at line 101 of file data_src.cpp.
References Botan::cast_uint8_ptr_to_char().
|
inherited |
Read one byte.
out | the byte to read to |
Definition at line 26 of file data_src.cpp.
References Botan::DataSource::read().
Referenced by Botan::PEM_Code::decode(), Botan::BER_Decoder::discard_remaining(), and Botan::ASN1::maybe_BER().