libfilezilla
Toggle main menu visibility
Loading...
Searching...
No Matches
lib
libfilezilla
ascii_layer.hpp
Go to the documentation of this file.
1
#ifndef LIBFILEZILLA_ASCII_LAYER_HEADER
2
#define LIBFILEZILLA_ASCII_LAYER_HEADER
3
4
#include "
buffer.hpp
"
5
#include "
socket.hpp
"
6
7
#include <optional>
8
12
13
namespace
fz
{
20
class
FZ_PUBLIC_SYMBOL ascii_layer final :
public
socket_layer,
protected
fz::event_handler
21
{
22
public
:
23
ascii_layer(event_loop& loop, event_handler* handler,
socket_interface
& next_layer);
24
virtual
~ascii_layer();
25
26
virtual
int
read(
void
*
buffer
,
unsigned
int
size,
int
& error)
override
;
27
virtual
int
write(
void
const
*
buffer
,
unsigned
int
size,
int
& error)
override
;
28
29
virtual
int
shutdown
()
override
;
30
31
virtual
void
set_event_handler
(event_handler* handler,
fz::socket_event_flag
retrigger_block =
fz::socket_event_flag
{})
override
;
32
33
private
:
34
virtual
FZ_PRIVATE_SYMBOL
void
operator()(
fz::event_base
const
& ev)
override
;
35
void
FZ_PRIVATE_SYMBOL on_socket_event(
socket_event_source
* s,
socket_event_flag
t,
int
error);
36
37
std::optional<uint8_t> tmp_read_;
38
buffer
buffer_;
39
bool
was_cr_{};
40
bool
write_blocked_by_send_buffer_{};
41
bool
waiting_read_{};
42
};
43
}
44
45
#endif
buffer.hpp
Declares fz::buffer.
fz::ascii_layer::shutdown
virtual int shutdown() override
Signals peers that we want to close the connections.
fz::ascii_layer::set_event_handler
virtual void set_event_handler(event_handler *handler, fz::socket_event_flag retrigger_block=fz::socket_event_flag{}) override
The handler for any events generated (or forwarded) by this layer.
fz::buffer
The buffer class is a simple buffer where data can be appended at the end and consumed at the front....
Definition
buffer.hpp:27
fz::event_base
Common base class for all events.
Definition
event.hpp:23
fz::event_handler
Definition
event_handler.hpp:61
fz::socket_event_source
All classes sending socket events should derive from this.
Definition
socket.hpp:85
fz::socket_interface
Interface for sockets.
Definition
socket.hpp:375
fz
The namespace used by libfilezilla.
Definition
apply.hpp:17
fz::socket_event_flag
socket_event_flag
The type of a socket event.
Definition
socket.hpp:35
socket.hpp
Socket classes for networking.
Generated by
1.17.0