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:
parent
8eeedce805
commit
1858163d3c
4 changed files with 20 additions and 0 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue