9#include <botan/internal/out_buf.h>
10#include <botan/secqueue.h>
37 throw Invalid_State(
"Cannot write to a Pipe while it is not processing");
38 pipe->write(input, length);
54 write(
reinterpret_cast<const byte*
>(str.data()), str.size());
73 size_t got = source.
read(&buffer[0], buffer.
size());
74 write(&buffer[0], got);
83 return outputs->read(output, length, get_message_no(
"read", msg));
99 return read(&out, 1, msg);
109 size_t got =
read(&buffer[0], buffer.
size(), msg);
126 size_t got =
read(&buffer[0], buffer.
size(), msg);
129 str.append(
reinterpret_cast<const char*
>(&buffer[0]), got);
140 return outputs->remaining(get_message_no(
"remaining", msg));
159 return outputs->peek(output, length, offset, get_message_no(
"peek", msg));
165size_t Pipe::peek(
byte output[],
size_t length,
size_t offset)
const
175 return peek(&out, 1, offset, msg);
virtual size_t read(byte out[], size_t length)=0
virtual bool end_of_data() const =0
static const message_id LAST_MESSAGE
SecureVector< byte > read_all(message_id msg=DEFAULT_MESSAGE)
size_t default_msg() const
static const message_id DEFAULT_MESSAGE
void write(const byte in[], size_t length)
size_t remaining(message_id msg=DEFAULT_MESSAGE) const
size_t read(byte output[], size_t length)
bool check_available_msg(size_t n, message_id msg)
bool check_available(size_t n)
message_id message_count() const
std::string read_all_as_string(message_id=DEFAULT_MESSAGE)
size_t peek(byte output[], size_t length, size_t offset) const
Invalid_State(const std::string &err)
Invalid_Message_Number(const std::string &where, message_id msg)