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
commit 1858163d3c
Notes: sideshowbarker 2024-07-17 05:09:48 +09:00
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)
{