summaryrefslogtreecommitdiff
path: root/AK/CircularDuplexStream.h
AgeCommit message (Collapse)Author
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-01-07Everywhere: Fix many spelling errorsmjz19910
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2020-12-19AK: Remove bogus test case for CircularDuplexStream.asynts
2020-09-14AK: Lower the requirements for InputStream::eof and rename it.asynts
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-06Streams: Consistent behaviour when reading from stream with error.asynts
The streaming operator doesn't short-circuit, consider the following snippet: void foo(InputStream& stream) { int a, b; stream >> a >> b; } If the first read fails, the second is called regardless. It should be well defined what happens in this case: nothing.
2020-09-01Streams: Distinguish recoverable and fatal errors.asynts
2020-08-26AK: Add CircularDuplexStream class.asynts