9 #include <botan/pipe.h>
10 #include <botan/internal/out_buf.h>
26 throw Invalid_Message_Number(func_name, msg);
37 throw Invalid_State(
"Cannot write to a Pipe while it is not processing");
38 m_pipe->
write(input, length);
46 write(reinterpret_cast<const uint8_t*>(str.data()), str.size());
65 size_t got = source.
read(buffer.data(), buffer.size());
66 write(buffer.data(), got);
75 return m_outputs->
read(output, length, get_message_no(
"read", msg));
91 return read(&out, 1, msg);
101 size_t got =
read(buffer.data(), buffer.size(), msg);
118 size_t got =
read(buffer.data(), buffer.size(), msg);
121 str.append(reinterpret_cast<const char*>(buffer.data()), got);
132 return m_outputs->
remaining(get_message_no(
"remaining", msg));
141 return m_outputs->
peek(output, length, offset, get_message_no(
"peek", msg));
147 size_t Pipe::peek(uint8_t output[],
size_t length,
size_t offset)
const
157 return peek(&out, 1, offset, 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
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)
size_t peek(uint8_t[], size_t, size_t, Pipe::message_id) const
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=DEFAULT_MESSAGE) BOTAN_WARN_UNUSED_RESULT
size_t remaining(Pipe::message_id) const
size_t get_bytes_read(Pipe::message_id) const
size_t default_msg() const
size_t read(uint8_t[], size_t, Pipe::message_id)
message_id message_count() const
void write(const uint8_t in[], size_t length)