summaryrefslogtreecommitdiff
path: root/AK/Forward.h
AgeCommit message (Collapse)Author
2020-09-21AK: Remove BufferStream class.asynts
There are three classes avaliable that share the functionality of BufferStream: 1. InputMemoryStream is for reading from static buffers. Example: Bytes input = /* ... */; InputMemoryStream stream { input }; LittleEndian<u32> little_endian_value; input >> little_endian_value; u32 host_endian_value; input >> host_endian_value; SomeComplexStruct complex_struct; input >> Bytes { &complex_struct, sizeof(complex_struct) }; 2. OutputMemoryStream is for writing to static buffers. Example: Array<u8, 4096> buffer; OutputMemoryStream stream; stream << LittleEndian<u32> { 42 }; stream << ReadonlyBytes { &complex_struct, sizeof(complex_struct) }; foo(stream.bytes()); 3. DuplexMemoryStream for writing to dynamic buffers, can also be used as an intermediate buffer by reading from it directly. Example: DuplexMemoryStream stream; stream << NetworkOrdered<u32> { 13 }; stream << NetowkrOrdered<u64> { 22 }; NetworkOrdered<u32> value; stream >> value; ASSERT(value == 13); foo(stream.copy_into_contiguous_buffer()); Unlike BufferStream these streams do not use a fixed endianness (BufferStream used little endian) these have to be explicitly specified. There are helper types in <AK/Endian.h>.
2020-09-15AK: Re-add OutputMemoryStream for static buffers only.asynts
2020-09-15AK: Remove OutputMemoryStream for DuplexMemoryStream.asynts
OutputMemoryStream was originally a proxy for DuplexMemoryStream that did not expose any reading API. Now I need to add another class that is like OutputMemoryStream but only for static buffers. My first idea was to make OutputMemoryStream do that too, but I think it's much better to have a distinct class for that. I originally wanted to call that class FixedOutputMemoryStream but that name is really cumbersome and it's a bit unintuitive because InputMemoryStream is already reading from a fixed buffer. So let's just use DuplexMemoryStream instead of OutputMemoryStream for any dynamic stuff and create a new OutputMemoryStream for static buffers.
2020-09-12AK: Fix forward-declaration of ArrayBen Wiederhake
2020-09-08AK: Remove FixedArray class.asynts
2020-09-08AK: Add Array<T, Size> template.asynts
2020-09-08AK: Add generic SimpleIterator class to replace VectorIterator.asynts
2020-09-01AK: Add OutputMemoryStream class.asynts
2020-08-26AK: Add InputBitStream class.asynts
2020-08-26AK: Add CircularDuplexStream class.asynts
2020-08-20AK: Add DuplexMemoryStream class.asynts
This class is similar to BufferStream because it is possible to both read and write to it. However, it differs in the following ways: - DuplexMemoryStream keeps a history of 64KiB and discards the rest, BufferStream always keeps everything around. - DuplexMemoryStream tracks reading and writing seperately, the following is valid: DuplexMemoryStream stream; stream << 42; int value; stream >> value; For BufferStream it would read: BufferStream stream; stream << 42; int value; stream.seek(0); stream >> value; In the future I would like to replace all usages of BufferStream with InputMemoryStream, OutputMemoryStream (doesn't exist yet) and DuplexMemoryStream. For now I just add DuplexMemoryStream though.
2020-08-06AK: Add InputStream abstraction and InputMemoryStream implementation.asynts
2020-07-26AK: Implement Span which represents a contiguous sequence of objects.asynts
This makes it possible to pass one object rather than pointer and length individually.
2020-05-17AK: Add a very basic Utf32View classAndreas Kling
This allows you to wrap a { const u32* codepoints, size_t length } in a simple object.
2020-03-22AK: Add FlyString, a simple flyweight string classAndreas Kling
FlyString is a flyweight string class that wraps a RefPtr<StringImpl> known to be unique among the set of FlyStrings. The class is very unoptimized at the moment. When to use FlyString: - When you want O(1) string comparison - When you want to deduplicate a lot of identical strings When not to use FlyString: - For strings that don't need either of the above features - For strings that are likely to be unique
2020-02-25AK: Make Vector use size_t for its size and capacityAndreas Kling
2020-02-20AK: Use size_t for CircularQueue and CircularDequeAndreas Kling
2020-02-16AK: Add HashMap, HashTable and Traits to Forward.hAndreas Kling
2020-02-15AK: Add BufferStream to Forward.hAndreas Kling
2020-02-14AK: Add Utf8View to Forward.hAndreas Kling
2020-02-14AK: Add LogStream and DebugLogStream to Forward.hAndreas Kling
2020-02-14AK: Add SharedBuffer to Forward.hAndreas Kling
2020-02-14LibCore: Add a forward declaration headerAndreas Kling
This patch adds <LibCore/Forward.h> and uses it in various places to shrink the header dependency graph.
2020-02-14AK: Add a forward declaration headerAndreas Kling
You can now #include <AK/Forward.h> to get most of the AK types as forward declarations. Header dependency explosion is one of the main contributors to compile times at the moment, so this is a step towards smaller include graphs.