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

LibIPC+LibGfx: Pass the IPC::Decoder to decoding helpers

Instead of passing the BufferStream, pass the Decoder. I'd like to stop
using BufferStream eventually anyway, so it's good to get it out of any
API's where it's in currently.
This commit is contained in:
Andreas Kling 2020-03-29 19:03:13 +02:00
parent 01ff36a2f4
commit 24a0354ce8
9 changed files with 26 additions and 19 deletions

View file

@ -27,6 +27,7 @@
#include <AK/BufferStream.h>
#include <AK/String.h>
#include <LibGfx/Point.h>
#include <LibIPC/Decoder.h>
namespace Gfx {
@ -44,13 +45,13 @@ const LogStream& operator<<(const LogStream& stream, const Point& value)
namespace IPC {
bool decode(BufferStream& stream, Gfx::Point& point)
bool decode(Decoder& decoder, Gfx::Point& point)
{
int x = 0;
int y = 0;
stream >> x;
stream >> y;
if (stream.handle_read_failure())
if (!decoder.decode(x))
return false;
if (!decoder.decode(y))
return false;
point = { x, y };
return true;