mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
LibIPC: Add support for passing around ByteBuffers and HashMap<K, V>
It should be noted that using a shared buffer should still be preferred over passing a raw ByteBuffer over the wire.
This commit is contained in:
parent
705ad670f3
commit
c930e02624
Notes:
sideshowbarker
2024-07-19 01:30:04 +09:00
Author: https://github.com/alimpfard
Commit: c930e02624
Pull-request: https://github.com/SerenityOS/serenity/pull/3984
Issue: https://github.com/SerenityOS/serenity/issues/3906
Reviewed-by: https://github.com/awesomekling
4 changed files with 59 additions and 0 deletions
|
@ -58,8 +58,19 @@ public:
|
|||
Encoder& operator<<(const char*);
|
||||
Encoder& operator<<(const StringView&);
|
||||
Encoder& operator<<(const String&);
|
||||
Encoder& operator<<(const ByteBuffer&);
|
||||
Encoder& operator<<(const URL&);
|
||||
Encoder& operator<<(const Dictionary&);
|
||||
template<typename K, typename V>
|
||||
Encoder& operator<<(const HashMap<K, V>& hashmap)
|
||||
{
|
||||
*this << (u32)hashmap.size();
|
||||
for (auto it : hashmap) {
|
||||
*this << it.key;
|
||||
*this << it.value;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Encoder& operator<<(const Vector<T>& vector)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue