mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
LibCore: Support write-only Object properties
Some properties are set and then never retrieved, e.g. GUI icon paths. Add a helper to create such properties, similar to the read-only helper.
This commit is contained in:
parent
58f5deba70
commit
746364d7c1
2 changed files with 15 additions and 1 deletions
|
@ -26,7 +26,12 @@ public:
|
|||
return m_setter(value);
|
||||
}
|
||||
|
||||
JsonValue get() const { return m_getter(); }
|
||||
JsonValue get() const
|
||||
{
|
||||
if (!m_getter)
|
||||
return {};
|
||||
return m_getter();
|
||||
}
|
||||
|
||||
DeprecatedString const& name() const { return m_name; }
|
||||
bool is_readonly() const { return !m_setter; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue