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

LibGUI: Use property deserializers in macros for registering properties

This commit is contained in:
Dan Klishch 2023-11-05 18:45:44 -05:00 committed by Andrew Kaster
parent 1689ec9100
commit bd56d2f508
2 changed files with 76 additions and 110 deletions

View file

@ -24,13 +24,13 @@ ErrorOr<String> PropertyDeserializer<String>::operator()(JsonValue const& value)
{
if (value.is_string()) {
// FIXME: Port JsonValue to the new String class.
return String::from_deprecated_string(value.as_string());
return String::from_byte_string(value.as_string());
}
return Error::from_string_literal("UTF-8 string is expected");
}
template<>
ErrorOr<DeprecatedString> PropertyDeserializer<DeprecatedString>::operator()(JsonValue const& value) const
ErrorOr<ByteString> PropertyDeserializer<ByteString>::operator()(JsonValue const& value) const
{
if (value.is_string())
return value.as_string();