mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-09 11:06:10 +00:00
LibIPC: Add encoder and decoder for AK::OrderedHashMap
Seems like a useful thing to have.
This commit is contained in:
parent
a8a50a994b
commit
f2b4c044db
Notes:
sideshowbarker
2024-07-17 14:33:22 +09:00
Author: https://github.com/vkoskiv
Commit: f2b4c044db
Pull-request: https://github.com/SerenityOS/serenity/pull/13421
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/linusg
2 changed files with 29 additions and 0 deletions
|
@ -57,6 +57,17 @@ public:
|
|||
return *this;
|
||||
}
|
||||
|
||||
template<typename K, typename V>
|
||||
Encoder& operator<<(OrderedHashMap<K, V> const& hashmap)
|
||||
{
|
||||
*this << (u32)hashmap.size();
|
||||
for (auto it : hashmap) {
|
||||
*this << it.key;
|
||||
*this << it.value;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Encoder& operator<<(Vector<T> const& vector)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue