Botan
1.10.9
|
#include <data_src.h>
Public Member Functions | |
DataSource_Memory (const std::string &in) | |
DataSource_Memory (const byte in[], size_t length) | |
DataSource_Memory (const MemoryRegion< byte > &in) | |
size_t | discard_next (size_t N) |
bool | end_of_data () const |
virtual std::string | id () const |
size_t | peek (byte[], size_t, size_t) const |
size_t | peek_byte (byte &out) const |
size_t | read (byte[], size_t) |
size_t | read_byte (byte &out) |
This class represents a Memory-Based DataSource
Definition at line 92 of file data_src.h.
Botan::DataSource_Memory::DataSource_Memory | ( | const std::string & | in | ) |
Construct a memory source that reads from a string
in | the string to read from |
Definition at line 98 of file data_src.cpp.
Botan::DataSource_Memory::DataSource_Memory | ( | const byte | in[], |
size_t | length | ||
) |
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 80 of file data_src.cpp.
Botan::DataSource_Memory::DataSource_Memory | ( | const MemoryRegion< byte > & | in | ) |
Construct a memory source that reads from a MemoryRegion
in | the MemoryRegion to read from |
Definition at line 89 of file data_src.cpp.
|
inherited |
Discard the next N bytes of the data
N | the number of bytes to discard |
Definition at line 35 of file data_src.cpp.
References n, and Botan::DataSource::read_byte().
|
virtual |
Test whether the source still has data that can be read.
Implements Botan::DataSource.
Definition at line 72 of file data_src.cpp.
References Botan::MemoryRegion< T >::size().
|
inlinevirtualinherited |
return the id of this data source
Reimplemented in Botan::DataSource_Stream, and Botan::DataSource_Command.
Definition at line 57 of file data_src.h.
|
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 |
Implements Botan::DataSource.
Definition at line 58 of file data_src.cpp.
References Botan::copy_mem(), and Botan::MemoryRegion< T >::size().
|
inherited |
Peek at one byte.
out | an output byte |
Definition at line 27 of file data_src.cpp.
References Botan::DataSource::peek().
Referenced by Botan::ASN1::maybe_BER().
|
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 |
Implements Botan::DataSource.
Definition at line 47 of file data_src.cpp.
References Botan::copy_mem(), and Botan::MemoryRegion< T >::size().
|
inherited |
Read one byte.
out | the byte to read to |
Definition at line 19 of file data_src.cpp.
References Botan::DataSource::read().
Referenced by Botan::PEM_Code::decode(), Botan::DataSource::discard_next(), Botan::BER_Decoder::discard_remaining(), Botan::PGP_decode(), and Botan::BER_Decoder::raw_bytes().