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

LibCore+LibIPC: Add IPC coder for Core::DateTime

Since LibCore cannot depend on LibIPC, the coders are defined in LibIPC
just like they are for Core::AnonymousBuffer.
This commit is contained in:
Timothy Flynn 2021-04-15 10:33:28 -04:00 committed by Andreas Kling
parent 99e1d8a359
commit 6e10c2cdb7
3 changed files with 27 additions and 0 deletions

View file

@ -28,6 +28,7 @@
#include <AK/String.h>
#include <AK/URL.h>
#include <LibCore/AnonymousBuffer.h>
#include <LibCore/DateTime.h>
#include <LibIPC/Dictionary.h>
#include <LibIPC/Encoder.h>
#include <LibIPC/File.h>
@ -180,4 +181,11 @@ bool encode(Encoder& encoder, const Core::AnonymousBuffer& buffer)
}
return true;
}
bool encode(Encoder& encoder, const Core::DateTime& datetime)
{
encoder << static_cast<i64>(datetime.timestamp());
return true;
}
}