|
Botan 3.13.0
Crypto and TLS for C&
|
#include <data_src.h>
Public Member Functions | |
| bool | check_available (size_t n) override |
| DataSource_Memory (const std::vector< uint8_t > &in) | |
| DataSource_Memory (const uint8_t in[], size_t length) | |
| DataSource_Memory (secure_vector< uint8_t > in) | |
| DataSource_Memory (std::span< const uint8_t > in) | |
| DataSource_Memory (std::string_view in) | |
| size_t | discard_next (size_t N) |
| bool | end_of_data () const override |
| size_t | get_bytes_read () const override |
| virtual std::string | id () const |
| size_t | peek (uint8_t buf[], size_t length, size_t offset) const override |
| size_t | peek_byte (uint8_t &out) const |
| size_t | read (uint8_t buf[], size_t length) override |
| std::optional< uint8_t > | read_byte () |
| size_t | read_byte (uint8_t &out) |
This class represents a Memory-Based DataSource
Definition at line 126 of file data_src.h.
|
explicit |
Construct a memory source that reads from a string
| in | the string to read from |
Definition at line 108 of file data_src.cpp.
References Botan::as_span_of_bytes(), and DataSource_Memory().
Referenced by DataSource_Memory(), DataSource_Memory(), and DataSource_Memory().
|
inline |
Construct a memory source that reads from a byte array
| in | the byte array to read from |
| length | the length of the byte array |
Definition at line 169 of file data_src.h.
References DataSource_Memory().
|
inlineexplicit |
Construct a memory source that reads from a secure_vector
| in | the MemoryRegion to read from |
Definition at line 175 of file data_src.h.
|
inlineexplicit |
Construct a memory source that reads from an arbitrary byte buffer
| in | the MemoryRegion to read from |
Definition at line 181 of file data_src.h.
|
inlineexplicit |
Construct a memory source that reads from a std::vector
| in | the MemoryRegion to read from |
Definition at line 192 of file data_src.h.
References DataSource_Memory().
|
overridevirtual |
Test whether at least n further bytes can be read
| n | the number of bytes required |
Implements Botan::DataSource.
Definition at line 80 of file data_src.cpp.
|
inherited |
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().
|
overridevirtual |
Test whether the source still has data that can be read
Implements Botan::DataSource.
Definition at line 101 of file data_src.cpp.
|
inlineoverridevirtual |
Count the bytes consumed from this source so far
Implements Botan::DataSource.
Definition at line 198 of file data_src.h.
|
inlinevirtualinherited |
return the id of this data source
Reimplemented in Botan::DataSource_Stream.
Definition at line 68 of file data_src.h.
|
overridevirtual |
Read from the source without modifying the internal offset
| buf | the byte array to write the result to |
| length | the length of the byte array buf |
| offset | the offset into the stream to read at |
Implements Botan::DataSource.
Definition at line 87 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
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().
|
overridevirtual |
Read from the source, advancing the internal offset
| buf | the byte array to write the result to |
| length | the length of the byte array buf |
Implements Botan::DataSource.
Definition at line 73 of file data_src.cpp.
References Botan::copy_mem().
|
inherited |
Read one byte.
Returns nullopt if no further bytes are available
Definition at line 34 of file data_src.cpp.
References read().
|
inherited |
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().