mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Added a method ValueTree::getPropertyPointer()
This commit is contained in:
parent
3c68007aad
commit
45e2b00b6c
2 changed files with 16 additions and 4 deletions
|
|
@ -743,6 +743,12 @@ var ValueTree::getProperty (const Identifier& name, const var& defaultReturnValu
|
|||
: object->properties.getWithDefault (name, defaultReturnValue);
|
||||
}
|
||||
|
||||
const var* ValueTree::getPropertyPointer (const Identifier& name) const noexcept
|
||||
{
|
||||
return object == nullptr ? nullptr
|
||||
: object->properties.getVarPointer (name);
|
||||
}
|
||||
|
||||
ValueTree& ValueTree::setProperty (const Identifier& name, const var& newValue, UndoManager* undoManager)
|
||||
{
|
||||
jassert (name.toString().isNotEmpty()); // Must have a valid property name!
|
||||
|
|
|
|||
|
|
@ -145,17 +145,23 @@ public:
|
|||
/** Returns the value of a named property.
|
||||
If no such property has been set, this will return a void variant.
|
||||
You can also use operator[] to get a property.
|
||||
@see var, setProperty, hasProperty
|
||||
@see var, setProperty, getPropertyPointer, hasProperty
|
||||
*/
|
||||
const var& getProperty (const Identifier& name) const noexcept;
|
||||
|
||||
/** Returns the value of a named property, or a user-specified default if the property doesn't exist.
|
||||
If no such property has been set, this will return the value of defaultReturnValue.
|
||||
/** Returns the value of a named property, or the value of defaultReturnValue
|
||||
if the property doesn't exist.
|
||||
You can also use operator[] and getProperty to get a property.
|
||||
@see var, getProperty, setProperty, hasProperty
|
||||
@see var, getProperty, getPropertyPointer, setProperty, hasProperty
|
||||
*/
|
||||
var getProperty (const Identifier& name, const var& defaultReturnValue) const;
|
||||
|
||||
/** Returns a pointer to the value of a named property, or nullptr if the property
|
||||
doesn't exist.
|
||||
@see var, getProperty, setProperty, hasProperty
|
||||
*/
|
||||
const var* getPropertyPointer (const Identifier& name) const noexcept;
|
||||
|
||||
/** Returns the value of a named property.
|
||||
If no such property has been set, this will return a void variant. This is the same as
|
||||
calling getProperty().
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue