1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:47:44 +00:00

LibCore: Implement the Serenity Stream API classes

The Serenity Stream API is the name for the new set of classes intended
to replace IODevice and its descendants. It provides more flexibility
for subclasses by allowing each subclass to override all the possible
functionalities according to their wishes.

Stream is the base class which implements majority of the functionality
expected from a readable and writable stream. SeekableStream adds
seeking on top, and provides a couple utility methods which derive from
seek. Socket adds a couple of BSD socket utility functions such as
checking whether there is data available to read and checking the
pending bytes on the socket.

As for the concrete classes, there is File which is a SeekableStream and
is intended to operate on file-like objects; and TCPSocket, UDPSocket
and LocalSocket, which handle TCP, UDP and UNIX sockets respectively.

The concrete classes do not do buffering by default. For buffering
functionality, a set of augmentative classes named BufferedSeekable and
BufferedSocket have been implemented, intended to wrap a SeekableStream
and a Socket, respectively.
This commit is contained in:
sin-ack 2021-09-01 21:30:13 +00:00 committed by Ali Mohammad Pur
parent 69ef211925
commit 19e13117ad
3 changed files with 1462 additions and 0 deletions

View file

@ -27,6 +27,7 @@ set(SOURCES
Property.cpp
SecretString.cpp
Socket.cpp
Stream.cpp
StandardPaths.cpp
System.cpp
TCPServer.cpp