9 #include <botan/pipe.h>
10 #include <botan/filter.h>
11 #include <botan/internal/out_buf.h>
27 throw Invalid_Message_Number(func_name, msg);
38 throw Invalid_State(
"Cannot write to a Pipe while it is not processing");
39 m_pipe->
write(input, length);
66 size_t got = source.
read(buffer.data(), buffer.size());
67 write(buffer.data(), got);
76 return m_outputs->read(output, length, get_message_no(
"read", msg));
92 return read(&out, 1, msg);
102 size_t got =
read(buffer.data(), buffer.size(), msg);
119 size_t got =
read(buffer.data(), buffer.size(), msg);
133 return m_outputs->remaining(get_message_no(
"remaining", msg));
142 return m_outputs->peek(output, length, offset, get_message_no(
"peek", msg));
148 size_t Pipe::peek(uint8_t output[],
size_t length,
size_t offset)
const
158 return peek(&out, 1, offset, msg);
168 return m_outputs->get_bytes_read(msg);
size_t remaining(message_id msg=DEFAULT_MESSAGE) const BOTAN_WARN_UNUSED_RESULT
size_t get_bytes_read() const override
virtual void write(const uint8_t input[], size_t length)=0
const uint8_t * cast_char_ptr_to_uint8(const char *s)
bool check_available(size_t n) override
size_t read(uint8_t output[], size_t length) override BOTAN_WARN_UNUSED_RESULT
secure_vector< uint8_t > read_all(message_id msg=DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT
size_t peek(uint8_t output[], size_t length, size_t offset) const override BOTAN_WARN_UNUSED_RESULT
static const message_id DEFAULT_MESSAGE
bool check_available_msg(size_t n, message_id msg)
std::vector< T, secure_allocator< T >> secure_vector
static const message_id LAST_MESSAGE
virtual bool end_of_data() const =0
virtual size_t read(uint8_t out[], size_t length) BOTAN_WARN_UNUSED_RESULT=0
std::string read_all_as_string(message_id msg=DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT
size_t default_msg() const
const char * cast_uint8_ptr_to_char(const uint8_t *b)
message_id message_count() const
void write(const uint8_t in[], size_t length)