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

LibIPC: Add a built-in encoder/decoder for AK::Time

This commit is contained in:
Timothy Flynn 2023-02-24 13:51:37 -05:00 committed by Tim Flynn
parent 8eeedce805
commit 1858163d3c
4 changed files with 20 additions and 0 deletions

View file

@ -62,6 +62,13 @@ ErrorOr<JsonValue> decode(Decoder& decoder)
return JsonValue::from_string(json);
}
template<>
ErrorOr<Time> decode(Decoder& decoder)
{
auto nanoseconds = TRY(decoder.decode<i64>());
return AK::Time::from_nanoseconds(nanoseconds);
}
template<>
ErrorOr<URL> decode(Decoder& decoder)
{