mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibIPC: Add a simple IPC::Dictionary type (String key -> String value)
This commit is contained in:
parent
dce3faff08
commit
78943f031e
9 changed files with 101 additions and 0 deletions
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibIPC/Dictionary.h>
|
||||
#include <LibIPC/Encoder.h>
|
||||
|
||||
namespace IPC {
|
||||
|
@ -139,4 +140,13 @@ Encoder& Encoder::operator<<(const String& value)
|
|||
return *this << value.view();
|
||||
}
|
||||
|
||||
Encoder& Encoder::operator<<(const Dictionary& dictionary)
|
||||
{
|
||||
*this << (u64)dictionary.size();
|
||||
dictionary.for_each_entry([this](auto& key, auto& value) {
|
||||
*this << key << value;
|
||||
});
|
||||
return *this;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue