Botan 3.9.0
Crypto and TLS for C&
Botan::Pipe Class Referencefinal

#include <pipe.h>

Inheritance diagram for Botan::Pipe:
Botan::DataSource

Classes

class  Invalid_Message_Number

Public Types

typedef size_t message_id

Public Member Functions

void append (Filter *filt)
void append_filter (Filter *filt)
bool check_available (size_t n) override
bool check_available_msg (size_t n, message_id msg) const
size_t default_msg () const
size_t discard_next (size_t N)
void end_msg ()
bool end_of_data () const override
size_t get_bytes_read () const override
size_t get_bytes_read (message_id msg) const
virtual std::string id () const
message_id message_count () const
Pipeoperator= (const Pipe &)=delete
Pipeoperator= (Pipe &&)=delete
size_t peek (uint8_t &output, size_t offset, message_id msg=DEFAULT_MESSAGE) const
size_t peek (uint8_t output[], size_t length, size_t offset) const override
size_t peek (uint8_t output[], size_t length, size_t offset, message_id msg) const
size_t peek_byte (uint8_t &out) const
 Pipe (const Pipe &)=delete
BOTAN_FUTURE_EXPLICIT Pipe (Filter *f1=nullptr, Filter *f2=nullptr, Filter *f3=nullptr, Filter *f4=nullptr)
 Pipe (Pipe &&) noexcept
 Pipe (std::initializer_list< Filter * > filters)
void pop ()
void prepend (Filter *filt)
void prepend_filter (Filter *filt)
void process_msg (const secure_vector< uint8_t > &in)
void process_msg (const std::vector< uint8_t > &in)
void process_msg (const uint8_t in[], size_t length)
void process_msg (DataSource &in)
void process_msg (std::span< const uint8_t > input)
void process_msg (std::string_view in)
size_t read (uint8_t &output, message_id msg=DEFAULT_MESSAGE)
size_t read (uint8_t output[], size_t length) override
size_t read (uint8_t output[], size_t length, message_id msg)
secure_vector< uint8_t > read_all (message_id msg=DEFAULT_MESSAGE)
std::string read_all_as_string (message_id msg=DEFAULT_MESSAGE)
std::optional< uint8_t > read_byte ()
size_t read_byte (uint8_t &out)
size_t remaining (message_id msg=DEFAULT_MESSAGE) const
void reset ()
void set_default_msg (message_id msg)
void start_msg ()
void write (const secure_vector< uint8_t > &in)
void write (const std::vector< uint8_t > &in)
void write (const uint8_t in[], size_t length)
void write (DataSource &in)
void write (std::span< const uint8_t > in)
void write (std::string_view in)
void write (uint8_t in)
 ~Pipe () override

Static Public Attributes

static const message_id DEFAULT_MESSAGE = static_cast<Pipe::message_id>(-1)
static const message_id LAST_MESSAGE = static_cast<Pipe::message_id>(-2)

Detailed Description

This class represents pipe objects. A set of filters can be placed into a pipe, and information flows through the pipe until it reaches the end, where the output is collected for retrieval. If you're familiar with the Unix shell environment, this design will sound quite familiar.

Warning
This Pipe interface, and all associated types (Filter, etc) are considered decrepit, no longer used within the library itself, and likely will see no future development. Avoid in new code.

Definition at line 34 of file pipe.h.

Member Typedef Documentation

◆ message_id

typedef size_t Botan::Pipe::message_id

An opaque type that identifies a message in this Pipe

Definition at line 39 of file pipe.h.

Constructor & Destructor Documentation

◆ Pipe() [1/4]

Botan::Pipe::Pipe ( Filter * f1 = nullptr,
Filter * f2 = nullptr,
Filter * f3 = nullptr,
Filter * f4 = nullptr )

Construct a Pipe of up to four filters. The filters are set up in the same order as the arguments.

Definition at line 41 of file pipe.cpp.

41: Pipe({f1, f2, f3, f4}) {}
BOTAN_FUTURE_EXPLICIT Pipe(Filter *f1=nullptr, Filter *f2=nullptr, Filter *f3=nullptr, Filter *f4=nullptr)
Definition pipe.cpp:41

References Pipe().

Referenced by Botan::Pipe::Invalid_Message_Number::Invalid_Message_Number(), operator=(), operator=(), Pipe(), Pipe(), and Pipe().

◆ Pipe() [2/4]

Botan::Pipe::Pipe ( std::initializer_list< Filter * > filters)

Construct a Pipe from a list of filters

Parameters
filtersthe set of filters to use

Definition at line 46 of file pipe.cpp.

46 : m_pipe(nullptr), m_default_read(0), m_inside_msg(false) {
47 m_outputs = std::make_unique<Output_Buffers>();
48
49 for(auto* arg : args) {
50 do_append(arg);
51 }
52}

◆ Pipe() [3/4]

Botan::Pipe::Pipe ( const Pipe & )
delete

References Pipe().

◆ Pipe() [4/4]

Botan::Pipe::Pipe ( Pipe && )
defaultnoexcept

References Pipe().

◆ ~Pipe()

Botan::Pipe::~Pipe ( )
override

Definition at line 57 of file pipe.cpp.

57 {
58 destruct(m_pipe);
59}

Member Function Documentation

◆ append()

void Botan::Pipe::append ( Filter * filt)

Insert a new filter at the back of the pipe Deprecated because runtime modification of Pipes is deprecated. You can instead use append_filter which only works before the first message is processed.

Parameters
filtthe new filter to insert

Definition at line 208 of file pipe.cpp.

208 {
209 do_append(filter);
210}

◆ append_filter()

void Botan::Pipe::append_filter ( Filter * filt)

Append a new filter onto the filter sequence. This may only be called immediately after initial construction, before any calls to start_msg have been made.

This function (unlike append) is not deprecated, as it allows only modification of the pipe at initialization (before use) rather than after messages have been processed.

Definition at line 212 of file pipe.cpp.

212 {
213 if(m_outputs->message_count() != 0) {
214 throw Invalid_State("Cannot call Pipe::append_filter after start_msg");
215 }
216
217 do_append(filter);
218}

◆ check_available()

bool Botan::Pipe::check_available ( size_t n)
overridevirtual

Implements Botan::DataSource.

Definition at line 162 of file pipe_rw.cpp.

162 {
163 return (n <= remaining(default_msg()));
164}
size_t default_msg() const
Definition pipe.h:247
size_t remaining(message_id msg=DEFAULT_MESSAGE) const
Definition pipe_rw.cpp:129

References default_msg(), and remaining().

◆ check_available_msg()

bool Botan::Pipe::check_available_msg ( size_t n,
message_id msg ) const

Definition at line 166 of file pipe_rw.cpp.

166 {
167 return (n <= remaining(msg));
168}

References remaining().

◆ default_msg()

size_t Botan::Pipe::default_msg ( ) const
inline
Returns
currently set default message

Definition at line 247 of file pipe.h.

247{ return m_default_read; }

Referenced by check_available(), get_bytes_read(), read_all(), and read_all_as_string().

◆ discard_next()

size_t Botan::DataSource::discard_next ( size_t N)
inherited

Discard the next N bytes of the data

Parameters
Nthe number of bytes to discard
Returns
number of bytes actually discarded

Definition at line 53 of file data_src.cpp.

53 {
54 uint8_t buf[64] = {0};
55 size_t discarded = 0;
56
57 while(n > 0) {
58 const size_t got = this->read(buf, std::min(n, sizeof(buf)));
59 discarded += got;
60 n -= got;
61
62 if(got == 0) {
63 break;
64 }
65 }
66
67 return discarded;
68}
virtual size_t read(uint8_t out[], size_t length)=0

References read().

◆ end_msg()

void Botan::Pipe::end_msg ( )

End the current message.

Definition at line 163 of file pipe.cpp.

163 {
164 if(!m_inside_msg) {
165 throw Invalid_State("Pipe::end_msg: Message was already ended");
166 }
167 m_pipe->finish_msg();
168 clear_endpoints(m_pipe);
169 if(dynamic_cast<Null_Filter*>(m_pipe) != nullptr) {
170 delete m_pipe;
171 m_pipe = nullptr;
172 }
173 m_inside_msg = false;
174
175 m_outputs->retire();
176}

Referenced by process_msg(), and process_msg().

◆ end_of_data()

bool Botan::Pipe::end_of_data ( ) const
overridevirtual

Test whether this pipe has any data that can be read from.

Returns
true if there is more data to read, false otherwise

Implements Botan::DataSource.

Definition at line 91 of file pipe.cpp.

91 {
92 return (remaining() == 0);
93}

References remaining().

◆ get_bytes_read() [1/2]

size_t Botan::Pipe::get_bytes_read ( ) const
overridevirtual
Returns
the number of bytes read from the default message.

Implements Botan::DataSource.

Definition at line 154 of file pipe_rw.cpp.

154 {
155 return m_outputs->get_bytes_read(default_msg());
156}

References default_msg().

◆ get_bytes_read() [2/2]

size_t Botan::Pipe::get_bytes_read ( message_id msg) const
Returns
the number of bytes read from the specified message.

Definition at line 158 of file pipe_rw.cpp.

158 {
159 return m_outputs->get_bytes_read(msg);
160}

◆ id()

virtual std::string Botan::DataSource::id ( ) const
inlinevirtualinherited

return the id of this data source

Returns
std::string representing the id of this data source

Reimplemented in Botan::DataSource_Stream.

Definition at line 63 of file data_src.h.

63{ return ""; }

◆ message_count()

Pipe::message_id Botan::Pipe::message_count ( ) const

Get the number of messages the are in this pipe.

Returns
number of messages the are in this pipe

Definition at line 312 of file pipe.cpp.

312 {
313 return m_outputs->message_count();
314}

Referenced by set_default_msg().

◆ operator=() [1/2]

Pipe & Botan::Pipe::operator= ( const Pipe & )
delete

References Pipe().

◆ operator=() [2/2]

Pipe & Botan::Pipe::operator= ( Pipe && )
delete

References BOTAN_PUBLIC_API, and Pipe().

◆ peek() [1/3]

size_t Botan::Pipe::peek ( uint8_t & output,
size_t offset,
message_id msg = DEFAULT_MESSAGE ) const
nodiscard

Read a single byte from the specified message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.

Parameters
outputthe byte to write the peeked message byte to
offsetthe offset from the current position in message
msgthe number identifying the message to peek from
Returns
number of bytes actually peeked and written into output

Definition at line 150 of file pipe_rw.cpp.

150 {
151 return peek(&out, 1, offset, msg);
152}
size_t peek(uint8_t output[], size_t length, size_t offset) const override
Definition pipe_rw.cpp:143

References peek().

◆ peek() [2/3]

size_t Botan::Pipe::peek ( uint8_t output[],
size_t length,
size_t offset ) const
nodiscardoverridevirtual

Read from the default message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.

Parameters
outputthe byte array to write the peeked message part to
lengththe length of the byte array output
offsetthe offset from the current position in message
Returns
number of bytes actually peeked and written into output

Implements Botan::DataSource.

Definition at line 143 of file pipe_rw.cpp.

143 {
144 return peek(output, length, offset, DEFAULT_MESSAGE);
145}
static const message_id DEFAULT_MESSAGE
Definition pipe.h:62

References DEFAULT_MESSAGE, and peek().

Referenced by peek(), and peek().

◆ peek() [3/3]

size_t Botan::Pipe::peek ( uint8_t output[],
size_t length,
size_t offset,
message_id msg ) const
nodiscard

Read from the specified message but do not modify the internal offset. Consecutive calls to peek() will return portions of the message starting at the same position.

Parameters
outputthe byte array to write the peeked message part to
lengththe length of the byte array output
offsetthe offset from the current position in message
msgthe number identifying the message to peek from
Returns
number of bytes actually peeked and written into output

Definition at line 136 of file pipe_rw.cpp.

136 {
137 return m_outputs->peek(output, length, offset, get_message_no("peek", msg));
138}

◆ peek_byte()

size_t Botan::DataSource::peek_byte ( uint8_t & out) const
inherited

Peek at one byte.

Parameters
outan output byte
Returns
length in bytes that was actually read and put into out

Definition at line 46 of file data_src.cpp.

46 {
47 return peek(&out, 1, 0);
48}
virtual size_t peek(uint8_t out[], size_t length, size_t peek_offset) const =0

References peek().

Referenced by Botan::ASN1::maybe_BER().

◆ pop()

void Botan::Pipe::pop ( )

Remove the first filter at the front of the pipe.

Definition at line 287 of file pipe.cpp.

287 {
288 if(m_inside_msg) {
289 throw Invalid_State("Cannot pop off a Pipe while it is processing");
290 }
291
292 if(m_pipe == nullptr) {
293 return;
294 }
295
296 if(m_pipe->total_ports() > 1) {
297 throw Invalid_State("Cannot pop off a Filter with multiple ports");
298 }
299
300 size_t to_remove = m_pipe->owns() + 1;
301
302 while(to_remove > 0) {
303 std::unique_ptr<Filter> to_destroy(m_pipe);
304 m_pipe = m_pipe->m_next[0];
305 to_remove -= 1;
306 }
307}

◆ prepend()

void Botan::Pipe::prepend ( Filter * filt)

Insert a new filter at the front of the pipe Deprecated because runtime modification of Pipes is deprecated. You can instead use prepend_filter which only works before the first message is processed.

Parameters
filtthe new filter to insert

Definition at line 220 of file pipe.cpp.

220 {
221 do_prepend(filter);
222}

◆ prepend_filter()

void Botan::Pipe::prepend_filter ( Filter * filt)

Prepend a new filter onto the filter sequence. This may only be called immediately after initial construction, before any calls to start_msg have been made.

This function (unlike prepend) is not deprecated, as it allows only modification of the pipe at initialization (before use) rather than after messages have been processed.

Definition at line 224 of file pipe.cpp.

224 {
225 if(m_outputs->message_count() != 0) {
226 throw Invalid_State("Cannot call Pipe::prepend_filter after start_msg");
227 }
228
229 do_prepend(filter);
230}

◆ process_msg() [1/6]

void Botan::Pipe::process_msg ( const secure_vector< uint8_t > & in)

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inthe secure_vector containing the data to write

Definition at line 121 of file pipe.cpp.

121 {
122 this->process_msg(std::span{input});
123}
void process_msg(const uint8_t in[], size_t length)
Definition pipe.cpp:108

References process_msg().

◆ process_msg() [2/6]

void Botan::Pipe::process_msg ( const std::vector< uint8_t > & in)

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inthe secure_vector containing the data to write

Definition at line 125 of file pipe.cpp.

125 {
126 this->process_msg(std::span{input});
127}

References process_msg().

◆ process_msg() [3/6]

void Botan::Pipe::process_msg ( const uint8_t in[],
size_t length )

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inthe byte array containing the data to write
lengththe length of the byte array to write

Definition at line 108 of file pipe.cpp.

108 {
109 start_msg();
110 write(input, length);
111 end_msg();
112}
void end_msg()
Definition pipe.cpp:163
void write(const uint8_t in[], size_t length)
Definition pipe_rw.cpp:42
void start_msg()
Definition pipe.cpp:148

References end_msg(), start_msg(), and write().

Referenced by process_msg(), process_msg(), process_msg(), and process_msg().

◆ process_msg() [4/6]

void Botan::Pipe::process_msg ( DataSource & in)

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inthe DataSource providing the data to write

Definition at line 139 of file pipe.cpp.

139 {
140 start_msg();
141 write(input);
142 end_msg();
143}

References Botan::DataSource::DataSource(), end_msg(), start_msg(), and write().

◆ process_msg() [5/6]

void Botan::Pipe::process_msg ( std::span< const uint8_t > input)

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inputthe byte array containing the data to write

Definition at line 114 of file pipe.cpp.

114 {
115 this->process_msg(input.data(), input.size());
116}

References process_msg().

◆ process_msg() [6/6]

void Botan::Pipe::process_msg ( std::string_view in)

Perform start_msg(), write() and end_msg() sequentially.

Parameters
inthe string containing the data to write

Definition at line 132 of file pipe.cpp.

132 {
134}
std::span< const uint8_t > as_span_of_bytes(const char *s, size_t len)
Definition mem_utils.h:28

References Botan::as_span_of_bytes(), and process_msg().

◆ read() [1/3]

size_t Botan::Pipe::read ( uint8_t & output,
message_id msg = DEFAULT_MESSAGE )
nodiscard

Read a single byte from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.

Parameters
outputthe byte to write the result to
msgthe message to read from
Returns
number of bytes actually read into output

Definition at line 91 of file pipe_rw.cpp.

91 {
92 return read(&out, 1, msg);
93}
size_t read(uint8_t output[], size_t length) override
Definition pipe_rw.cpp:84

References read().

◆ read() [2/3]

size_t Botan::Pipe::read ( uint8_t output[],
size_t length )
nodiscardoverridevirtual

Read the default message from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.

Parameters
outputthe byte array to write the read bytes to
lengththe length of the byte array output
Returns
number of bytes actually read into output

Implements Botan::DataSource.

Definition at line 84 of file pipe_rw.cpp.

84 {
85 return read(output, length, DEFAULT_MESSAGE);
86}

References DEFAULT_MESSAGE, and read().

Referenced by Botan::operator<<(), Botan::operator<<(), read(), read(), read_all(), and read_all_as_string().

◆ read() [3/3]

size_t Botan::Pipe::read ( uint8_t output[],
size_t length,
message_id msg )
nodiscard

Read a specified message from the pipe. Moves the internal offset so that every call to read will return a new portion of the message.

Parameters
outputthe byte array to write the read bytes to
lengththe length of the byte array output
msgthe number identifying the message to read from
Returns
number of bytes actually read into output

Definition at line 77 of file pipe_rw.cpp.

77 {
78 return m_outputs->read(output, length, get_message_no("read", msg));
79}

◆ read_all()

secure_vector< uint8_t > Botan::Pipe::read_all ( message_id msg = DEFAULT_MESSAGE)
nodiscard

Read the full contents of the pipe.

Parameters
msgthe number identifying the message to read from
Returns
secure_vector holding the contents of the pipe

Definition at line 98 of file pipe_rw.cpp.

98 {
99 msg = ((msg != DEFAULT_MESSAGE) ? msg : default_msg());
101 size_t got = read(buffer.data(), buffer.size(), msg);
102 buffer.resize(got);
103 return buffer;
104}
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:69

References DEFAULT_MESSAGE, default_msg(), read(), and remaining().

◆ read_all_as_string()

std::string Botan::Pipe::read_all_as_string ( message_id msg = DEFAULT_MESSAGE)
nodiscard

Read the full contents of the pipe.

Parameters
msgthe number identifying the message to read from
Returns
string holding the contents of the pipe

Definition at line 109 of file pipe_rw.cpp.

109 {
110 msg = ((msg != DEFAULT_MESSAGE) ? msg : default_msg());
112 std::string str;
113 str.reserve(remaining(msg));
114
115 while(true) {
116 size_t got = read(buffer.data(), buffer.size(), msg);
117 if(got == 0) {
118 break;
119 }
120 str.append(cast_uint8_ptr_to_char(buffer.data()), got);
121 }
122
123 return str;
124}
const char * cast_uint8_ptr_to_char(const uint8_t *b)
Definition mem_ops.h:282
constexpr size_t DefaultBufferSize
Definition types.h:137

References Botan::cast_uint8_ptr_to_char(), DEFAULT_MESSAGE, default_msg(), Botan::DefaultBufferSize, read(), and remaining().

◆ read_byte() [1/2]

std::optional< uint8_t > Botan::DataSource::read_byte ( )
inherited

Read one byte.

Returns nullopt if no further bytes are available

Definition at line 34 of file data_src.cpp.

34 {
35 uint8_t b = 0;
36 if(this->read(&b, 1) == 1) {
37 return b;
38 } else {
39 return {};
40 }
41}

References read().

◆ read_byte() [2/2]

size_t Botan::DataSource::read_byte ( uint8_t & out)
inherited

Read one byte.

Parameters
outthe byte to read to
Returns
length in bytes that was actually read and put into out

Definition at line 27 of file data_src.cpp.

27 {
28 return read(&out, 1);
29}

References read().

Referenced by Botan::PEM_Code::decode(), and Botan::ASN1::maybe_BER().

◆ remaining()

size_t Botan::Pipe::remaining ( message_id msg = DEFAULT_MESSAGE) const
nodiscard

Find out how many bytes are ready to read.

Parameters
msgthe number identifying the message for which the information is desired
Returns
number of bytes that can still be read

Definition at line 129 of file pipe_rw.cpp.

129 {
130 return m_outputs->remaining(get_message_no("remaining", msg));
131}

Referenced by check_available(), check_available_msg(), end_of_data(), Botan::operator<<(), Botan::operator<<(), read_all(), and read_all_as_string().

◆ reset()

void Botan::Pipe::reset ( )

Reset this pipe to an empty pipe.

Definition at line 64 of file pipe.cpp.

64 {
65 destruct(m_pipe);
66 m_pipe = nullptr;
67 m_inside_msg = false;
68}

◆ set_default_msg()

void Botan::Pipe::set_default_msg ( message_id msg)

Set the default message

Parameters
msgthe number identifying the message which is going to be the new default message

Definition at line 98 of file pipe.cpp.

98 {
99 if(msg >= message_count()) {
100 throw Invalid_Argument("Pipe::set_default_msg: msg number is too high");
101 }
102 m_default_read = msg;
103}
message_id message_count() const
Definition pipe.cpp:312

References message_count().

◆ start_msg()

void Botan::Pipe::start_msg ( )

Start a new message in the pipe. A potential other message in this pipe must be closed with end_msg() before this function may be called.

Definition at line 148 of file pipe.cpp.

148 {
149 if(m_inside_msg) {
150 throw Invalid_State("Pipe::start_msg: Message was already started");
151 }
152 if(m_pipe == nullptr) {
153 m_pipe = new Null_Filter; // NOLINT(*-owning-memory)
154 }
155 find_endpoints(m_pipe);
156 m_pipe->new_msg();
157 m_inside_msg = true;
158}

Referenced by process_msg(), and process_msg().

◆ write() [1/7]

void Botan::Pipe::write ( const secure_vector< uint8_t > & in)
inline

Write input to the pipe, i.e. to its first filter.

Parameters
inthe secure_vector containing the data to write

Definition at line 81 of file pipe.h.

81{ write(in.data(), in.size()); }

References write().

Referenced by write().

◆ write() [2/7]

void Botan::Pipe::write ( const std::vector< uint8_t > & in)
inline

Write input to the pipe, i.e. to its first filter.

Parameters
inthe std::vector containing the data to write

Definition at line 87 of file pipe.h.

87{ write(in.data(), in.size()); }

References write().

Referenced by write().

◆ write() [3/7]

void Botan::Pipe::write ( const uint8_t in[],
size_t length )

Write input to the pipe, i.e. to its first filter.

Parameters
inthe byte array to write
lengththe length of the byte array in

Definition at line 42 of file pipe_rw.cpp.

42 {
43 if(!m_inside_msg) {
44 throw Invalid_State("Cannot write to a Pipe while it is not processing");
45 }
46 m_pipe->write(input, length);
47}

Referenced by Botan::operator>>(), Botan::operator>>(), process_msg(), process_msg(), write(), write(), write(), and write().

◆ write() [4/7]

void Botan::Pipe::write ( DataSource & in)

Write input to the pipe, i.e. to its first filter.

Parameters
inthe DataSource to read the data from

Definition at line 66 of file pipe_rw.cpp.

66 {
68 while(!source.end_of_data()) {
69 size_t got = source.read(buffer.data(), buffer.size());
70 write(buffer.data(), got);
71 }
72}

References Botan::DataSource::DataSource(), Botan::DefaultBufferSize, Botan::DataSource::end_of_data(), Botan::DataSource::read(), and write().

◆ write() [5/7]

void Botan::Pipe::write ( std::span< const uint8_t > in)

Write input to the pipe, i.e. to its first filter.

Parameters
inthe byte array to write

Definition at line 35 of file pipe_rw.cpp.

35 {
36 this->write(input.data(), input.size());
37}

References write().

◆ write() [6/7]

void Botan::Pipe::write ( std::string_view in)

Write input to the pipe, i.e. to its first filter.

Parameters
inthe string containing the data to write

Definition at line 52 of file pipe_rw.cpp.

52 {
54}

References Botan::as_span_of_bytes(), and write().

◆ write() [7/7]

void Botan::Pipe::write ( uint8_t in)

Write input to the pipe, i.e. to its first filter.

Parameters
ina single byte to be written

Definition at line 59 of file pipe_rw.cpp.

59 {
60 write(&input, 1);
61}

References write().

Member Data Documentation

◆ DEFAULT_MESSAGE

const Pipe::message_id Botan::Pipe::DEFAULT_MESSAGE = static_cast<Pipe::message_id>(-1)
static

A meta-id for the default message (set with set_default_msg)

Definition at line 62 of file pipe.h.

Referenced by peek(), read(), read_all(), and read_all_as_string().

◆ LAST_MESSAGE

const Pipe::message_id Botan::Pipe::LAST_MESSAGE = static_cast<Pipe::message_id>(-2)
static

A meta-id for whatever the last message is

Definition at line 57 of file pipe.h.


The documentation for this class was generated from the following files: