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

LibCore: Add a way to set an individual Core::Object property remotely

This commit is contained in:
Andreas Kling 2020-03-05 15:46:00 +01:00
parent ca110a6e54
commit 42f2696355
3 changed files with 27 additions and 0 deletions

View file

@ -173,6 +173,15 @@ void Object::save_to(JsonObject& json)
json.set("parent", (uintptr_t)parent());
}
bool Object::set_property(const StringView& name, const JsonValue& value)
{
if (name == "name") {
set_name(value.to_string());
return true;
}
return false;
}
bool Object::is_ancestor_of(const Object& other) const
{
if (&other == this)