Browse Source

Added NamedValueSet::isEmpty()

tags/2021-05-28
jules 10 years ago
parent
commit
6a66ff75bb
2 changed files with 9 additions and 1 deletions
  1. +6
    -1
      modules/juce_core/containers/juce_NamedValueSet.cpp
  2. +3
    -0
      modules/juce_core/containers/juce_NamedValueSet.h

+ 6
- 1
modules/juce_core/containers/juce_NamedValueSet.cpp View File

@@ -39,7 +39,7 @@ struct NamedValueSet::NamedValue
{
}
NamedValue (Identifier&& n, var&& v)
NamedValue (Identifier&& n, var&& v) noexcept
: name (static_cast<Identifier&&> (n)),
value (static_cast<var&&> (v))
{
@@ -114,6 +114,11 @@ int NamedValueSet::size() const noexcept
return values.size();
}
bool NamedValueSet::isEmpty() const noexcept
{
return values.isEmpty();
}
const var& NamedValueSet::operator[] (const Identifier& name) const noexcept
{
if (const var* v = getVarPointer (name))


+ 3
- 0
modules/juce_core/containers/juce_NamedValueSet.h View File

@@ -63,6 +63,9 @@ public:
/** Returns the total number of values that the set contains. */
int size() const noexcept;
/** Returns true if the set is empty. */
bool isEmpty() const noexcept;
/** Returns the value of a named item.
If the name isn't found, this will return a void variant.
@see getProperty


Loading…
Cancel
Save