1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-12 02:30:30 +09:00
ladybird/Libraries/LibCore
asynts 96edcbc27c AK: Lower the requirements for InputStream::eof and rename it.
Consider the following snippet:

    void foo(InputStream& stream) {
        if(!stream.eof()) {
            u8 byte;
            stream >> byte;
        }
    }

There is a very subtle bug in this snippet, for some input streams eof()
might return false even if no more data can be read. In this case an
error flag would be set on the stream.

Until now I've always ensured that this is not the case, but this made
the implementation of eof() unnecessarily complicated.
InputFileStream::eof had to keep a ByteBuffer around just to make this
possible. That meant a ton of unnecessary copies just to get a reliable
eof().

In most cases it isn't actually necessary to have a reliable eof()
implementation.

In most other cases a reliable eof() is avaliable anyways because in
some cases like InputMemoryStream it is very easy to implement.
2020-09-14 20:58:12 +02:00
..
ArgsParser.cpp LibCore: Add support for double on argparse 2020-08-12 13:57:06 +02:00
ArgsParser.h LibCore: Add support for double on argparse 2020-08-12 13:57:06 +02:00
CMakeLists.txt LibCore: Rename puff.c => puff.cpp 2020-07-29 14:41:57 +02:00
ConfigFile.cpp LibCore: Add ConfigFile::get_for_lib() 2020-08-18 12:07:32 +02:00
ConfigFile.h LibCore: Add ConfigFile::get_for_lib() 2020-08-18 12:07:32 +02:00
DateTime.cpp LibCore: Let DateTime::create()/set_time() take summer time into account 2020-08-30 16:56:47 +02:00
DateTime.h LibCore: Comment that DateTime is in local time. 2020-08-20 20:53:43 +02:00
DirIterator.cpp Misc: Replace "String(string_view)" with "string_view.to_string()" 2020-05-06 19:28:59 +02:00
DirIterator.h Userspace: Add missing #includes now that AK/StdLibExtras.h is smaller 2020-03-08 13:06:51 +01:00
ElapsedTimer.cpp LibCore: Use monotonic time when handling timers 2020-03-19 15:48:00 +01:00
ElapsedTimer.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Event.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Event.h LibCore: Remove data pointer from CustomEvent 2020-08-27 10:12:04 +02:00
EventLoop.cpp LibCore: Fixed DeferredInvoke debug message (#3456) 2020-09-11 18:41:50 +02:00
EventLoop.h LibCore: Add 'notify_forked()' to tear down the eventloop in forked child 2020-09-09 20:35:21 +02:00
File.cpp LibCore: Add File::{stdin, stdout, stderr}() 2020-08-21 12:26:30 +02:00
File.h LibCore: Add File::{stdin, stdout, stderr}() 2020-08-21 12:26:30 +02:00
FileStream.h AK: Lower the requirements for InputStream::eof and rename it. 2020-09-14 20:58:12 +02:00
Forward.h LibCore: Fix typo in Forward.h 2020-06-11 22:44:54 +02:00
GetPassword.cpp LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
GetPassword.h LibCore: add get_password(). 2020-07-28 17:07:22 +02:00
Gzip.cpp LibCore: Trim decompressed Gzip output to size 2020-04-28 09:32:33 +02:00
Gzip.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
IODevice.cpp LibCore: Add Core::IODevice::truncate() 2020-09-06 16:09:26 +02:00
IODevice.h LibCore: Add Core::IODevice::truncate() 2020-09-06 16:09:26 +02:00
IODeviceStreamReader.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
LocalServer.cpp LibCore: Prefer strlcpy over strncpy, fix overflow 2020-08-24 00:45:03 +02:00
LocalServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
LocalSocket.cpp LibCore: Remove some debug spam in Local{Server,Socket} 2020-06-22 21:21:38 +02:00
LocalSocket.h LibCore: Add API for taking over an accepted socket from SystemServer 2020-06-21 21:54:30 +02:00
MimeData.cpp LibWeb: make it possible to directly load .svg files 2020-09-08 13:57:18 +02:00
MimeData.h LibCore+LibWeb: Move guess-mimetype-based-on-filename logic to LibCore 2020-07-27 19:57:20 +02:00
NetworkJob.cpp ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkJob.h ProtocolServer: Implement and handle download progress 2020-05-03 12:59:26 +02:00
NetworkResponse.cpp LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
NetworkResponse.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Notifier.cpp LibCore: Add a forward declaration header 2020-02-14 23:31:18 +01:00
Notifier.h LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Object.cpp LibCore: Include object names in Object::dump_tree() output 2020-09-14 16:16:36 +02:00
Object.h Meta: Force semi-colon after MAKE_AK_NONXXXABLE() 2020-08-27 10:12:04 +02:00
ProcessStatisticsReader.cpp Kernel/LibCore: Expose processor id where a thread last ran 2020-07-01 12:07:01 +02:00
ProcessStatisticsReader.h LibCore+top: Use pid_t for pgid/pgrp/sid numbers 2020-09-06 19:04:47 +02:00
puff.cpp LibCore: Rename puff.c => puff.cpp 2020-07-29 14:41:57 +02:00
puff.h Meta: Add a script check the presence of "#pragma once" in header files 2020-05-29 07:59:45 +02:00
Socket.cpp Everywhere: Port to String::copy_characters_to_buffer() 2020-08-30 17:35:27 +02:00
Socket.h LibCore: Change the signature of Socket::send() to use Span. 2020-07-27 19:58:09 +02:00
SocketAddress.cpp LibCore: Move LogStream::operator<< overloads into cpp files 2020-02-15 00:58:52 +01:00
SocketAddress.h Everywhere: Port to String::copy_characters_to_buffer() 2020-08-30 17:35:27 +02:00
StandardPaths.cpp LibCore+Base: Move user-specific config files to $HOME/.config 2020-08-05 17:40:47 +02:00
StandardPaths.h LibCore+Base: Move user-specific config files to $HOME/.config 2020-08-05 17:40:47 +02:00
SyscallUtils.h LibCore: Put safe_syscall() debug spam behind #ifdef 2020-06-22 21:19:10 +02:00
TCPServer.cpp LibCore: close socket on TCPServer dtor 2020-08-09 21:10:01 +02:00
TCPServer.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
TCPSocket.cpp Build: Make Lagom build under macOS (#2341) 2020-05-23 15:31:30 +02:00
TCPSocket.h LibCore: Remove a bunch of unnecessary forward declarations 2020-02-15 00:32:33 +01:00
Timer.cpp LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
Timer.h LibCore: Add Timer::restart() convenience API 2020-06-11 22:35:37 +02:00
UDPServer.cpp LibCore: update m_bound on socket bind 2020-08-10 20:03:18 +02:00
UDPServer.h LibCore: Fix UDPServer up to properly receive data 2020-04-04 12:25:33 +02:00
UDPSocket.cpp LibCore: remove redundant UDPSocket constructor 2020-08-10 20:03:18 +02:00
UDPSocket.h LibCore: remove redundant UDPSocket constructor 2020-08-10 20:03:18 +02:00