1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibIPC: Support sending Variants over IPC

The format is quite simply the type index followed by the type in its
own native encoding; just implementing the receive side with static
typing is a bit convoluted. The only limitation of this implementation
is that the variant type has to contain an Empty somewhere as it is not
default constructible otherwise.

Co-authored-by: Ali Mohammad Pur <mpfard@serenityos.org>
This commit is contained in:
kleines Filmröllchen 2022-11-09 17:05:04 +01:00 committed by Tim Flynn
parent 5b4818df22
commit a06b277471
4 changed files with 56 additions and 0 deletions

View file

@ -196,6 +196,12 @@ Encoder& Encoder::operator<<(File const& file)
return *this;
}
// No-op.
Encoder& Encoder::operator<<(AK::Empty const&)
{
return *this;
}
template<>
bool encode(Encoder& encoder, Core::AnonymousBuffer const& buffer)
{